
Chapt er 5 Ex am ples of Pr o gramming
5-11
4. Program description
If X1 is ON, X2 is OFF, and X3 is OFF, the execution of the program will jump from [CJ P1]
to P1. After the execution of the program jumps from [CJ P1] to P1, the constant K10000 will
be stored in D0, that is, the first stroke distance will be selected, and the execution of the
program will jump to P4 to get ready to output pulses.
If X2 is ON, X1 is OFF, and X3 is OFF, the execution of the program will jump from [CJ P2]
to P2. After the execution of the program jumps from [CJ P2] to P2, the constant K20000 will
be stored in D0, that is, the second stroke distance will be selected, and the execution of the
program will jump to P4 to get ready to output pulses.
If X3 is ON, X1 is OFF, and X2 is OFF, the execution of the program will jump from [CJ P3]
to P3. After the execution of the program jumps from [CJ P3] to P3, the constant K30000 will
be stored in D0, that is, the third stroke distance will be selected, and the execution of the
program will jump to P4 to get ready to output pulses.
If X1 is OFF, X2 is OFF, and X3 is OFF, the instruction [CJ p4] will be executed, and the
execution of the program will jump to P4 directly to get ready to output pulses.
If X4 is ON, the instruction [DDRVI D0 K10000 Y10 Y0] will be executed, that is, Y10 will
output a certain number of pulses on a frequency of 100 KHz (the value in D0 is the number
of pulses output), and Y0 will control the pulse direction. Since the distance the servo motor
Comentarios a estos manuales