Hi, thanks in advance for any help you can provide.
I have Opto 22 optoopcserver running on the same PC as Labview 2013. I have the DSC module installed. The Opto 22 software package includes a test client and I am able to successfully read and write tags using the test client. When I connect using Labview, I can successfully create bound variables for the tags and it creates shared varibles which I can put in a VI to test reading and writing them. But the shared variables do not update, there doesn't seem to be a connection. I have the Windows firewall turned off.
Has anyone successfully used Labview to communicate to optoopcserver?
Since the firewall is off check the OPTOOPCSERVER™ USER’S GUIDE for more information about the appropriate DCOM settings.
Also, try an alternative communication method...run the shipping example "Monitor OPC Items with DataSocket.vi" and see if you get the same behavior.
Alejandro Calvo | Applications Engineer | National Instruments
Thanks. I ran Monitor OPC Items with DataSocket.vi and it's the same thing, I can see the tags but they don't update.
Interesting, can you please double check that the firewall is absolutely turned off for all locations (domain, private and public networks).
Plus, try the following steps (this enables remote communication to the OPC server):
1. Run dcomcnfg from command line.
2. Expand Component Services"Computers"My Computer. Right click My Computer and choose properties"Default Properties and activate 'Enable Distributed COM on this computer', select None for 'Default Authentication Level', select Identify for 'Default Impersonation Level'
2.1 Switch to COM Security tab, click 'Edit Limits' to add everyone account for both [Access Permissions] and [Launch and Activation Permissions]. Check all the Permissions for account everyone.
3. Select 'DCOM Config' under My Computer and search for opcenum. Open the properties"General. Authentication Level = None, switch to Security and edit all permissions to allow local end remote access to Everyone.
Hopefully this will unlock the block on the communication, make sure the test are performed while the OPC Server is active.
Thanks for your help. I have verified that the Windows firewall is off. I went into dcomcnfg and set things as you suggested. I've tried Authentication Level at both "none" and "Connect". Still having the same problem. When I run the Monitor OPC Items with DataSocket.vi the tag shows up in the Optoopcserver window, but the value in the VI doesn't update. Please see attached screenshot.
I opened the example on my end and did a little modification to the code. Instead of using a floating point number as the expected data type, I changed it to Boolean, generated a new indicator, ran it and it works.
Using the OPC Demo project that comes with the NI OPC Server I was able to see correct Boolean values.
I changed it to a boolean in the Monitor OPC Items with DataSocket.vi and it works. Thanks for pointing that out! So, now I have a connection using Datasockets.
Now the question is "why doesn't it work with shared variables?"
When I run the Monitor OPC Items with DataSocket.vi the name it creates is:
When I try to do it with shared variables I use the following procedure (this procedure worked recently with a different OPC server):
1) In a Labview project, right click on My Computer and select New - I/O Server
2) Select OPC Client
3) Select the OPC server
4)This will create a new library and under that will be an element called OPC1
5) Right click on OPC1 and select Create Bound Variables
6) Browse for the tag and click on Add>>
When I try this with the Optoopcserver, a client shows up in the Optoopcserver window with a group under it. But, when I click on "Add>>" the Optoopcserver window goes blank. The shared variable that gets created is:
My Computer\shared var test2.lvlib\OPC1\Opc browser database for silicon diffusion furnace\'C:\Users\Public\Documents\Opto 22\SiliFurn PAC Project\SiliFurn.otg'\'E1_Dig_FR_6 (192.168.2.116)'\D_FR_T56_N2_TransLC\STATE
So, it appears the Optoopcserver doesn't like that name for some reason.
Also, since I was able to successfully read the tag using the Monitor OPC Items with DataSocket.vi, I tried to modify it to write the tag. So, I changed DataSocket Read to DataSocket Write. The Detailed Help says DataSocket Write will take any datatype for the data input, but it seems to only take a cluster. I tried creating a cluster and then putting a boolean in it, but it doesn't work. Any idea on how to correctly modify the Monitor OPC Items with DataSocket.vi to write instead of read?
Regarding datasocket…yes it is possible to read any data type. Using a cluster is not valid in your case because you are opening a reference to a single variable with a unique data type (the expected read data type is not a cluster).
About the URL, don’t mix the path where the library is store on your computer with the actual OPC URL. Try following these recommendations to fix the communication problems: Why Can't LabVIEW DSC Connect to My OPC Server When Server Explorer and DataSocket Can?
Let me know how it goes
The procedure in Why Can't LabVIEW DSC Connect to My OPC Server When Server Explorer and DataSocket Can? did the trick, thanks! It's all working now.
Change the Identity Property of the OPC Server