
MCO 305 Design Guide
__ How to Program __
80
MG.33.L4.02 – VLT
®
is a registered Danfoss trademark
Next step is initializing: setting parameters, flags,
and variables. For example:
SET POSERR 100000000
// Parameters
SET 1990 10000
SETVLT 205 50
offset = 0
// Flags/variables
sync_flag = 0
VEL 100
// System parameters
ACC 100
DEC 100
Followed by the main program loop:
main:
…
GOTO main
main:
IF (IN 3 == 1) THEN
/* Go into synchronizing mode, if input 3 = 1 */
GOSUB syncprog
ELSE
/* If input 3 not = 1, run in speed mode */
GOSUB speedprog
GOTO main
Sub program areas are defined as follows:
SUBMAINPROG
SUBPROG
name
…
RETURN
ENDPROG
SUBMAINPROG
SUBPROG
syncprog
IF (sync_flag == 0) THEN
/* synchronize, if not already synchronized */
SYNCP
sync_flag
=
1
ENDIF
RETURN
SUBPROG
errhandle
WAITI 18 on
/* waiting for digital input 18, clear the error */
sync_flag
=
0
ERRCLR
RETURN
ENDPROG
Sequential Command Processing
In general a command is processed to the end before a new command is begun. This means that for
position commands the program waits until the target position has been reached.
Exception: If NOWAIT has been set to ON.
Command Run Times
Timing of the GETVLT and SETVLT commands is dependent on the reading and writing capability of the
FC 300. The GETVLT commands are typically 20 ms or faster. The SETVLT command can be rather slow and
timing depends on what is going on in the FC 300.
It is not possible to give a maximum time for a read or write command concerning FC 300 parameters. (It
may take up to 100, or 500 ms, or even more.)
If the command execution times are critical in an application it is possible to measure the run times of a
command sequence under the different operating conditions using the command TIME.
Summary of Contents for MCO 305
Page 4: ......