okinelin

"p-Modbustcp 0010: Timeout" Error

Recommended Posts

Hi,

 

I am using DaqFactory to communicate with HMI/Controller via Modbus TCP.

The system is working fine. When the network cable is unplugged, the error message "P-ModbusTCP 0010: Timeout"  is displayed in the Command/Alert window. That's fine.

 

Please how can I capture this error and use in a sequence to alert the user that there is a break in communication especially when the program is in runtime mode and full screen?

 

Thanks

 

 

Share this post


Link to post
Share on other sites

If you are using channels to poll over Modbus, you'll need to use the OnAlert sequence function to capture any alerts (section 5.28 in help).  Or you can use the strAlert system variable (14.3 in help).

Share this post


Link to post
Share on other sites

If you are using channels to poll over Modbus, you'll need to use the OnAlert sequence function to capture any alerts (section 5.28 in help).  Or you can use the strAlert system variable (14.3 in help).

 

Thanks for the lead. I am taking a look at the two options but I need further clarification;

 

Please confirm that strAlert[0] will containn "P-ModbusTCP 0010: Timeout" when a connection is lost? The "P-ModbusTCP 0010: Timeout" is the error message displayed when I pull out the network cable.

 

If I plug back the cable and the connection is re-established and the there is no other alert message, what will be the content of  strAlert[0]? Will it still contain "P-ModbusTCP 0010: Timeout" or something else?

 

Regards

Share this post


Link to post
Share on other sites

The best way to confirm is to actually try it.  strAlert[0] will hold the last alert message until the next one comes in, at which point, the message moves to [1], etc.  I believe it will store the last 100.  Its really designed to allow you to use a table component or similar to simply display the message history.  To actually do something more specific, you should really use OnAlert.  Then you can do whatever you want.

Share this post


Link to post
Share on other sites

Hi,

 

This was the exact thread title I was going to use.

 

I have a UE9 and a PSL PQube on a network working with DAQ Factory.

 

I have a "p-Modbustcp 0010: Timeout" Error that comes up sporadically, I haven't figured out why yet.

sometimes I lose the PQube for minutes or more at a time to this error, and sometimes it runs fine.

 

the ue9 seems to be ok for the most-part but I have a "C1038 Timing lag, data acquisition stalled.  Resetting. Timing: 1.000, Offset: 0.000" That comes up sometimes and seems to repeat every ~20sec.

It looks like it occurs when I have lost comms to the PQube.

 

I am using a sequence to get the LJ channels read because of the speed (2khz), but am still using the "channels" to read the registers from the PQube at 1hz..

 

please advise.

 

Thanks.

Share this post


Link to post
Share on other sites

You get the timing lag because the Timeout's slow down the Timing loops to the point where they lag far enough behind that DAQFactory resets them.  Ignore that error as its a biproduct of your main Timeout error.  This is also why you should put UE9 and PSL channels on different Timing / Offset combos.  If they are the same, the timeouts will drag down the UE9 poll rate.

 

You can try reiniting the port if you lose data for more than, say, 3 seconds.  Its easiest to do this if you are not using channel timing, but even with channel timing you can do it.  Let's say you have a channel called PSL on a device called PQube:

 

private lastTime = systime()

private watchdogTimeout = 3

while(1)

   if ((systime() - PSL > watchdogTimeout) && (systime() - lastTime > 60))

      device.PQube.initComm()

      lastTime = systime()

  endif

  delay(1)

endwhile

 

Something like that.  Note that you don't want to continuously reinit the port, otherwise it'll never get inited, so I only do it once a minute if the connection stays dead.

Share this post


Link to post
Share on other sites

ok..
Sorry, I should have mentioned that there are ~5 channels on the LJ that I believe are timed by the sequence and there are ~11 registers being read from the pqube.
 
how would you advise their timing being adjusted.
 
I'll attach the .ctl

 

Thanks!

PQUBE GUI.ctl

Share this post


Link to post
Share on other sites

Hi,

I am also using DaqFactory to communicate with HMI via Modbus TCP.   Communication works fine and receiving data from HMI correctly and can not find anything is wrong but the error message "P-ModbusTCP 0010: Timeout" keeps displaying in the Command/Alert window.

I checked channel settings,  tried different timeout values but does not change. I can not figure out why getting this P-ModbusTCP timeout error while communication seems all fine.  Please advise.

Share this post


Link to post
Share on other sites

It is hard to say.  It is probably just one channel that is causing it.  Either you are querying an invalid tag, or you have other settings wrong on one of your channels, such as D# set to 0 instead of the proper Modbus ID.  I would go through and set the Timing of all your channels to 0, then reset them one by one until the message starts appearing.  Then you'll know which channel is causing the troubles.  

Share this post


Link to post
Share on other sites

I tested with only one channel and checked again. Still keeps getting this timeout errors in the Command/Alert windows.   Modbus ID and reading registers are all correct. The value read from the HMI is matching with no problem at all.  Please see the attached screenshot and my test application. Tried also timing to 0 to reset but it does not semm to work. Once I put timing back to 1, timeout error pops up again.  I am only test on desk so the cable is quite short. Can't think what else could cause this error?

Screen Shot 03-08-19 at 11.04 AM 001.PNG

Screen Shot 03-08-19 at 11.04 AM.PNG

Read Channels.ctl

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now