VLT
®
5000 SyncPos option
MG.10.J4.02 – VLT is a registered Danfoss trade mark
166
Program samples
■■
■■
■ Marker count
/* Measurement of marker distance in connection with SYNCM */
/* Master and slave must run when this program is executed */
DIM test[4] /* Definition of array with 4 elements */
/* Definition of variables */
dones = 0
donem = 0
/* Save last marker position for slave and master */
test [1] = IPOS
test [2] = MIPOS
/* Start of main program loop */
main:
/* Monitor the next slave marker and save it’s position */
IF (IPOS != test [1] AND dones == 0) THEN
test [3] = IPOS
dones = 1
res = test [3] - test [1] /* Calculate distance between 2 consecutive slave markers */
PRINT “Slave distance “, res /* Print result */
ENDIF
/* Monitor the next master marker and save it’s position */
IF (MIPOS != test [2] AND donem == 0) THEN
test [4] = MIPOS
donem = 1
res = test [4] - test [2] /* Calculate distance between 2 consecutive master markers */
PRINT “Master distance “, res /* Print result */
ENDIF
GOTO main