Reference – Lenze PM94P01C User Manual

Page 86

Advertising
background image

PM94P01C

84

Reference

Table 25: ASSIGN

ASSIGN

Assign Input As Index Bit

Statement

Purpose

Assign keyword causes a specified input to be assigned to a particular bit of system variable INDEX.
Up to 8 digital inputs can be assigned to the first eight bits (bits 0 - 7) of the INDEX system variable in
any order or combination. The purpose of the Assign Keyword and INDEX system Variable is to allow
the creation of a custom input word for inclusion in the user program. Good examples of it’s use are
for implementing easy selection of preset torque, velocity or position values within the user program.

Syntax

ASSIGN INPUT <input name> AS BIT <bit #>
Input name (IN_A1..IN_A2 etc.)
Bit# INDEX variable bit number from 0 to 7

Remarks

Assign statements typically appear at the start of the program (Initialize and set Variables section) but
can be included in other code sections with the exception of Events and the Fault Handler.

See Also

VAR_IOINDEX Variable (#220)

Example:

ASSIGN INPUT IN_B1 AS BIT 0

;index bit 0 state matches state of input B1

ASSIGN INPUT IN_B2 AS BIT 1

;index bit 1 state matches state of input B2

Program Start:
; <statements>
If Index == 0

; If neither IN_B1 or IN_B2 is on

MoveP 0

; Move to Absolute Position 0

Endif

If Index == 1

; If IN_B1 is on and IN_B2 is off

MoveP 10

; Move to Absolute Position 10

Endif

; If Index == 2

.....

Advertising