LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Good example to use, to communicate with a remote opc server?

Hi, i'm wanting to communicate with an opc server over the ethernet. Currently using a non labview based client, i require a Labview based client. And will using this as part of my labview program.

 

 

Thanks Stuart

0 Kudos
Message 1 of 8
(3,411 Views)

Use the example at the following link:

How Do I Connect to an OPC Server Using DataSocket?

 

If you have any questions, please post back.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 8
(3,403 Views)

Hello Adnan,

 

I have a question concerning OPC and dataSocket:

 

how can I detect a connection loss?

My problem is that a connection that gets interrupted, let's say by disconnecting the network cable or server shut down, doesn't lead to any errors or data output change on a data socket read vi. A heartbeat signal, that could be monitored to detect connection loss, is not available on the server-side.

 

Any ideas?

 

Thanks in Advance,

Thomas

 

0 Kudos
Message 3 of 8
(3,395 Views)
I am not sure how you would go about doing this. Maybe run another application on the server that can monitor a heartbeat signal? I have never had a need to do this from the server side (since I never saw the need for the server to know there has been a connection loss with a client). Can you explain your use case?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 8
(3,346 Views)

Hi Adnan,

 

I want to detect a connection loss on the client side.

 

I'm using data socket as OPC-client to read data from a third party remote server and I'm currently not able to detect (on client side) any kind of connection loss . For example, if someone shuts down the remote server pc or pulls the LAN-cable or anything like this, I would like to detect it somehow. In case of connection loss the data socket read vi simply delivers the last read value  without any error, warning or status change (at least in LV 8.5.1 it does). I need to find a way to check (on client side) the connection status somehow to be able to react on it. Any suggestions?

 

Thanks in advance,

Thomas

 

 

 

 

 

0 Kudos
Message 5 of 8
(3,341 Views)

Hi ThHagel,

 

Perhaps there's a way you could send a "true" value to the client every x seconds and just check for "false" on the client side for timeout? 

Regards,


Imtiaz Chowdhury
Project Manager
Green Running / Austin Consultants

0 Kudos
Message 6 of 8
(3,240 Views)

Hi Thomas, did you solve this problem?? as have the exact same problem.

 

Stuart:)

0 Kudos
Message 7 of 8
(3,003 Views)

Hi Stuart,

 

unfortunately I didn't solve it. If your OPC-Server provides any cyclically changing signals, use them to detect connection loss. 

 

 

Regards,

Thomas

 

0 Kudos
Message 8 of 8
(2,951 Views)