Number formats in PLCs
Number formats in PLCs
(OP)
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
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





RE: Number formats in PLCs
Two's complement always used for signed integer.
Gunnar Englund
www.gke.org
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
RE: Number formats in PLCs
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
RE: Number formats in PLCs
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
www.gke.org
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
RE: Number formats in PLCs
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
RE: Number formats in PLCs
How about BCD?
RE: Number formats in PLCs
I'm just going to hope that we never come across anything in BCD.
What Omron models feature this 64-bit fpt then?
RE: Number formats in PLCs
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.
RE: Number formats in PLCs
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.
RE: Number formats in PLCs
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.