‎02-22-2018 12:41 PM
Hello,
I am attempting to connect to RSLinx OPC server in order to read the PLC data into an array and save to spreadsheet. I have the RSLinx setup i just can't get Labview to see the server. Are there any examples out there that would work? I'm running LV2017 on a 64-bit machine.
‎02-23-2018 01:57 AM
Please give more details. Do you get any error message? Is the server on the localhost? Are you trying to read a group of items as an array?
Can you see the server with the "Browse to OPC Item.vi" example?
As far as I know, to read an item you only need to open a Datasocket connection with the proper URL in input. URL prefixes depend on the OPC server.
‎02-23-2018 08:48 AM
Ok, I spent some time playing with the example code I found.
I am able to open the URL and see the tags, I can grab one tag at a time and see the data.
What would help out a lot is to be able to put all of the tags of interest into an array to be read and then output an array to be sent to spreadsheet.
Seems like there are a few different ways to do this, I would appreciate some ideas on how to do this in the most efficient way possible. I'm interested in (16) data tags, would it be possible to use base address, since they are all the same, and just run it through a loop to increment the URL by (1) each time it executes? The data is TC data and does not require high speed read/capture.
Any ideas on how to do this would be appreciated.
‎02-23-2018 10:27 AM
Hi there,
If you're using datasockets, then follow the screenshot in this KB to read multiple tags and put the data into an array:
DataSocket Connections for OPC Items
This pretty much does exactly what you said. It opens a datasocket connection to the URL of every tag you want to read and then reads them one at a time in a for loop. Easy peasy!
You might also look at the LabVIEW DSC Module, which lets you map OPC tags into LabVIEW shared variables.
-Jordan