TML Interrupt Settings Dialogue

The “Interrupt Settings” dialogue allows you to activate and/or deactivate the TML (Technosoft Motion Language) interrupts. When a TML interrupt occurs, the normal TML program execution is suspended to execute a TML function associated with the interrupt, called Interrupt Service Routine (in short ISR). The TML interrupt mechanism is the following:

The drive continuously monitors 12 conditions that may generate TML interrupts. In case of motion controller applications there is a 13th condition related to slave error status.
The motion controller has an additional condition that triggered interrupt when an error on the slaves occurs
When an interrupt condition occurs, a flag (bit) is set in the ISR (Interrupt Status Register)
If the interrupt is unmasked e.g. the same bit (as position) is set in the ICR (Interrupt Control Register) and also if the interrupts are globally enabled (EINT instruction was executed), the interrupt condition is qualified and it generates a TML interrupt
The interrupt causes a jump to the associated interrupt service routine. On entry in this routine, the TML interrupts are globally disabled (DINT) and the interrupt flag is reset
The interrupt service routine must end with the TML instruction RETI, which returns to normal program execution and in the same time globally enables the TML interrupts.

 

Interrupt settings dialog for drive/motor

interruptsettings

 

Interrupt settings dialog for motion controller

interruptsettingsoncontroller

 

The 13 conditions are:

1.Int0 – Enable input has changed: either transition sets the interrupt flag
2.Int1 – Short-circuit: when the drive/motor hardware protection for short-circuit is triggered
3.Int2 – Software protections: when any of the following protections is triggered:
a)Over current
b)I2t motor
c)I2t drive
d)Over temperature motor
e)Over temperature drive
f)Over voltage
g)Under voltage
4.Int3 – Control error: when the control error protection is triggered
5.Int4 – Communication error: when a communication error occurs
6.Int5 – Wrap around: when the target position computed by the reference generator wraps around because it bypasses the limit of the 32-bit long integer representation
7.Int6 – LSP programmed transition detected: when the programmed transition is detected on the limit switch input for positive direction (LSP)
8.Int7 – LSN programmed transition detected: when the programmed transition is detected on the limit switch input for negative direction (LSN)
9.Int8 – Capture input transition detected: when the programmed transition is detected on the 1st capture/encoder index input or on the 2nd capture/encoder index input
10.Int9 – Motion is completed: in position control, when motion complete condition is set and in speed control when target speed reaches zero.
11.Int10 – Time period has elapsed: periodic time interrupt with a programmable time period
12.Int11 – Event set has occurred: when last defined event has been occurred
13.Int12 Error on slave has occurred: when a slave reports an error. The errors reported by the slaves are configured from Slave Management dialog.

 

Remark: Int12 – Error on slave has occurred is available only in motion controller applications.

 

After power-on, the TML interrupts are globally enabled together with the first 4 interrupts: Int 0 to Int 3. For Int 2, all the protections are activated, except over temperature motor, which depends on the presence or not of a temperature sensor on the motor; hence this protection may or may not be activated. For each of these 4 interrupts there is a default ISR which is executed when the corresponding interrupt occurs. You can view the contents of the default ISR in the TML Interrupt Service Routines view. From this view you may also modify the default ISR for these interrupts and/or define ISR for the other TML interrupts.

Before using other TML interrupts, you need to enable them from this dialogue. Keep in mind that the interrupt flags are set independently of the activation or not of the TML interrupts. Therefore, as a general rule, before enabling an interrupt, reset the corresponding flag. This operation will avoid triggering an interrupt immediately after activation, due to an interrupt flag set in the past.

Remarks:

On entry in an ISR, the TML interrupts are globally disabled. If you want to enable during the ISR execution ant of the other interrupts, set accordingly the interrupt mask in the ICR register and insert the EINT instruction that globally enables the interrupts
The interrupt service routines are similar with the TML functions, except for the return instruction: RETI (RETurn from Interrupt) instead of RET (RETurn from subroutine). Like the TML functions, the TML interrupt service routines must be positioned after the end of the main program. EasyMotion Studio handles automatically this aspect.

 

Check Globally Enable TML interrupts to globally enable the TML interrupts. Check Globally Disable TML interrupts to globally disable the TML interrupts. At Enable/Disable TML interrupt choose one or several interrupts and select either Enable or Disable to activate or deactivate them. The status of the other interrupts remains unchanged. For the interrupts enables, check also Reset previous TML interrupt request to reset the corresponding interrupt flag(s) set in the past.

For Int2 – Software protections, select Enable and press Details to modify the status (enabled or disabled) of the protections triggering this interrupt.

interruptsettingssoftwareprotectionsdetail

For Int 6 - LSP programmed transition detected and Int 7 - LSN programmed transition detected select Enable and press Details to select the monitored transition: high to low or low to high.

interruptsettingslspdetail interruptsettingslsndetail

For Int8 – Capture input transition detected select Enable and press Details to select the monitored transition: high to low or low to high and the capture/encoder input to use: 1st or 2nd

interruptsettingscapturedetail

For Int10 – Time period has elapsed select Enable and press Details to set the time period.

interruptsettingstimedetail

Remark: Some of the drive/motor protections may not work properly if the TML Interrupts are handled incorrectly. In order to avoid this situation keep in mind the following rules:

The TML interrupts must be kept globally enabled to allow execution of the ISR for those TML interrupts triggered by protections. As during a TML interrupt execution, the TML interrupts are globally disabled, you should keep the ISR as short as possible, without waiting loops. If this is not possible, you must globally enable the interrupts with EINT command during your ISR execution.
If you modify the interrupt service routines for Int 0 to Int 4, make sure that you keep the original TML commands from the default ISR. Put in other words, you may add your own commands, but these should not interfere with the original TML commands. Moreover, the original TML commands must be present in all the ISR execution paths.

 

OK: Close this dialogue and save the interrupt settings in your motion sequence list.

Cancel: Close this dialogue without saving anything in your motion sequence list.

Help: Open this help page.

See also:

TML Interrupts – TML Programming Details

TML Interrupt Service Routines

Motion Programming