Lenze PMSS1000 Simple Servo User Manual

Page 16

Advertising
background image

Indexer-Programmer-Manual.pdf REV 1.3


Read Digital Inputs
We will now modify our test program to look for the input to go on before doing the first move, and wait for
the input to go off before doing second move. Modified program look like this:


;This program looks for the input goes on before making first move
;and looks for the input goes off before making second move

DEFINE

INPUT_ON 1

DEFINE INPUT_OFF

0

UNITS=1
ENABLE
WAIT UNTIL IN_A1==INPUT_ON

;waits until IN_A1 is ON

;WAIT UNTIL IN_A1 ;you can use this is shorter form ;too
MOVED

10

WAIT UNTIL IN_A1==INPUT_OFF ;waits until IN_A1 is OFF
;WAIT UNTIL !IN_A1

;you can use this is shorter form ;too

MOVED -10
END

NOTE: Newly added statements are in blue.

Using inputs to generate predefined indexes
Sometimes it is convenient to use inputs to perform predefined moves (indexes).
To simplify task of inputs processing for such purposes SSi provides special system variable INDEX and
keyword ASSIGN. Keyword ASSIGN causes specific input act as particular bit of system variable INDEX .
After such assignments changes of input state will cause changes of the particular bit variable INDEX
input is assign to. Variable INDEX could be used then conveniently to select predefined move.

…{statements} …

ASSIGN 0 AS BIT 7

;input A1

ASSIGN 1 AS BIT 5 ;input A2
ASSIGN 5 AS BIT 4 ;input A4

…{statements} …

Variable INDEX structure after execution of the ASSIGN statements will look like this:


Note that every input can be assigned as any bit position within INDEX variable' lower 8 bits. Bits 8-31 are
not used and always set to 0. Not assign bits in INDEX variable are set to 0s.

A1

0

A2 A4

0 0 0 0

BITS 8-31 (not used)

16

Advertising