RSLogix5000/FTView ->input for REAL_TAG (TYPE REAL)

Suseh

Member
Join Date
Apr 2015
Location
Rome
Posts
62
On my application i want to have parameter which gets "big value".
I decided to make use text -> insert variable -> numeric.
This goes to Tag_Real (Tag_Real is the name of tag, which type is REAL, of course).
I configure this for 10 digits and 2 decimal places. So the template will look:
########.##

When i test this i can't put "big" value, for instance:
99999999.99

From RSLOGIX manual - real:
An atomic data type that stores a 32-bit IEEE floating point value.

How can i make an input parameter with decimalas & big values?
 
Suseh:
How about filling with zeroes, spaces or none. Default is none so if your real value is less that 99999999.99 for instance 123.1 it will display as 123.10.
if you fill with zeroes it will be display as 00000123.10.
Is that what you mean ??
 
suseh said:
When i test this i can't put "big" value, for instance:
99999999.99

When you say you "can't", what do you mean? Do you mean that the PLC will not accept such a number, or that it shows correctly in RSLogix5000 but does not show correctly on the HMI? What do RSLogix and the HMI show when you try this?

I'm not an expert on this - and there are others around here that know more than I do, and hopefully they'll chime in - but I suspect that you've come across one of the limitations of floating point numbers. Some values cannot be represented exactly by floating point numbers.

If this does turn out to be the case, you would have to go into more detail as to why it is that you require such a large number with decimal places, and perhaps we can suggest a workaround.
 
You are most likely just running up against the limits of real data types. Single precision IEEE 32 Bit real formats only allow for 7.22 actual digits in the significand. You can't squeeze 9,999,999,999 unique values into the 23 (+1) bits of the significand of a floating point no matter what you do. You can't even get that many unique values from a full 32 bit significand.

Your best bet, if you really require that many digits, it to deal with either partial numbers, like using BCD, or 1 DINT to represent the whole number portion of the value, and another DINT to represent the fractional portion.
 
Thanks for all of answers and apologise for problem description. It is no very clear.

widelto, AJZ it is not about displaying.
ASF i mean that PLC (RSLOGIX5000) does not take what i type in HMI.
Like i wrote. When i put 999999.99 in HMI, i get something else in PLC.
And similar test -> when i try to put directly from RSLOGIX (from Tags Monitor), the tag does not want to "take it".
So,
rdast probably you are right. If my real have 7.22 actual digits, so
my maximum of numeric input is XXXXX.XX, so 99999.99 (i tested it).

I use VBA keypad for numeric input and don't have idea to achive:
Your best bet, if you really require that many digits, it to deal with either partial numbers, like using BCD, or 1 DINT to represent the whole number portion of the value, and another DINT to represent the fractional portion.

any hints?
 
I would separate your whole number and decimal portion into two DINT's. A DINT can represent any whole number from -2,147,483,648 to -2,147,483,647. So the first DINT would hold "999999" and the second DINT would hold "99". Then in your text display, you show [DINT1_Value].[DINT2_Value].

But before you get to that point, you're going to have to back up a little work out how you arrive at this number, because if you're trying to calculate it you'll run into the same floating point number handling issues in the calculation logic. A little background on where this number comes from, what you want to do with it, and how it changes would help you get some more specific answers.
 

Similar Topics

Hi all, We are having a situation where airlocks are getting jammed, so we are reversing direction to the motors on them. They are having...
Replies
11
Views
4,048
Hello I want to communicate Facrory Talk View studio ME with RS Logix Emulator 5000 on PC. Please anybody can help me for communicaton...
Replies
2
Views
4,395
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
402
Hello everyone, I have an RSLogix5000 project which is running live in the factory but I need to make some changes to the logic. I want to test...
Replies
0
Views
1,113
Good Morning Everyone, I'm looking to use the GSV instruction to get I/O fault codes for my project so I know if there's a comms issue in my E/IP...
Replies
5
Views
852
Back
Top Bottom