RSLogix500 - Floating values and comparison

plaurent

Member
Join Date
Feb 2009
Location
NC
Posts
23
It seems that my LEQ, GRT, and other comparison operators are not working with floating point numbers, and I am not able to find any references that indicate that I cannot use floating points with comparison operators. For example, a GRT instruction with 'A' source of F8:1 (with a value of 1.25) compared against a 'B' source of 0.75, does not create a true statement and energize an output. Anyone with some insight?

Many thanks in advance for your continued help!
 
The program is running on a test PLC, and I'm online. The rung is being scanned, and all statements prior to it are true (and show that way).
 
It seems that my LEQ, GRT, and other comparison operators are not working with floating point numbers, and I am not able to find any references that indicate that I cannot use floating points with comparison operators. For example, a GRT instruction with 'A' source of F8:1 (with a value of 1.25) compared against a 'B' source of 0.75, does not create a true statement and energize an output. Anyone with some insight?

Many thanks in advance for your continued help!

It should work. Comparison operators can be used with floating point operands.

Something else is amiss. I'd check again to make sure that it's being scanned.
 
Yes, it is in a subroutine that is not being scanned, or some other logic is overwriting the output address (duplicate coil?)...

Floating point values are definitely allowed in all comparison instructions.

Paul
 
No need. I understand the error of my ways. I was under the impression (as my experience in other programming languages has taught me) that the same values in later rungs did not evaluate if their expression was false... that appears to be untrue (given the absence of a one-shot), and the event was being evaluated later in the program even in the presence of a false statement, so the rung values were evaluating true and then immediately false.

So much to learn...
 
If I read this correctly it sounds like you are using the same OTE in two places since you mentioned that it evaluates true and then latter in the scan it evaluates false.
Is this correct or am I misunderstanding you?
 
An OTE evaluates as
IF RUNG IS TRUE THEN SET OUT TO TRUE ELSE SET OUT TO FALSE

AN OTL evauates as
IF RUNG IS TRUE THEN SET OUT TO TRUE

An OTU evaluates as
IF RUNG IS TRUE THEN SET OUT TO FALSE

So the instruction OTL and OTU will leave the address value as is if the rung is false, but OTE will always write some value to the address.
 
Bob O - You are correct.
Alaric - That's very helpful, thank you.

You've all been instrumental in assisting me with the resolution... the problem was that the same OTE was evaluating later as false after first being evaluated as true.

Thanks for your help!
 

Similar Topics

So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC. I have two identical machines however one...
Replies
6
Views
513
Hello, I'm new to programming. I'm using RSLogix500 to modify an existing program for a SLC500. My plan was to use one of the existing inputs...
Replies
26
Views
1,906
So i have an allen bradley rack (2080-LC50-24QWB), i have it connected through ethernet. I dont have an offline program so im trying to upload...
Replies
6
Views
621
Hi Everyone, I am supporting a system which runs on a SLC 500 (1747-L532). A fault has developed whereby the output state of some digital outputs...
Replies
10
Views
957
Hello, I am currently taking a course on plc programming and in the course rslogix 500 is being used. I am however having a problem since it keeps...
Replies
4
Views
1,637
Back
Top Bottom