If

syntax – IF (Mathematical expression)

IF

IFxx (assumes first input is input 1)

 

Value:

IFi,xx ...

 

N/A

 

Units:

N/A

 

Range:

i=starting input number 1–8

x=0; input high. X=1; input low (grounded). x=anything else; ignore input changes. expression = any valid expression (see math and variables definitions)

Allows the conditional execution of a block of commands based on the evaluation of an expression or input state. If the expression or input state is TRUE, the commands between the IF and the EB are executed. If FALSE, execution continues with the command following the EB. An IF statement should not be confused with a WT statement. An IF statement evaluates, true or false, based on the conditions at the instant the command is processed. A WT statement pauses command processing until the condition is true.

Note: An End of Block (EB) command must be used with every IF command.

IF blocks can be nested up to 16 levels deep. To increase flexibility (primarily with programmable logic controllers) the IF command allows you to use configured inputs with the command. To help prevent this added flexibility from causing programming confusion, you can specify any character as an input (x). This allows you to self document your IF statements. For example, assume you configure input #3 as a “JOG SPEED” input. Programming like “IF01J10” can help remind you that you are already using input #3 as “JOG SPEED”.

Examples:

 

IF14,1 GO EB

If input 14 equals 1 Go

IF12,010 GO EB

If inputs 12–14 equal 010 Go

IF110 GO OT3,1 EB

If inputs 1–3 equal 110 Go and turn on Output #3

IF(TEMP) > 50 OT1 EB

If temperature variable > 50 turn on Output 1

IF(PARTS)=25 GS20 EB

If PARTS variable = 25 Gosub to Program 20

MN1854

Keypad Programming 6-13

Page 68
Image 68
Baldor mn1854 manual Units Range, IFPARTS=25 GS20 EB