Click PLC compare with math.

APFreak

Member
Join Date
Dec 2021
Location
Costa Mesa
Posts
4
Please be patient I just started learning this.

In a compare, I have data A: as DF2.
data B: I want (DF10 /6.25)+6

It says I entered an Address that cannot be used.

Thanks for any help......
 
Thanks Steve for a quick reply.
I did not try placing the result of the calculation in a separate DF address and used that in
the compare function?
When I did try it , I could not figure it out.
I did stumble on the ability to scale your inputs which worked great for this. No math needed.
 
I do not know Click but I agree with the following:

[DIV DF10, 6.25, DFxx] so divide DF10 by 6.25 & store in DFxx
[ ADD DFxx, 6, DFxx] Add the 6 & store in DFxx
[CMP DF2, DFxx] Do the compare
Although here I used the same temporary Variable you could use 2 so you can see both the divide result & the add for monitoring purposes.
You did not state what the compare was or what it is for.
Is it =, >, <, >=, <= one thing to bear in mind (many make this mistake) if you use equals then due to errors in floating point maths a result may give you this:
DF2 = 20.3 DFxx = 20.30031 so an equals will not work as due to floating point math errors DFxx could jump from 20.299 to 20.30031 so never sees the required 20.3
There are two possible solutions rather than use = use >= or <=
[>= DF2, DFxx]
[<= DF2, DFxx]
if for some reason it is not practical to a grater than or less than i.e. needs to be exact then you may need to do a limit compare with enough tolerance i.e. + or - 0.001.
 
I use a dif. plc.
But, make sure every data point there is a real. Even the constant 6 to 6.0
 
Yes slight mistake there, the constant 6 should be 6.0, if using floats then trying to use an integer in the maths probably will not compile, or at the very least give the wrong result.
 

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,089
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
223
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,059
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
673
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
511
Back
Top Bottom