ETEL Doc. - Operation & Software Manual # DSC2P 903 / Ver. F / 3/6/05 Chapter C: System functions
Operation & Software Manual
Direct Drives & Systems 193
13.8.6.3 Example 3: ’Simple clock’ type
• The motor is initialized and it is going to complete a series of small movements.
• A clock is switched on. It jumps to label 50 every 10 seconds.
• At label 50, DOUT 7 is set to 1.
• After some time, digital output is switched off
Sequence:
:79.1 ;Label 79: The following sequence starts automatically
PWR.1=1 ;Motor phasing
IND.1 ;Looking for the index
R0:8.1=40 ;Type of RTI: ''Simple clock'' (§13.8.2.1
and §13.8.5).
R0:9.1=50 ;Jumps to label 50 (§13.8.2.2
).
R0:10.1=1 ;Does not wait for the end of the commands 'wait' (§13.8.2.3
).
´Simple clock array´
R0:1.1=0x0001000B ;X11 variable to increment (hexa), (§13.8.2.5
).
R0:2.1=0x0001000A ;X10 variable as a limit (hexa), (§13.8.2.5
).
R0:3.1=0x020200AB ;Bit 2 from digital outputs (hexa), (§13.8.2.5
).
R0:4.1=1 ;Digital outputs set to 1 (§13.8.2.5
).
X11.1=0 ;Clock initialization
X10.1=10000 ;Clock limit initialization
K191.1=1 ;The first RTI line is valid (§13.8.3.1
)
K192.1=1 ;The first RTI line is enabled (§13.8.3.1
)
K193.1=0 ;Reset the flag of the activated RTI
RIE.1 ;Sets the controller in the RTI enable mode (§13.8.3.2
)
:20.1 ;Label 20: Any sequence of movements
POS.1=0 ;Goes to the position 0
WTM.1 ;Waits until the movement is finished
POS.1=200000 ;Goes to the position 200000
WTM.1 ;Waits until the movement is finished
JMP.1=20 ;Jumps to label 20
:50.1 ;Label 50: Start of ''Simple clock'' RTI processing
X11.1=0 ;Switches the clock on again
DOUT.1=&64 ;Outputs 1 to 7 switched off
WTT.1=500 ;Waits 500ms
K171.1=0 ;Digital Output is switched off
K191.1=1 ;Every preset RTI validated (§13.8.3.1
)
REI.1 ;Back to the sequence and RTI activation (§13.8.3.2
).
END.1