syntax – IVi,(variable),min,max

IV

Input Variable

 

Value:

N/A

 

Units:

N/A

Range: i=1–40 display position characters variable= any legal variable name

min=the minimum range value (optional); max=the maximum range value (optional)

Allows operator input of variable information under program control. It is usually used with the message command (MS) to prompt for operator input of the variable specified in the IV statement. The cursor is placed at character position “i”. The program waits until a number is entered before continuing execution. You are not allowed to type past the end of either display line. Variables store 4 digits to the right of the decimal place.

When minimum and/or maximum range values are specified, the IV command will not accept inputs outside this range (one of the following messages is displayed on the keypad):

SInput below minimum, Press ESC to resume

SInput above maximum, Press ESC to resume

Variables can be used in a math equation, conditional expression or to set any command parameters (Example: DA, DC, VE, AC, LP, IF, TD, etc.). A variable can be used anywhere in a program a real number or integer is used. Use care when performing math on variables used in LP statements. LP will truncate the non–integer portion of the variable. For example: (COUNT)=25*.2 LP(COUNT) will only loop 4 times because (COUNT)=4.9999. A small offset can be added to variables used in LP statements to avoid this problem. (COUNT)=(COUNT)+.1 will guarantee that (COUNT) will be greater than 5, so the program will loop 5 times.

Examples:

 

MS1,“”

Clears the Display

MS1,“How many?: ”

Writes string beginning at character 1, top line

IV12,(PIECES),1,15

Waits at 12th character for the # of pieces in the range 1–15.

MS1,“”

Clears the Display

MS1,“How long?: ”

Writes string beginning at character 1, top line

IV12,(LENGTH)

Waits at 12th character for the # of pieces.

LP(PIECES)

Loops the number of pieces entered

DI(LENGTH)

Defines the desired move length/distance.

GO

Moves the length commanded

EB

Ends the loop.

6-14 Keypad Programming

MN1853

Page 73
Image 73
Baldor MIN1853 manual IV12,LENGTH, Lppieces, Dilength