Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get definition of variable from OPC

Dim ItemsDef(NBR_ITEMS) As String
Dim DeviceAddress As String
Dim IndItem As Long


DeviceAddress = "MBT:152.160.178.60"


'Preparing the Handles for "AddItems"


For IndItem = 1 To NBR_ITEMS


ItemsDef(IndItem) = DeviceAddress & "!40000" & Format(IndItem) '40000 is the memory location of variable in the OPC, how can I get the variable name, what is the code or syntax?


Next
blah...

How or what can I put instead of 40000 in order to get the definition of the variable from the symbol table? Can I put a variable instead? Does anyone know the syntax I should use? Is the syntax I am using correct? Any helps would be greatly appreciated.

Thanks,
Calvin
0 Kudos
Message 1 of 4
(3,723 Views)
What type of OPC server are you communicating with? It sounds like you are trying to access some variable on a PLC that has OPC server capabilities. If this is the case, what brand of PLC are you using? Also what National Instruments products are you using, are you communicating via DataSocket to the OPC server? Or are you communicate with Lookout Protocol Drivers?

This type of information will go a long ways in helping others help you.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 4
(3,723 Views)
I am using on a PLC that has OPC server capabilities, the PLC is from schneider momentum. I am connecting through IP address of the PLC server
0 Kudos
Message 3 of 4
(3,723 Views)
Well, as far as working with that particular PLC via low-level TCP/IP goes, I do not have much experience with it.

Now, if you were communicating with the OPC server exposed by the PLC with DataSocket, I might be able to give you some tips on that. You can obtain a Visual Basic DataSocket API with National Instruments Measurement Studio package. Go to http://www.ni.com/mstudio for more information on Measurement Studio.

Other than that, hopefully, someone else in the forum might have experience with Schneider Momentum PLCs.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 4 of 4
(3,723 Views)