Danfoss MCO 305 Design Manual page 162

Programmable motion controller
Hide thumbs Also See for MCO 305:
Table of Contents

Advertisement

MCO 305 Design Guide
this is broken down into a series of APOSS 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 pro-
gram 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 within Interrupt Procedures
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 cal-
culation. 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.
Response Times
The existence of an interrupt is checked in a special function which is also used as a watch dog control. For
this reason this is generally called up in any procedure which could last somewhat longer and in all loops, etc.
This procedure checks every 1 ms whether such an event exists and, if necessary, sets a corresponding flag.
At the latest this flag is detected and evaluated after the current APOSS machine code has been processed.
The response time is the maximum run time of the machine code or 1 ms, whichever is greater.
One exception is the time interrupt (ON TIME / ON PERIOD). This checks whether the time has elapsed
every 20 ms. Thus, it is not logical to define an ON PERIOD with less than 20 ms.
NB!:
Furthermore, in general, it is important to make sure that interrupt functions do not last too long.
Particularly for ON PERIOD functions it is important to ensure that the function does not last longer
than the period since otherwise a "jam" of function procedure calls will be created.
Priorities of Interrupts
If two interrupt events should occur simultaneously then the processing is prioritized as follows:
ON INT comes before
ON posint (ON APOS, ON MAPOS, ON MCPOS, ON IPOS, ON MIPOS) before
ON COMBIT before
ON STATBIT before
ON PARAM before
ON CANMSG before
ON KEYPRESSED before
ON TIME / ON PERIOD
Within the individual types of interrupts the following is true:
162
__ How to Program __
®
MG.33.L5.02 – VLT
is a registered Danfoss trademark

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents