Interrupt - Danfoss VLT 5000 Series Manual

Synchronizing and positioning option onizing and positioning option
Hide thumbs Also See for VLT 5000 Series:
Table of Contents

Advertisement

Input values
As in other programming languages the values
inputted are not tested. Thus, it is the
programmer's responsibility to ensure that extreme
values do not lead to problems. When searching
for such potential problems use the #DEBUG
command.
I I I I I Interrupt
In general there are three types of interrupts:
ON INT
ON PERIOD / ON TIME
ON COMBIT / ON STATBIT Interrupt when Bit n is
ON PARAM
General processing of interrupt procedures
After every internal SyncPos command a query is
made whether an interrupt event has occurred. It is
important to remember that with every internal
SyncPos command the compiler creates a com-
mand in SyncPos machine code.
Thus, for example, a simple command such as:
POSA (target + 1000)
is broken down into the following SyncPos machine
code:
MOVE target to register 101
MOVE immediate 1000 to register 102
ADDREG register 102 plus register 101 to
register 101
POSA axis to register 101
Furthermore, for commands which take longer
(such as DELAY or WAITAX) the program constantly
checks whether an interrupt event has occurred. If
this is the case, the command is interrupted and
continued once the interrupt has been processed.
NB!
Do not use WAITT in connection with inter-
rupts since the waiting process starts again
after the interruption.
62
Interrupt at the edges
of an input
Interrupt after a
certain period of time
set
Interrupt when a para-
meter n is changed
VLT
®
5000 SyncPos option
Use of variables within interrupt procedures
The example above with the "SyncPos machine
code" clearly shows that it is necessary to use the
utmost care when assigning variables within inter-
rupt procedures.
If, for example, in the main program the following
assignment is made:
target = target + value – 1000
this is broken down into a series of SyncPos
machine code commands and the intermediate
results are stored in temporary registers. Only at
the end of the sequence is the result stored in
target.
If during the execution of this command an
interrupt is triggered and in the corresponding
procedure the following command is executed:
target = 0
then, in this instance, problems will arise. This is
because after processing the interrupt procedure
the program jumps back to the main program and
then the intermediate result which still exists is
stored in target: Thus, the 0 in target is overwritten
once again.
ON PERIOD
In contrast, for ON PERIOD functions the time
when the next call instruction should take place is
calculated at the start of such a function, thus
START_TIME = TIME + PERIOD.
As soon as this time has been reached the
function is executed and subsequently the next
start time is calculated with the following formula
START_TIME = START_TIME + PERIOD.
This ensures that the call intervals are really the
same since the execution time does not influence
the calculation. But this means that the user must
make sure that the period of time is actually longer
than the execution time as otherwise a "jam" is
created. That means that actually only the ON
PERIOD function is executed.
MG.10.J4.02 – VLT is a registered Danfoss trade mark

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents