Danfoss MCO 305 Design Manual page 29

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

Advertisement

MCO 305 Design Guide
old_offset = GET SYNCPOSOFFS
WHILE (IN 1 == 1) DO
IF (IN 4 == 1) THEN
GOSUB increase_offset
ELSEIF (IN 5 == 1) THEN
GOSUB decrease_offset
ENDIF
IF (SYNCSTAT & 4) THEN
OUT 1 1
ELSE
OUT 1 0
ENDIF
ENDWHILE
MOTOR STOP
home_done = 0
OUT 1 0
OUT 2 0
IF (new_offset != old_offset) AND (GET 132 == 0) THEN
SAVE AXPARS
ENDIF
ENDIF
GOTO MAIN
/*************************** Sub programs start *********************************/
SUBMAINPROG
/***************************** Increase offset **********************************/
SUBPROG increase_offset
IF (Next_step) THEN
IF (GET 1901 == 0) THEN
new_offset = old_offset + GET 1900
SET SYNCPOSOFFS new_offset
ELSE
MOVESYNCORIGIN GET 1900
ENDIF
ENDIF
Next_step=0
ON TIME 500 GOSUB Enb_Step
RETURN
/*************************** Decrease offset ***********************************/
SUBPROG decrease_offset
IF (Next_step) THEN
IF (GET 1901 == 0) THEN
new_offset = GET SYNCPOSOFFS - GET 1900
// Read existing offset and subtract step value
SET SYNCPOSOFFS new_offset
ELSE
MOVESYNCORIGIN (- GET 1900)
ENDIF
ENDIF
Next_step=0
ON TIME 500 GOSUB Enb_Step
RETURN
/************************* Enable new offset step *******************************/
SUBPROG Enb_step
__ Functions and Examples __
// Stay in synchronizing mode while input 1 = 1
// Stop if input 1 is low.
// Reset home_done flag after stop
// Reset home done output after stop
// NOTE: Saving more that 10000 times can damage flash PROM
// Check if next offset step is enabled
// Absolute offset
// Read existing offset and add step value
// Set new position offset
// Relative offset
// Execute relative offset with offset step
// Disable next offset step
// Enable next offset step after 500 ms
// Check if next offset step is enabled
// Absolute offset
// Set new position offset
// Relative offset
// Execute relative offset with - offset step
// Disable next offset step
// Enable next offset step after 500 ms
®
MG.33.L5.02 – VLT
is a registered Danfoss trademark
// Save absolute offset if changed
29

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents