Data types - which to use?

simple_mind

Member
Join Date
Sep 2006
Location
midwest
Posts
3
really REALLY dumb question here...

I'm new to PLCs, and have been searching for most of the day trying to find an answer. I apologize if this has been asked here, I have searched and cannot find the post.

I'm trying to determine what data types to use for RTDs, PTs, FTs, actuated valves (assuming bool?)

RTDs are analog 4-20, so I'm guessing INT?
PTs and FTs are the same?

I hate guessing, and do not have a mentor available, so I really need some expert advice.

Thank you again, and I apologize many times over if the answer is posted here in an easily accessible place =/

edit: I failed to mention, I'm using AB RSLogix5000
 
Simple,

It depends on what you are going to do with the data & the level of accuracy that is required. Floating point numbers have the benefit of decimal point usage for fractional number parts. such as a temperature of 75.3 degrees. You will find that fractional number parts are more dufficult to deal with if the number is in integer format.
Assuming that PT means pressure transducer. Use a float if possible.
Assuming that FT means flow transmitter. Use a float if possible.
Assuming actuated valve means that the valve is open or closed. Use a bool.

There are some cases where simple integers will do if the accuracy of a rounded whole number is "close enough".

Integers use less memory in the PLC. Hope this helps.
BD

Oh Yeah. Welcome to the forum!
 
thank you very much BikerDude...the quick reply is GREATLY appreciated!

yes, sorry, FT = flow transmitter, PT = pressure.

So there isn't a strict requirement for datatype(s) for specific devices? You're saying desired precision of the data is the key(except discretes would use BOOL)

again, thank you so much. I will be posting many more dumb questions - I should have joined this forum weeks ago. Instead I have been trying to piece information together from Google and some manuals I had thrown at me from our AB reps.
 
Actually, it's a very good and nuanced question ! Just keep your sentences complete and your questions bolstered by facts and you'll do fine.

ControlLogix is a 32-bit controller, so it handles 32-bit datatypes the most efficiently. 32-bit DINT double-integers are the default datatype in Logix.

The new controllers (L6x series) have very good floating-point performance so there's no problem using floating point where it's appropriate.

Although ControlLogix supports 8-bit SINT and 16-bit INT datatypes, they actually take just as much memory and more execution time because they have to be translated into DINT's before the controller can process them. Unless you're using them for PLC/SLC compatibility for byte-level data handling, avoid SINT's and INT's.

ControlLogix also supports compound data types; we call these "UDT's", and they are the source of large amounts of both delight and frustration in the Logix programmer community.

If you buy nothing else as an accessory to your RSLogix 5000 license, get a controller documentation bundle. It's a stack of books a foot high for about $100. I've been amazed by how many times I've looked high and low in help files and knowledgebases only to find out that often the information I needed was right there in black and white.
 
The documentation package I mentioned is part number 1756-DPALEN. It includes eighteen of the most important user manuals for ControlLogix users.

You can read the whole packing list here: 1756-DPALEN.

All those documents are also downloadable for free from the literature.rockwellautomation.com site.

Ask your A-B distributor if any of the "On Tour" seminars are coming to your area. I just got through doing that in seven cities and it was a great way to introduce new users to the RSLogix 5000 environment.

And, of course, you could see if the boss will let you go to Automation Fair in Baltimore !
 
simp,

I have to agree with Ken on the manuals. Don't discount their value so quickly. Yeah there will be times when the info isn't there or is hard to find but I wouldn't want to be without. I feel that the RSlogix 5000 introduction class offered by Rockwell is worth the price of $960. Getting the "Low down" on these newer 32 bit processors and their associated hardware / programming interface is done in two 8 hour sessions. Consider it a few weeks head scratching / banging saved.

BD
 
thank you both very much...great information. I was given two manuals (ControlNet Modules in Logix5000 Control Systems and the Common Procedures) and they have been good reference. I'm not sure if these are part of the suite that you are referring to.

We are using the L62/B processor, and will not be doing any compatibility, so I will be sure to go with DINT and FLOAT. Your advice is appreciated more than you could possibly know.

Just a warning, I will have some notational questions tomorrow. :)
I'm hoping to do most of my programing using ST, but I have the feeling I will have to use ladder for some of it?

thank you both again!
 
Do a reality check before choosing your data type. Regardless of which data type you choose, the value will not have any better resolution than the resolution of the underlying analog devices. The CPU may have significantly greater processing power than the devices to which it is connected.

For example, if have a 0 - 1000 GPM flow transmitter outputting a 12-bit, 4 - 20 mA signal, that range is divided into 4096 steps of 0.244 GPM each. You can convert that into a floating point value and carry it out to as many decimal places as you want, but nothing to the right of the decimal point is significant.
 
In CLX I almost always go with a real number for process variables. A dint and a real both occupy the same amount of memory in the CLX (32 bits) and there is plenty of speed to handle the floating point calculations.

So make life easy on yourself and don't sweat it. Use what's easiest, and most of the time for process variables that's a real. Many of the instructions for handling analog values (select, scaling, totalizing, lead/lag, PID, etc. all use real tags anyways.)

For other tags in your program just be aware that even though a real number can represent larger numbers than a dint can, it drops 1 significant digit at about 17 and a half million, while a DINT can go to over 2 billion with all digits significant. While this matters little for analog IO (16 bit A/D convertrs) it does matter sometimes when making totalizers and large number counters. If the value is always a whole number then use a DINT.
 

Similar Topics

I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
379
I am using a Beckhoff PLC and trying to convert a REAL to 2 WORDS to send over Modbus. Does anyone know how to do this? Also how would I convert...
Replies
5
Views
788
Looking for information regarding what data types are supported in Crimson 3.1 programs. Cstring is self explanatory. Professor Google hasn't been...
Replies
1
Views
1,151
I'm currently working on a messaging system and Ive been having issues with trying to message over a REAL Data Type from one PLC to another. Has...
Replies
2
Views
1,279
I work at a cheese factory and we recently ran into a problem where in an older controller they where able to use a REAL Data type in OTU and XIC...
Replies
13
Views
2,582
Back
Top Bottom