Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Number formats in PLCs

Status
Not open for further replies.

dexdyne

Civil/Environmental
Jul 10, 2007
8
0
0
GB
I'd like to find out what number formats are in use in a representative range of PLCs. I guess there's nowhere better to ask ???

We're reading values out of them across modbus. I want to know what possible formats I an expect to meet.

I don't know how much flexibility the PLCs give to the programmer when setting stuff up.... can you specify the number format for something, or are you terribly restricted?

I can conceive of meeting any of the following... anyone able to say "never" or "always" to each?

unsigned 16-bit integer
signed 16-bit integer
16-bit integer with 8000h as zero
unsigned 32-bit integer
signed 32-bit integer
32-bit integer with 80000000h as zero
unsigned 64-bit integer
signed 64-bit integer
64-bit integer with 8000000000000000h as zero
32-bit floating point
64-bit floating point

Thanks for any help you can give.

David
 
Replies continue below

Recommended for you

I think that you covered most possibilities. Some also use "IEEE 32 bit floating point". I do not have that spec in my head. But should be available if you google it.

Two's complement always used for signed integer.

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
Thanks Skogsgurra,

I meant to say IEEE 754 - I can never remember either.

Are you saying that I might encounter all of them, except the non-2-s-complement signed stuff?

Do some PLCs really have 64-bit fpt? I know it's what PCs default to these days, so I guess PLCs will not be far behind....

David
 
Well.. I said that you had covered most of the possibilities. I am not so sure that 64 bit fp is used, though. Not yet. But I haven't seen them all.

If you encounter them - and in what form - depends on where you look. If you are communicating via Profibus, you may see all number systems that are used by the objects on the bus. I usually only see unsigned 16 bit integer, signed 16 bit integer and 16 bit vectors containing status bits.

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
Thanks -

I've got a flowmeter in front of me that uses 32-bit fpt, and heaven help me, ASCII strings in modbus registers.

I don't THINK it uses signed integers, but I haven't looked at all 100 registers yet :-(

David
 
Thanks OldPfart

I'm just going to hope that we never come across anything in BCD.

What Omron models feature this 64-bit fpt then?
 
"I've got a flowmeter in front of me that uses 32-bit fpt, and heaven help me, ASCII strings in modbus registers.

I don't THINK it uses signed integers, but I haven't looked at all 100 registers yet "


I know from past experience if you can put ASCII into a SINT (short int <<AB term) or a byte. Then data manipulation is easier, otherwise your have these characters that might need swapped or pad the odd 1/2 word of your INT.

Just a thought.

 
Omron CJ1, CS1, NSJ, CPiH, CP1L all share a function set including 64 bit floating point.

Nothing wrong with BCD by the way. In the above PLCs you can select all timers and counters to be BCD or decimal for example. Most electricians understand BCD rather than decimal or hex. I am glad octal has all but vanished though. I do not know if it is still used in any PLCs but it was once.
 
"Most electricians understand BCD rather than decimal or hex. I am glad octal has all but vanished though."
BCD is numeric format - it describes what is meaning of bits in bit string.
Hex, decimal and octal as well as binary are forms of presenting bit strings.
And god save us from electricians who can't understand decimal numbers (btw, how they know how much do they earn ?)

Regards,

Jacek

Do it right or don't do it at all.
 
Status
Not open for further replies.
Back
Top