
MCO 305 Design Guide
__ Functions and Examples __
28
MG.33.L4.02 – VLT
®
is a registered Danfoss trademark
Command
Description
Syntax
Parameter
DEF
SYNCORIGIN
Defines master-slave relation for the
next SYNCP or SYNCM command
DEFSYNCORIGIN
master slave
master = reference position in qc
slave = reference position
MOVESYNCORIGIN
Relative shifting of the origin of
synchronization
MOVESYNCORIGIN
mvalue
mvalue = Relative offset
PULSACC
Sets acceleration for master
simulation
PULSACC a
a = acceleration in Hz/s
PULSVEL
Sets velocity for master simulation
PULSVEL v
v = velocity in pulses per second
(Hz)
SYNCP
Synchronization of angle/position
SYNCP
–
SYNCSTAT
Queries flag for synchronization
status
res = SYNCSTAT
–
SYNCERR
Queries actual synchronization error
of the slave
res = SYNCERR
–
Position Synchronizing Sample Program
/************************* Position Synchronizing Sample Program ***********************/
// Inputs:
1
Start/stop synchronization
//
2
Start homing
//
3
Home switch
//
4
Increase offset
//
5
Decrease offset
//
8
Clear Error
// Outputs: 1
Within synchronizing accuracy, set accuracy window in par. 33-13
//
2
Homing done
//
8
Error
/****************************** Interrupts **************************************/
ON ERROR GOSUB errhandle
// In case of error go to error handler routine, this must always be included
/************************** Basic settings ************************************/
VEL 100
// Sets maximum slave velocity related to par. 32-80 Maximum velocity
ACC 100
// Sets slave acceleration related to par. 32-81 Shortest ramp
DEC 100
// Sets slave deceleration related to par. 32-81 Shortest ramp
/*********************** Define application parameters *****************************/
LINKGPAR 1900 "Offset step" 0 10000 0
LINKGPAR 1901 "Offset type" 0 1 0
/********************** Set parameters and flags ********************************/
SET I_FUNCTION_3 1
// Define input 3 as Home switch input
next_step = 0
home_done = 0
new_offset = 0
/************************************* main loop ******************************/
MAIN:
IF (IN 2 == 1) THEN
// Start homing if input 2 high
HOME
// Go to Home and set position to 0
home_done
=
1
// Set home_done flag
OUT 2 1
// Set home done output
ENDIF
IF (IN 1 == 1) AND (home_done == 1) THEN
// Start synchronizing when input 1 = 1 and homing done.
Содержание MCO 305
Страница 4: ......