Establishing Running Logic
Once you define inputs, these values can be used in VBScripts to determine information about the model, such as the source location. Depending on the logic you are editing, you must include at least one of the statements listed in the following table.
Model # |
The script determines |
You must include at least one of these statements in the script |
All Models |
Whether or not the line is running |
Running = True Running = False |
Model 211 |
The location |
Location = "location name" |
Model 212 |
The equipment status |
Status = True Status = False |
All Models |
Faults for each location |
Fault = "Fault name" Fault = Fault value |
The running script determines whether or not the production line is running. If the line is not running (Running = False), all subsequent scripts are fired. If the line is running (Running = True), none of the subsequent scripts are fired.
Examples of Running Logic
Running Logic Example #1
In this example of a Running Logic model, F is the alias that corresponds to FIX.LINESPEED.F_CV. This line is said to be running when the LINESPEED tag is greater than 20. The line is not running if the LINESPEED is less than 20.
if F < 20 then
Running = False
else
Running = True
end if
Running Logic Example #2
In this example, the line is running when the aliases for A, B, and C are all equal to zero. It assumes, of course, that A, B, and C each have tags corresponding to them (such as FaultTag, ErrorFlagTag, and AlarmTag). If any of the tags have a non-zero value, then the line is assumed to be down; a downtime event is then triggered.
if A+B+C THEN
Running = False
else
Running = True
end if