Rockwell Automation 1398-PDM-xxx IQ Master Version 3.2.4 for IA-2000 and IQ-5000 Positioning Drive Modules, IQ-55 User Manual

Page 142

Advertising
background image

120

• Inputs and Outputs

Publication 1398-PM601A-EN-P — October 2000

TUTORIAL

Scanned Event to Implement a Programmable Limit Switch

Next we will use Scanned Events to implement a programmable limit switch. A programmable limit
switch is a mechanism that can be programmed to turn on at a specific position. A Scanned Event is a
small program that runs independently of the main program. We will set up a Scanned Event to check if
the current position (system variable POSN) is greater than or equal to a given value (3) and less than or
equal to another given value (6). If it is, O1 is turned ON. Two other Scanned Events check to see if
POSN is less than the minimum value or greater than the maximum value. If it is, O1 is turned OFF.
Open a new file and enter the text below. Compile and save the program to the ULTRA Plus or IQ.

TITLE "scanpgm";any text following a semicolon is ignored

;this is useful for putting in comments

S1: IF POSN >= 3 IF POSN <= 6 O1 = ON;Scanned Events

S2: IF POSN < 3 O1 = OFF

S3: IF POSN > 6 O1 = OFF

S1 CONT;turn on Scanned Event 1 to run continuously

S2 CONT;turn on Scanned Event 2 to run continuously

S3 CONT;turn on Scanned Event 3 to run continuously

VEL = 150;set the default velocity, for this program, to 150

MAIN: MOVP = 10;move to position 10 (revs)

MOVP = 0;move to position 0

JUMP MAIN

END

To monitor the actual position from IQ Master, select the Variable Monitor Set Up menu item from the
Monitor menu. This will display the following dialog box:

Select Posn from the Monitor Selection list and select the Add button. Select the OK button. Now select
the Monitor Variables menu item. This will display a box that continuously updates POSN. Display the
I/O Status Monitor and the Run Control dialog boxes as before and arrange the windows so that your

Advertising