When my communicator lose connection with a PLC, all my inputs become “—“, but I have problems with my boolean variables that I use the formula GetBit(), because at this moment, all of them become 0.
How can I modificate the GetBit() formula, case I lose my connection, the boolean variables keep the old values?
double GetBit(double val, int n)
If (val == null)// or (val==”—“) <<<<< I dont know how can I do this
UInt64 uintVal = (UInt64)val;
return (uintVal >> n) & 1;
or something like:
double GetBit(double val, int n, int ChannelNumber)
This topic was modified 1 year, 7 months ago by Joao.
It works, but the boolean value become “—” too.
The Automatic Control Module read it as 0? I will have problems if I have a trigger with the condition val=0?
Or I have to change the status condition too?
This reply was modified 1 year, 7 months ago by Joao.