
MCO 305 Design Guide
__ How to Program __
82
MG.33.L4.02 – VLT
®
is a registered Danfoss trademark
Debugging
Development
o
Messages -> Log file
can be used to start the logging of messages to a file. Note that “Stop
logging” will be enabled if logging has been started.
Click on
Development
o
Syntax Check
. The program will be aborted as soon as a faulty command is found.
The line number and an error description are outputted to the communications window. The cursor is auto-
matically placed at the exact position of the syntax error and the program stops at this point.
The
Syntax Check
produces a debug file in addition to checking the syntax. This file will be called “temp.ad$”.
Click on
Development
o
Prepare Singlestep
and the program opened is prepared for the debug mode: It is
compiled and a debug file is produced, the program is loaded into the FC 300 and all executable program
lines are marked by blue dots. Now, also the respective menu items are activated. Please see the section
Debugging on page 58 for more details.
Interrupts
In general there are four types of interrupts:
ON INT
Interrupt at the edges of an input
ON PERIOD / ON TIME
Interrupt after a certain period of time
ON COMBIT / ON STATBIT
Interrupt when Bit n is set
ON PARAM
Interrupt when a parameter n is changed
General Processing of Interrupt Procedures
After every internal APOSS command a query is made whether an interrupt event has occurred. It is impor-
tant to remember that with every internal APOSS command the compiler creates a command in APOSS
machine code.
Thus, for example, a simple command such as:
POSA ( 1000)
is broken down into the following APOSS 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 interrupts since the waiting process starts again after the
interruption.
Use of Variables within Interrupt Procedures
The example above with the “APOSS machine code” clearly shows that it is necessary to use the utmost
testcare when assigning variables within interrupt procedures.
If, for example, in the main program the following assignment is made:
target = value - 1000
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”.
Содержание MCO 305
Страница 4: ......