SHIFT

Circular Shift LPT-port outputs. The SHIFT command shifts only LPT outputs mapping like CMD REMAP command, and unlike rol or ror commands.

Syntax

shift [=] [+|–] <number> [count]

Parameters

[=] — Absolute shift.
[+|–] — Shift direction.
number
  • Decimal number from 1 to 1000.
count
  • Decimal number from 2 to 100, tells how many times this command or block will be retried.

Remarks

Default setting is:
shift =0
Examples:
Absolute Circular shift of three positions:
shift =3 ; Forward
shift =+3 ; Forward
shift =-3 ; Backward
Circular shift of three positions relatively current position:
shift +3 ; Forward
shift -3 ; Backward

Easy Example

sleeps 500      ; Set sleeps = 500 ms
 
100000000000
 
CYCLE:          ; Define Label
 
shift +1 12     ; Shift of 1 position for 12 times
 
shift -2 6      ; Shift of -2 position for 6 times
 
goto CYCLE      ; Goto Label CYCLE
shifteasy.mr_g.gif

Fine Example

CYCLE:
 
100000100000
110001110001
111011111011
111111111111
011111011111
001110001110
000100000100
 
sleep 600
 
shift +1    ; Shift of 1 position
 
000100000100
001110001110
011111011111
111111111111
111011111011
110001110001
100000100000
 
sleep 600
 
shift +1    ; Shift of 1 position
 
goto CYCLE
shifta.mr_g.gif

Example '«Unipolar Step-drive Demo №1: System 1'

sleeps 200      ; Set regular pause = 200 ms
 
cmd count 4     ; Only 4 outputs must be used
 
1000            ; Set Base state
 
CYCLE:          ; Define Label
 
shift +1 16     ; Make 16 Steps to right
shift -1 16     ; Make 16 Steps to left
 
delay 1000      ; Wait 1000 ms
 
goto CYCLE      ; Goto Label CYCLE

Example '«Unipolar Step-drive Demo №1: System 3'

sleeps 200      ; Set regular pause = 200 ms
 
cmd count 4     ; Only 4 outputs must be used
 
1100            ; Set Base state
 
CYCLE:          ; Define Label
 
shift +1 16     ; Make 16 Steps to right
shift -1 16     ; Make 16 Steps to left
 
delay 1000      ; Wait 1000 ms
 
goto CYCLE      ; Goto Label CYCLE