Author Topic: INTRDEF 100, n  (Read 12203 times)

Philippe Parmentier

  • Newbie
  • Posts: 29
  • new in plc
    • View Profile
INTRDEF 100, n
« on: April 09, 2014, 01:03:27 PM »
Greetings,

Have you some samples of code for trapping runtime errors,

Especially how do you get the displayed error messages on line 1 and 2 of the LCD display

What type of recover we ca do, exept doing a reset and error logging?

Regards

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:INTRDEF 100, n
« Reply #1 on: April 09, 2014, 08:34:03 PM »
You can trap the error using INTRDEF 100, n, 1

where n is the custom function number (1 to 256) which is used to trap the run time error.  All you need to do is write some code in the function #n where you want to handle the errors.

What is displayed on the LCD indicates the function number and the code address where the runtime error occur.  You can then open that particular custom function and press F8 to get a list of the code addresses for that function, which you can then narrow down to find where the runtime error took place.
« Last Edit: April 09, 2014, 08:35:55 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Philippe Parmentier

  • Newbie
  • Posts: 29
  • new in plc
    • View Profile
Re:INTRDEF 100, n
« Reply #2 on: April 10, 2014, 12:10:51 PM »
Thanks,  but i would like to trap this error message to save it on a file for further troubleshooting, or off line logging

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:INTRDEF 100, n
« Reply #3 on: April 10, 2014, 12:54:11 PM »
Unfortunately the error messages on the LCD display are not available to the TBASIC program itself.

However, the runtime error messages displayed on the LCD  can be retrieved from an external host processor using the host link commands RV$1 to RV$4.  

So one way is to setup a PLC to monitor the running state of the other PLCs. When a runtime error occur the PLC that trapped the error could alert the monitoring PLC that an error has occurred and the monitoring PLC can then query the running PLC for the error message and log these data to a TLServer or a webserver.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS