LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV Application reads the latest value from OPC URL or stops working after MatrikonOPC SiemensPLC server restarts

Hello all, 

 

In an application which is written to read values from MatrikonOPC and use those values as trigger for data acquisition, I have used Datasocket connection once for establishing the connection and then frequently reading values and updating them in the loop. For a year this application works perfectly, but suddenly after new year I got a problem. When "MatrikonOPC Siemens PLC server" application restarts, Datasocket read cannot realize that connection is lost. I appreciate it if someone tell me why this problem occurs and what will be the solution to fix it?

 

Best,

Puya

0 Kudos
Message 1 of 7
(3,292 Views)

No reply? No one experienced the same issue?

0 Kudos
Message 2 of 7
(3,232 Views)

Hi Puya!

 

My first thought is that there might have been some change in the software on your computer. Do you still use the same version of LabVIEW and Datasocket on your computer (and what version are/were these)? What happens on your screen in the DataSocket when you restart your PLC server? What used to happen before?

0 Kudos
Message 3 of 7
(3,217 Views)

Hello Carl,

 

I took a snapshot that shows what I have already installed on the pc which is running OPC server + LV app. In some of the pictures I have tried to show no errors will be generated to indicate disconnection from the server. Just in case of setting "DataSocket Read Function: Wait for updated value" true, Time out will indicate disconnection. But perhaps that is not a good idea to wait in the loop for updated values which are going to be registered in the database with actual time stamps.

 

Best,

Puya 

 

 

0 Kudos
Message 4 of 7
(3,167 Views)

Thanks for the images.

 

The reason why the DataSocket doesn't give an error when connection breaks, and instead show the latest datails, is because it's the default behavior of DataSocket. Since it's expected, you don't receive any error. There are several functions that can be used to check the status of the connection (http://digital.ni.com/public.nsf/allkb/C94E75AF6DEB344486256F59001B4F7B). Also, note that the default "ms timeout" is 10 seconds; if you experience a long unresponsiveness, it could be because of this wait time.

 

I'm not sure why the DS function doesn't resume the data reading operation when the connection returns, but this link suggests a way to solve the issue: http://digital.ni.com/public.nsf/allkb/86256A47004E16D186256A400081E4E9?OpenDocument

 

You could try to use the timeout boolean to exit the while loop (in your code), try to reconnect using the VI in the second link, and then restart the while loop to proceed with the data readings.

0 Kudos
Message 5 of 7
(3,128 Views)

Hello Carl,

 

Sorry for late response due to summer vacation 🙂 Would you please renew the first link? (http://digital.ni.com/public.nsf/allkb/C94E75AF6DEB344486256F59001B4F7B). It doesn't work. Many thanks.

 

Best,

Pouya

0 Kudos
Message 6 of 7
(3,047 Views)

Hi Puya! Hope you enjoyed your vacation 🙂

 

The end-parenthesis and dot were somehow included in the link. Here is the link works: http://digital.ni.com/public.nsf/allkb/C94E75AF6DEB344486256F59001B4F7B

0 Kudos
Message 7 of 7
(3,034 Views)