Author Topic: Undef.Interrupt.. with the NANO  (Read 18160 times)

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Undef.Interrupt.. with the NANO
« on: June 13, 2016, 10:37:43 AM »
Hey,

I got this error with the nano after a week of working fine. This NANO is programmed to read VFD status from the network via RS485. Everything was working fine until this morning.

Error:
Undef.Interrupt..
CF #0004:01AE

See attached picture...
Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:Undef.Interrupt.. with the NANO
« Reply #1 on: June 13, 2016, 05:50:31 PM »
Ed,

You may have broken the Nano-10 firmware.   I'm sure the guys at TRI will get a hold of you.

But if the error message that you are seeing on the LCD display,  is consistent:

Undef.Interrupt..
CF #0004:01AE


Then you may be able to figure out what is causing the error.  

I got the hint from Leon Yew at TRI.  The "CF #0004:01AE" part of the error message is a hint as to where the undefined interrupt happened.

The "CF #0004" indicates that the PLC was executing custom function #4.

The "01AE" is an address of the PLC instruction that may have triggered the Interrupt.

Open up your custom function #4 for editing and press the <F8> key.  A new window will open labeled "Listing of Custom Function #11".  The left side of the screen will have 4 digit hex numbers.  These numbers correspond to addresses in the executable code for each line of code.  Figure out where your 01AE address falls in the listing.

The TBASIC line before the 01AE value is probably what has caused the exception.  Look very carefully at these lines of TBASIC around the 01AE address and you may find something in your code that can and will fail to compute.

There are many exceptions that can only be caught at run time.  These include:
  • Dividing by 0
  • Breaking the subroutine stack (it is limited to 5 levels and you nest subroutines deeper than 5 you will get an error).  If you execute a RETURN statement from code that was not called as a subroutine you will get screamed at.
  • Accessing DM[] with an impossible index, say DM[12345678]
  • And a bunch of other things

All of those things will show up on the 4x20 display and cause the PLC to PAUSE. Unfortunately, I have no insight into what can cause an "Undef.Interrupt..".  This is where you will need help from the TRI guys.

Gary D*ickinson
« Last Edit: June 13, 2016, 06:04:44 PM by garysdickinson »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Undef.Interrupt.. with the NANO
« Reply #2 on: June 13, 2016, 10:09:51 PM »
Yes pressing F8 while the Custom function #4 is opened will yield some information about where the undefined interrupt is being triggered. Feel free to send your code to support@triplc.com if you need us to look into it.

What is your firmware version?

Undefined interrupt sometime happens when an interrupt based hardware is disabled at the wrong instant when an interrupt is pending but not yet processed and this is where we want to look into. The undefined interrupt can be trapped by setting up an interrupt service routine using INTRDEF 100, n, 1   where n is the function number to handle the undefined interrupt. Often undefined interrupts are quite harmless and can be exited with a RETURN statement but it gives you a chance to keep track of the number of times it happens by storing it inside a non-volatile memory location.  You can also initiate an orderly restart procedure by saving all the critical parameters in non-volatile memory and then run a "REBOOT" command to restart the PLC and reload the parameters so that the program resume where it left off.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:Undef.Interrupt.. with the NANO
« Reply #3 on: June 14, 2016, 05:57:50 PM »
Guys, thanks for the info! Unfortunate, I can't seem to understand why it is happening. The program the PLC is  running is really simple. It's a Modbus master that loops through several VFD's using a sequencer to increment. I have attached the file for your review. The sequencer was initially incremented every second, now I have increased the timing to increment every 3 seconds to see if that fixes this bug.

Anything more info after your review will be greatly appreciated.

Thanks,
Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:Undef.Interrupt.. with the NANO
« Reply #4 on: June 15, 2016, 02:38:01 PM »
Ed,

I have reviewed your program and run it in simulation.

I didn't find anything in your program that should get you the Undefined Interrupt exception.

Gary D.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Undef.Interrupt.. with the NANO
« Reply #5 on: June 15, 2016, 03:38:13 PM »
What is the firmware version of your PLC? If the firmware is >= r83 you can upgrade the firmware to the latest version and the issue may already have been fixed in the latest firmware.

It appears that something happen when the PLC was reading data from a Modbus slave and the undefined interrupt was invoked.  This is very rare but the undefined interrupt is unlikely to be destructive to the PLC's operation. You can continue to monitor the operation and see if the undefined interrupt is repeatable at the same location.  Alternatively if this is a production system and must operate continuously You can add in the INTRDEF 100,n,1 as described in the previous thread to let the PLC recover automatically while keeping track of the number of times the same event took place.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:Undef.Interrupt.. with the NANO
« Reply #6 on: June 16, 2016, 11:43:45 AM »
Thanks all, the firmware is r73. I will monitor the operations for the next few days and let everyone know how it goes.  If for some reason I get the same error on a different functions how would I be able to address the issue using INTRDEF 100,n,1 for multiple functions?

Thanks,
Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Undef.Interrupt.. with the NANO
« Reply #7 on: June 16, 2016, 02:28:37 PM »
Thanks for the info. Firmware r73 was released in 2010. Since then there have been a number of bug fixes to avoid triggering the undefined interrupt. Also INTRDEF 100, n, 1  error trap was implemented only from firmware r75 onwards so unfortunately this will not help in your setup.

The best solution to fix this issue is to upgrade your PLC firmware. However, firmware upgrade by user is only possible from firmware r83 onward. To upgrade r73 to the latest firmware you can email support@triplc.com to arrange to return the unit to our office to upgrade the firmware.

« Last Edit: June 16, 2016, 02:30:08 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:Undef.Interrupt.. with the NANO
« Reply #8 on: June 17, 2016, 07:57:12 AM »
Great! Thanks, I will reach out to your support team.

Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.