Reference – Lenze PM94P01C User Manual

Page 87

Advertising
background image

PM94P01C

85

Reference

Table 26: DEFINE

DEFINE

Define name

Pseudo-statement

Purpose

DEFINE is used to define symbolic names for User Variables, constants, and Digital I/O for
programming convenience. Define statements greatly enhance program understanding by allowing
the user to program using symbolic strings (names)relevant to their application. DEFINE can be used
also to substitute a symbolic string.

Syntax

DEFINE <name> <string>
name any symbolic string
string User Variable, constant, or Digital I/O Flag that symbolic string will represent

Remarks:

DEFINE statements can be located anywhere within the user program (with the exception of events
and the fault handler). Normally practice however is to place definitions at the start of the program
prior to any executable code.

See Also

Example:

Define Start_Button IN_B1

; Define a Digital Input

Define System_Stop Out2

; Define a Digital Output

Define Loop_Counter V5

; Define a User Variable

Define Loop_Increment 1

; Define a Constant Value

Program_Start:

; Label Program Start

If Start_Button == 0

; If input B1 is off

Disable

; Disable Servo

System_Stop = 1

; Turn on Output 2

Else

; Otherwise

System_Stop = 0

; Turn off Output 2

Enable

; Enable Servo

MoveD 10

; Move (increment) Distance

10

Loop_Counter = Loop_Counter + Loop_Increment ; Increment Variable V5 by 1

Endif
Goto Program_Start

; Goto Label Program_Start

Table 27: DISABLE

DISABLE

Disables the drive

Statement

Purpose

DISABLE turns OFF the power to the motor. Drive shows ‘Dis’ on display when in a disabled state.

Syntax

DISABLE

Remarks

Once the DISABLE statement is executed, the power to the motor is turned off and the motor can
move freely. When disabled the drive will continue to monitor feedback and the actual position
variable (APOS) will continue to update with the current position of the motor. The target position
variable (TPOS) will be updated with the value of the actual position variable (APOS) on Enable to
prevent unexpected motion from the motor shaft.

See Also

ENABLE

Example:

If Start_Button == 0

; If input B1 is off

Disable

; Disable Servo

Else

; Otherwise

Enable

; Enable Servo

MoveD 10

; Move (increment) Distance 10

Endif

Advertising