Introduction
This document describes the difference and preferred usage of IF vs IFEXPRESS as a condition on INFORM instructions.
Background
Many Inform Instructions allow for an IF or IFEXPRESS as a condition to be set in the Detailed Edit. This condition determines if the INFORM Instruction executes.
More information can be found related to the IF & IFEXPRESS Condition settings in the YRC1000 Instructions for INFORM Language manual #178649-1CD sections 1.5 & 2.6. YRC1000micro Instructions for Inform Language manual #181276-1CD sections 1.5 & 2.6.
-
IF
a. The IF Condition is configured to compare 2 items and should be used when only 2 items need to be compared. As shown below, the comparison target is limited to IN#(General Purpose Input), OT#(General Purpose Output), FL (Flag Variable number), TF (Timer Flag Variable number), IG# (Input group number), OG# (Output group number), IGU# (User group Input number), OGU# (User group output number), B Variable number/ LB Variable number/ B [Array number]/ LB [Array number], I Variable number/ LI Variable number/ I [Array number]/ LI [Array number], D Variable number/ LD Variable number/ D [Array number]/ LD [Array number], TM Timer Variable number, R Variable number/ LR Variable number/ R [Array number]/ LR [Array number], S Variable number/ LS Variable number/ S [Array number]/ LS [Array number.
b. Condition 1 is how the values Target & Condition 2 are compared:
= It is equal.
<> It is not equal.
> It is greater than.
>= It is greater than or equal.
< It is less than.
<= It is less than or equal.
Not all options will be available for all Targets.
c. The Condition 2 value will be either ON, OFF, Constant number value, B Variable number/ LB Variable number/ B [Array number]/ LB [Array number], I Variable number/ LI Variable number/ I [Array number]/ LI [Array number], D Variable number/ LD Variable number/ D [Array number]/ LD [Array number], TM Timer Variable number, R Variable number/ LR Variable number/ R [Array number]/ LR [Array number], S Variable number/ LS Variable number/ S [Array number]/ LS [Array number
Options of Condition 2 will be dependent on the Target setting.
Job Examples:
(1) SET B000 1
JUMP B000 IF IN#(14)=ON
Jumps to Job 1 if input signal No.14 is turned ON.
(2) JUMP *2 IF D005<=D006
Jumps to *2 if D005 is below D006.
2. IFEXPRESS
a. IFEXPRESS works in the same way as IF with one exception: IFEXPRESS allows for up to 15 conditions within the same line. Either AND/OR and a combination of the 2 can be used in the same line.
AND - Take a logical product of two or more conditional statements.
OR - Take a logical sum of two or more conditional statements.
Job Examples:
(1) JUMP *1 IF(IN#(1)=ON AND IN#(2)=ON)
When both the General-Purpose input number 1 and 2 are ON, a jump to the label “*1” is performed.
(2) CALL B000 IF( B000=0 OR B000=1 )
When the content of B000 is 0 or 1, the job “0” or “1” is called.
As of version 4.3.1 of the SmartPendant software, IFEXPRESS Condition is not available and must be programmed & edited with Classic Interface. The function is usable, it just cannot be programmed or edited with SmartPen
Comments
0 comments
Please sign in to leave a comment.