Hi All.
This is a bit related discussion. I’m trying to use a 32 bit integer for my alarm register. I thought it would be better to have one variable instead of 31. Each alarm would toggle it’s respective bit. If the alarm variable was not 0 then I would know an alarm is active.
Here’s what I’ve learned so far:
In PacDisplay if you send a discrete variable, set true, and don’t specify a bit, all 32 bits toggle to 1. This is actually -1 as an integer. So if you are testing for 1 in your strategy the result will be false. If however ,you check if the variable is true, the result will be true as any non-zero value is read as true by the strategy.
In PacDisplay when you send a bit, the variable is Alarm.BIT00
I tried to set a bit in OptoScript like this
Alarm.BIT00 = 1;
The compiler returned:
Compiling…
Error on line 60: Unexpected character "."
Error on line 60: Unable to find variable or command "BIT00"
Error on line 60: syntax error at or near "BIT00"
3 error(s), 0 warning(s)
I tried to use the following
Example from command help>BitChange(SET_FLAG, Bit, Output_Value);
BitChange(Alarm,0,1);
The compiler returned:
Compiling…
Error on line 60: Invalid type for argument #2
1 error(s), 0 warning(s)
I then tried
BitChange(Alarm,00,01);
The compiler returned:
Compiling…
Error on line 60: syntax error at or near "0"
1 error(s), 0 warning(s)
Any suggestions?
Thanks,
Andy