Function Block Commands: If, Else If, Else, and End If

Basics:
The "If", "Else If", "Else", and "End If" commands allow for scripting logic. 

Details:
The structure for "IF" statements is very similar to other programming languages.  The condition for the If statement is set up using the Expression Builder found by double clicking the Value cell for that step.  Every "IF" block needs an "End If" command to signify the end of the block.  Figure 1 shows a simple "If" statement.

Scheduler/Script in the Function Block Setup Dialog

Figure 1: "Msg A" is only sent if the PRND1 signal is 0.
 


"Else If" is used to add additional conditions if the first is not true.  Figure 2 shows "Else If" commands to look for other conditions. 

Scheduler/Script in the Function Block Setup Dialog

Figure 2: If statement with multiple Else Ifs.

"Else" is used to address no conditions being true. 

  Vehicle Spy Documentation - (C) Copyright 1997-2011 Intrepid Control Systems, Inc.

Last Update: Saturday, October 25, 2008