Parker Hannifin VIX500IM Stepper Machine User Manual


 
4. CONTROL OF VIX DRIVES 73
Conditional Code Example
The following code is a good example of how the conditional IF statement can be used for
fault diagnosis within the FAULT label.
1FAULT: ;define check label
1IF(UF2,=,XXXXXX1X) ;deceleration error
1Decel_Err
1IF(DF1,<>,00000000) ;warning of a drive fault
1Drive_Flt
1IF(ST1,=,XXXXX1XX) ;waiting for a delay timeout
1Delay_tout
1IF(ST2,=,1XXXXXXX) ;motor is energised
1Motor_On
1T1 ;wait 1 second
1END ;end of definition
Command Queuing
Command queuing in mode incremental is normally enabled, this means commands are
buffered, each command waiting for the previous command to complete before the next one
is issued. In certain circumstances this sequential operation needs to be disabled, for
example if you need to generate a trigger pulse part way through a move. Normally, the
move would complete before the trigger command is executed, but by disabling command
queuing the trigger command becomes immediate and will operate when the required trigger
conditions are met.
For example, the following code would allow output 1 to signal PA is greater than 10000
before finishing the move.
1MAIN: ;define label
1W(CQ,0) ;enable continuous execution of commands
1G ;go
1TR(PA,>,10000) ;trigger when position absolute becomes greater than 10000
1O(1) ;output 1
1W(CQ,1) ;enable command queuing again
1END