Opc Protocol Example In Vb Net

Posted on  by  admin
Opc protocol example in vb network
  1. Visual Studio Opc Client
  2. Vb.net Code Examples

Visual Studio Opc Client

Protocol

Member 8405106 25-Apr-13 1:3725-Apr-13 1:37Hello, guys.I am facing a big issue and couldn't get it to work yet.Well, first of all, I can read, write, whatever I want with this nice class. I am using WinXP and RSLinx OPC Server.The problem is when I purposely add some wrong ItemIDs in the middle of my array of items def.Let's se this example:PLC Tags:tag01tag02tag03tag04tag05ItemIDs:tag01tag02tagkjuiooasjtag04tag05If at least ONE OF THE ITEMS is wrong, then the whole OPCGroup becomes strange and it says all of my items have either BAD quality or retunrs 'null'.Does anyone know how to solve this issue?I have to add wrong items and even though, must see those good ones.Thanks,Diego. Abith 24-Jul-12 2:0824-Jul-12 2:08hi i have developed own opc client in.neti use this methodOpcRcw.Da.IEnumString enmString;obj.BrowseOPCItemIDs(OPCBROWSETYPE.OPCBRANCH, ', (short)VarEnum.VTEMPTY, 0, out enmString);to get the parent node from the alpahacomm opc server. When i run my program as windows application all the three items are callbacked in enmstring.

Blue face thotiana mp3

Vb.net Code Examples

But when the same program is executed as windows service i am not able to get the third node.I am running in windows 2003 machine. But the same program is working fine in windows xp.Thanks in advance.

Opc Protocol Example In Vb Net

Member 7706356 9-May-12 5:489-May-12 5:48I am new to VB.Net 2008. Trying to port old code from VB6.Public CHandles As LongPublic SHandles As LongPublic rerrors As LongPublic itemvalues As ObjectDim Str As StringOnce number of items is known:itemcount = 32;ReDim SHandles(0 To itemcount)ReDim rerrors(0 To itemcount)ReDim CHandles(0 To itemcount)ReDim Str(0 To itemcount)In VB6, these were 1 to itemcount but VB.Net doesn't like this.Now the following line:g.OPCItems.AddItems(itemcount, Str, SHandles, CHandles, rerrors)Generates a SafeArrayTypeMismatchException was unhandled. Specified Array was not of the expected type error.Str0 is nothing.Str1 to Str32 have text in them that represent names of registers in a PLC.Shandles0 to Shandles32 have 0 to 32 in them respectively.CHandles0 to Chandles32 have 0 to 32 in them as well.Rerrors0. Are all 0I feel like the dll (OPCDauto.dll) is not expecting a safearray or doesn't like the fact that the array is 0 to 32 instead of 1 to 32.Tried to review and understand previous posts related to this problem but I cannot see my way through.I am a EE with some programming experience. I am not an expert so please respond speaking slowly and using small words.Thanks for any help you can provide.Tom. Learning WIX 5-Feb-12 19:265-Feb-12 19:26Hi,I am using the OPCDotNetLIb to connect to OPC server.

I created new OPCClient which connets to our internal OPC server. While we are reading the values one by one there is no problem but performance is slow. To increse the performance we thought to add teh items in group and then read the value. We set the limit 35 items to read every time. First time it is running perfactly fine but when we are again adding the items and reading the value it is throwing the following error. Before every additems we are removing the existing items.The server threw an exception. (Exception from HRESULT: 0x80010105 (RPCESERVERFAULT))error comes in Additems method at following condition.if( HRESULTS.Failed( hresult ) )Marshal.ThrowExceptionForHR( hresult );Can you please help us?

Coments are closed