Knowledge Base
cancel
Showing results for 
Search instead for 
Did you mean: 

Script program does not execute correctly.

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.

Environment

SBO 1.4

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

Tags (1)
Labels (1)
Version history
Revision #:
1 of 1
Last update:
‎2018-09-06 09:44 AM
Updated by: