Flag on / flag off (flag no.) 210 [n, Get data [r] 231 [r – Industrial Data Systems IDS Scale Basic User Manual
Page 24
Scale Basic 4.2E
Reference
Remarks: Use this instruction to alert the operator that an error condition has occurred. The
message is displayed until the operator presses any key.
Example: register Fixed43 is set to the maximum weight allowed in a weigh hopper.
Compare,
Gross,
Fixed43
If, Positive
If Gross weight > Maximum
All off
turn off all setpoint monitors, relays, and timers
Error msg, 9
display “Err 9”
End
Exit
function
End if
End if over-weight error
Flag on / Flag off (flag no.)
210 [n]
Purpose: to turn on/off a general-purpose flag. NOTE: Flag off, 0 = turn off all flags.
Remarks: there are 9 general-purpose flags that can be set on/off using Flag on / Flag off
instructions. The status of the flags can be tested using the Flag[x] condition code. Flags are
useful for communicating between functions.
Example: Use the F1 key to start a timer, use the F2 key to stop the timer and display the
elapsed time in seconds.
The F1 key activates user function1.
Flag on, 1
Turn on general purpose flag 1
Set pt on, 1
Turn on setpoint monitor 1
Set, Memory1, 0
Memory1 = 0
End
End
of
function
The F2 key activates user function 2.
Flag off, 1
Turn off general-purpose flag 1.
Set Memory2, 60
memory2 = 60
Div Memory3,Memory1,Memory2 memory3 = time / 60
Display,
Memory3
Display
Memory3
End
End
of
function
Setpoint monitor 1 trips every scan cycle (60 times a second) and activates function3.
Inc, Memory1
Memory1 = Memory1 + 1
If, Flag1
If general flag 1 is on
Set pt on, 1
re-activate setpoint monitor 1
End
if
End
if
End
End
of
function
Get
data
[r]
231
[r]
Purpose: get data from the keyboard and put it into a register.
Remarks: if the instruction immediately preceding the Get data instruction was the Prompt
instruction, the prompt is used for prompting, otherwise “ENTER” is used for prompting.