Issue
The script program always executes the first condition, whatever the condition is. The code is shown below:
Numeric Input AirFlowMin,AirFlowMax,AirFlowRead
Numeric OutPut FlowFactor
Line Judging
if AirFlowMin<AirFlowRead<(AirFlowMax-AirFlowMin)/3 then goto 1
if (AirFlowMax-AirFlowMin)/3<AirFlowRead<(AirFlowMax-AirFlowMin)*2/3 then goto 2
if (AirFlowMax-AirFlowMin)*2/3<AirFlowRead
line 1
FlowFactor=1
goto judging
line 2
FlowFactor=2
goto judging
line 3
FlowFactor=3
goto judging
After the above program saves successfully, whatever the value of AirFlowRead is, the program only goes to line 1 and sets the value of FlowFactor to 1, and never goes to the other two lines.
Product Line
EcoStruxure Building Operation
Environment
- B3s
- Script Program
Cause
Some expressions are supported in Continuum Plain English but are not supported in b3 Script programs
Resolution
Change the expression as shown below:
Line Judging
if AirFlowMin<AirFlowRead and AirFlowRead<(AirFlowMax-AirFlowMin)/3 then goto 1
if (AirFlowMax-AirFlowMin)/3<AirFlowRead and AirFlowRead<(AirFlowMax-AirFlowMin)*2/3 then goto 2
if (AirFlowMax-AirFlowMin)*2/3<AirFlowRead and AirFlowRead