LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data socket not finding PLC immediately after windows logon

I'm using LV data socket to communicate with a Rockwell PLC via RS Linx. The problem I have is that I can only connect to the PLC successfully second time around. The first time I run my code after logging onto windows the data socket returns error 56. If I stop, exit and restart the program then the PLC connection is made almost instantaneously. I'm wondering if the cause might be to do with RS Linx not being configured correctly, but it's puzzling why it should only work after one unsuccessful attempt. I am starting RS Linx immediately at logon.

0 Kudos
Message 1 of 4
(2,737 Views)

I don't know RS Linx, but may be some intermediate software to be loaded and initialized when you make the first read. This intermediate software may not be ready before the read timeout expires.

When connecting to an OPC server, I always put at least one dummy read in order to "wake up" all the stuff, overlooking any error in this first stage.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 4
(2,684 Views)

Thanks. I guess it's a possibility. The only thing is it doesn't seem to matter how long I wait after logon - the first attempt to access the PLC seems to fail.

0 Kudos
Message 3 of 4
(2,681 Views)

In my case, the right OPC server is started only at the time I indirectly call it by reading an OPC item. This "magic" is done thru the MS OLE mechanism.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 4
(2,678 Views)