OptoScript random display and history data error

I am using PAC Control Basic 10.4 on a PAC R1 controller. Customer doesn’t like when he disconnects a thermocouple and the display and data state -32,768. So, I wrote code to have the input equal to a float variable then make it equal to zero when the input is open. Randomly on the display and in the history data file he sees the -32,768. I have only one chart running and put in a 1 second delay at the beginning. The PAC R1 and computer are connect with crossover cable, no network involved. Thanks, Larry

With the SNAP-PAC controllers / brains, you can use PACManager to change your “out of range” value from -32,768 to zero (or whatever number you want) - no code required.

With PACManager, select Status Write and adjust the “out of range” fields (16 and 32 bit) accordingly.

Regarding your code - I suspect you are reading the IO into a Float then checking (the Float) if its low.
If sequenced correctly, the negative -32,768 would not leak through.
Sequence should be: check IO value, if large negative then make float = 0, if not then make float = IO value.


Okay great I will try that, sounds like a better way to satisfy my customer. :slight_smile: