Introduction – Lenze PM94P01C User Manual

Page 14

Advertising
background image

PM94P01C

12

Introduction

The program has now been compiled without errors. Select [Compile & Load W Source] to load the program to the
drive’s memory. Click [OK] to dismiss the dialog box.

To

Run the program, input A3 must be active to remove the hardware inhibit. Select the [Run] icon

on the program toolbar. The drive will start to execute the User Program. The motor will spin 10
revolutions in the CCW direction and then 10 revolutions in the CW direction. After all the code has
been executed, the program will stop and the drive will stay enabled.
To

Restart the program, select the [Reset] icon on the program toolbar. This will disable the drive

and reset the program to execute from the start. The program does not run itself automatically. To
run the program again, select the [

Run] icon on the toolbar.

Program Layout
When developing a program, structure is very important. It is recommended that the program be divided up into the
following 7 segments:

Header:

The header defines the title of the program, who wrote the program and description of what
the program does. It may also include a date and revision number.

I/O List:

The I/O list describes what the inputs and outputs of the drive are used for. For example input A1
might be used as a Start Switch.

Init & Set Var:

Initialize and Set Variables defines the drives settings and system variables. For example
here is where acceleration, deceleration and max speed might be set.

Events:

An Event is a small program that runs independently of the main program. This section is
used to define the Events.

Main Program:

The Main Program is the area where the process of the drive is defined.

Sub-Routines:

This is the area where any and all sub-routines should reside. These routines will be called
out from the Main Program with a GOSUB command.

Fault Handler:

This is the area where the Fault Handler code resides. If the Fault handler is utilized this code
will be executed when the drive generates a fault.

The following is an example of a Pick and Place program divided up into the above segments.

***************************** HEADER **************************************
;Title:

Pick and Place example program

;Author:

Lenze - AC Technology

;Description:

This is a sample program showing a simple sequence that

;

picks up a part, moves to a set position and places the part

;**************************** I/O List ************************************
;

Input A1

-

not used

;

Input A2

-

not used

;

Input A3

-

Enable Input

;

Input A4

-

not used

;

Input B1

-

not used

;

Input B2

-

not used

;

Input B3

-

not used

;

Input B4

-

not used

;

Input C1

-

not used

;

Input C2

-

not used

;

Input C3

-

not used

;

Input C4

-

not used

;

Output 1

-

Pick Arm

;

Output 2

-

Gripper

;

Output 3

-

not used

;

Output 4

-

not used

Advertising