Can a DINT receive a decimal-ed value?

ericwiz7923

Member
Join Date
Mar 2020
Location
NW Ohio
Posts
1
I was with tasked with making a modification to a current HMI project and found that a Numeric Input on the HMI was writing to a DINT in the PLC. They want to me able to write to the first decimal place. I'd have to convertthis to a REAL tag correct? Im working with a CompactLogix5332E processor and the rsLogix 5000 version is 20.04
 
Some use the Dint as an implied decimal, eg 1234 actually represents 123.4. Most HMIs can handle displaying the Din't with the single decimal, allow entry of the single decimal and write the times ten value to the Dint.
 
Last edited:
Yes, I suspect REAL is the way to go; DINTs do not have digits past the decimal (or hex or binary;)) points.


TL;DR


For an ugly and/or risky alternative, you could keep the DINT and declare that instead of entering gallons on the HMI, the user is entering decigallons (or deci-whatever the unit is in your process), and keep using the DINT. This will work as long as the required entry value will not go beyond 2.14E9 or so. Also, you would have to modify your program to interpret the DINT value as ten times the target value, so you would probably end up using a REAL anyway, but at least you might not have to add logic to parse a decimal point (and the HMI handles that anyway, right?).

I say risky because in this ****amamie system the user must always enter the last digit i.e. the first decimal digit after the implied decimal point, even if that digit is zero, and some folks accustomed to the old system might forget to do so when that digit is zero.

Also, an algorithm similar to this is how the Deep Impact spacecraft extended mission ended.


Are those enough caveats to convince you to use the REAL? Good.
 
Many HMI's allow an inferred Decimal point on integers, I must admit I have not used it on RA HMi's but Beijers do have it so the value is an integer for example 1500 displays on the HMI as 150.0, entering the data is the same i.e. operator enters 150.0 and the controller sees it as 1500. Many earlier small PLC's did not have floating point operations and have used this many times
 
First you need to look in the PLC to find out what the DINT written by the screen is doing, make that part of the logic accept a real value, adding a new tag for the screen is the easy part.
 

Similar Topics

Hi I am being given several fault words (as a DINT) from a Drive that I am receiving into a Compactlogix L33ER controller. I have a small...
Replies
12
Views
1,140
I am working on a project with a Controllogix 5582 processor using v32 firmware where I will be communicating with a Genset using Modbus TCP. It...
Replies
14
Views
972
Hi! It is always said, that DINT is the most performant datatype in AB plcs. I while ago i made a performance test. Several instructions like ADD...
Replies
4
Views
655
Im trying to use a MSG instruction to get the serial numbers of all addon cards and display the serials on a HMI interface. I have the logic done...
Replies
2
Views
552
Just something I think about when choosing data types in Studio 5000. It seems logical, but I've never looked deeply into the question. When...
Replies
12
Views
1,364
Back
Top Bottom