Danfoss MCO 305 Design Manual page 161

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

Advertisement

MCO 305 Design Guide
Debugging
Development → 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 → 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 → Prepare Singlestep and the program opened is prepared for the debug mode: It is
compiled and downloaded to the controller but execution of the program is not started. Breakpoints are
added to every executable line and are displayed as blue dots at the beginning of each line in the program.
The "next" line to be executed, is highlighted in yellow. The user can then "single step" through the
program. Please see the section Debugging Programs on page 86 for more details.
Interrupts
In general there are four types of interrupts:
ON INT
ON posint
ON posint SETOUT (TOIN)
ON PERIOD / ON TIME
ON COMBIT / ON STATBIT
ON KEYPRESSED
ON PARAM
ON CANMSG
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 (target + 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 = target + value - 1000
__ How to Program __
Interrupt at the edges of an input
Position interrupt (ON APOS, ...)
Simulates a cam box (all types of posints)
Interrupt after a certain period of time
Interrupt when Bit n is set
Interrupt when a LCP key is pressed or released
Interrupt when a parameter n is changed
Interrupt after receiving a CAN message
®
MG.33.L5.02 – VLT
is a registered Danfoss trademark
161

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents