AD "Click" PLC Quirk - Looking for Explanation

rguimond

Lifetime Supporting Member
Join Date
Jul 2009
Location
Escuminac
Posts
666
I decided to use a "Click" to do some math that the HMI I used couldn't do. Basically, I used the HMI read three analog values from a remote I/O device over Modbus, then sent the values to a Click for some math. I read the calculated values back to the HMI for display. It should have been straight-forward and I didnt expect any issues, even though it was my first experience with a Click.

Anyway, I used ice water and boiling water to determine what the analog values were at 0 and 100C (16,384 and 49,152).This means that there are 36,768 points in 100C or 367.68 points in a Celcius degree.

Let's say I read an analog value of 24,000. Logic dicated that Temperature = (24,000-16,384) / 367.68 = 20.71C. Along the same logic, 40,000 points would equal 64.22C. However, I was getting values not even close to what I expected and even had negative temperatures displayed. the solution was:

(65,535 - analog value - 16,384) / 367.68

This makes no sense to me. Can anyone offer a suggestion?

Note: The analog values I used above may not be actual.
 
You have negative numbers on the temperature scale, but only positive numbers with the raw analog numbers. 0 - 16384 is in the negative range.
 
100 C is 49152-16384=32768, > 1 degree is 327.68
24000 is (24000-16384)/327.68 = 23.2 C
So now you have to watch INT and unsigned INT.
as soon as you go above 32767 (hey is this coincidence or ??)
50 C you will see negative numbers due to this signed integers.
 
100 C is 49152-16384=32768, > 1 degree is 327.68
24000 is (24000-16384)/327.68 = 23.2 C
So now you have to watch INT and unsigned INT.
as soon as you go above 32767 (hey is this coincidence or ??)
50 C you will see negative numbers due to this signed integers.

Thanks, I figured this out later. I used "Signed Integer" as the integer type when I read the value into the HMI and when I sent it to the PLC.

Lesson learned.
 

Similar Topics

Complete noob here, using a Click C0-02DD1-D to run a test stand. Requirement is to turn on motor run for X seconds, turn off and dwell for X...
Replies
6
Views
1,139
merry christmas and happy new year i have a click c0-00dr-d and allen bradley 2711c-t3m. can the panelview talk to the click plc via modbus...
Replies
1
Views
255
Hi guys, i have never had to do a PWM Output or input before i have a Device that to dimm the lamp output from the ballast, the ballast has a 24V...
Replies
6
Views
1,122
I am trying to set a bit to command the Zebra ZT230 to print a label and receive a confirmation bit from the unit via an Automation Direct Click...
Replies
0
Views
689
Hi All, I have a click plc the I need to bit strip and 16Bit int. This is to get the alarms from these bits in the int. Do anyone know how to bit...
Replies
1
Views
524
Back
Top Bottom