Hello all,
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?
something like:
double GetBit(double val, int n)
{
If (val == null)// or (val==”—“) <<<<< I dont know how can I do this
{
return (Cnl);
}
else{
UInt64 uintVal = (UInt64)val;
return (uintVal >> n) & 1;
}
}
or something like:
double GetBit(double val, int n, int ChannelNumber)
{
If (getCnlData(ChannelNumber)==null)
{
return (Cnl);
.
.
.
Thanks!!
-
This topic was modified 6 years, 11 months ago by Joao.