Author Topic: ModbusTCP - Comms Failure 20 - Code to reset it automatically?  (Read 1949 times)

TSLJon

  • Newbie
  • *
  • Posts: 24
    • View Profile
Is there anyway when you see the message as attached you can get it to automatically reset the comms and not show the error message. If I come out of the form and reload it then it is fine again for 5 minutes.


TSLJon

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: ModbusTCP - Comms Failure 20 - Code to reset it automatically?
« Reply #1 on: April 11, 2014, 03:50:35 AM »
Any ideas chaps?

TSLJon

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: ModbusTCP - Comms Failure 20 - Code to reset it automatically?
« Reply #2 on: April 13, 2014, 10:24:25 AM »
Think i've solved this one. Few more ays of testing and will post revised code.

ijones

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ModbusTCP - Comms Failure 20 - Code to reset it automatically?
« Reply #3 on: April 23, 2014, 12:56:29 AM »
I'm curious what you have come up with as a cure for this issue.. I am having a similar problem when I 'read' a Modbus value and chart it's value. Because I'm just reading the value, it's not critical that it be a 100% and I occasionally get an exception message of Comm fail - 20. When I click the continue button on the message box, it goes away and all is well. Btw.. the charting will go on un interrupted even though the exception message is on the screen.
I get the feeling that the reason the exception is happening is because the PLC I'm talking to, is busy and therefore the vb code for the charting I'm doing throws the error. I am really a novice when it comes to all this and have read a bit that suggests that if I could subscribe to the plc address rather than just read it, it may put the request in line with other requests that are being made and would be successful.. Could this be the case? And if so, how in vb code??
Anyone with ideas?? Am I totally up in the night??
If there was a way to just get the exception message box to go away automatically,.... that would be a way to have it be less annoying... But I would rather get the code so that it handles the requests and exceptions correctly rather than just making it out of sight out of mind...

Ideas??

ShriramPendse

  • Newbie
  • *
  • Posts: 24
  • " AUTOMATION " simplified .
    • View Profile
Re: ModbusTCP - Comms Failure 20 - Code to reset it automatically?
« Reply #4 on: April 29, 2014, 12:31:16 AM »
When there is operator sitting at Advanced HMI application , he may respond to messages and take corrective action for errors .
But when we want to deploy it as unattended application (eg datalogger , reporting station etc) we have to cater for every eventuality.  I tried using try catch where ever possible  in HMI drivers code . I created various anomalies like PLC not responding , network error , so far so on and where ever code stopped  , I inserted try catch block . This way many exceptions were eliminated . But this is crude method , there must be better way to do this . Some " Guru " on AdvHMI would give better solution .