dcharv Posted March 14, 2013 Share Posted March 14, 2013 I have connected a PLC to DAQ factory using modbus TCP and communication works fine. If I switch off the PLC, i get a "P-ModbusTCP 0010: Timeout" error as expected. When the PLC is switched on, communication does not restart unless I restart DAQ factory or if form the comm monitor I enter the configuration window. Is there a way to restart the communications automaticaly ? Link to comment Share on other sites More sharing options...
AzeoTech Posted March 14, 2013 Share Posted March 14, 2013 You most likely need to reinitialize the port. In script it is: device.mydevice.initcomm() Link to comment Share on other sites More sharing options...
dcharv Posted March 15, 2013 Author Share Posted March 15, 2013 yes, this worked, thanks actualy I wrote sequence that checks every 10 sec if the plc is communicating and if not tries to reinitialize the port v2000 is a plc memory location that increments every sec private x=0 while(1) if (v2000[0] == x) v.plc_error[0]=1 device.test_plc.InitComm() else v.plc_error[0]=0 endif x=v2000[0] delay(10) endwhile Link to comment Share on other sites More sharing options...
AzeoTech Posted March 15, 2013 Share Posted March 15, 2013 That kind of works, except that will still trigger if the value is read but doesn't change. You might consider doing v2000.time[0] instead of v2000[0] as this will change with a new reading even if the reading is the same value. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.