LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

connection to OPC 3.0 server using datasocket?

Hi,

I'm trying to connect to an V3.0 OPC Server to read and write to DA items. Using data socket I can read all data i need but I seem to not be able to write to any item new values.

Somewhere on the NI page it is mentioned that communication with v3.0 servers is not supported by Datasocket (using LabView 8.6)and one has to buy the DSC module.

IS there anything I'm missing or why can i read but not write to the server?

 

Cheers

 

Andreas

0 Kudos
Message 1 of 9
(4,088 Views)

Hi Andreas,

 

as it is stated in this KB article: "NOTE: DataSockets cannot communicate with OPC Server 3.x". So you should use the ^DSC module.

 

Best regards,

 

Blase 

0 Kudos
Message 2 of 9
(4,063 Views)

sorry,

that was an error from my side. My server supports OPC DA versions 1.0 2.x and 3.0 but is downcompatible, which means that the datasocket should be able to write to it.

As I mentioned I am able to read data from the server but unable to write!

So I do not think I need the DSC module in the end, more over I have to find a way to write to the server!

 

Any ideas on that?

 

Cheers

 

Andreas

0 Kudos
Message 3 of 9
(4,050 Views)

Hi Andreas,

 

if you're sure that your OPC server is compatible with data socket, then the only thing I could think of would be the access rights. Can you verify that you can write these items using a different OPC client?

 

Blase 

0 Kudos
Message 4 of 9
(4,043 Views)

 

Hi Blase!

 

normally I use the Softing Demo OPC Client to make the changes. I tried the scenario with the NI OPC Quick Client and that also does the trick.

 

So its not that the server is only supporting one Client  Manufacturer! To write data to the opc server i first have to log onto, that is done by writing some values to certain strings in a certain order one of those values is a string (the password). One of the problems I imagined is that this causes some problems in the conversion of the string from one type to another, so i checked if i can write the string as an 16 byte integer I2 which i could do with the softing client. this also didn't work.... In any case the functionality is given the problem is somewhere in LV and the datasocket mode or something...Any ideas or propositions on that? Cheers Andreas

0 Kudos
Message 5 of 9
(4,041 Views)

Hi Andreas,

 

one thing that you could check is the mode input value for the "DataSocket Open Function" VI. The default value is "Read", did you change it to "ReadWrite"?

 

Thanks,

 

Blase 

0 Kudos
Message 6 of 9
(4,035 Views)

Yes! Depending on the mode of the OPC item i change it to read, write or readwrite... Doesn't do the trick!

0 Kudos
Message 7 of 9
(4,030 Views)

Hi Andreas,

 

in this case the only idea I had is to really use the DSC module. That will probably solve the problem, with that module you can manage all the I/O items much better than with the Data socket communication. Which OPC server do you use? Could you post an example (including the OPC server) that shows the problem?

 

Thanks

 

Blase 

0 Kudos
Message 8 of 9
(4,021 Views)

Hi,

I tried the dsc module as a test version but either i didn't understand it correct or that also can't solve the problem!

 

I tried to issue a scan command to the server (it scans the attached hardware for changes), the command is issued as a write command to the URL "opc://localhost/ddddddddddddddddd/Scan". I got the expected reaction of my hardware. So when I trye to write to "opc://localhost/ddddddddddddddddd/1008290100001817/Requested Access Level" where I need to write (it is read/write)to in order to log on (after writing there I also have to write the password to "opc://localhost/ddddddddddddddddd/1008290100001817/Password" (this is write only))  i cant write. To put it better. I can write because i dont get en error from DS Open/ DS Write / or DS close but the commands are not causing anything to happen in my hardware!

 

I don't know how to upload the OPC server, but as for the VI it is only a chain of DS Open/write/close with the variables I need!

0 Kudos
Message 9 of 9
(3,982 Views)