Hey monkworm,
I'll try and explain a bit about BCD and hex, it is a bit confusing... I may confuse myself even during this explanation...
The best way I can think of to explain a BCD is picture a 4 numbered thumbwheel for settings. Let's say, for example, you want to use the number 16 for a display. If you start the thumbwheel with this...
0000
you will need to first enter 6 for the ones variable. To look like this...
0006
Then, you will need to enter the 1 to the tens area, so you end up with this...
0016
Now, I'm hoping that you understand how binary works. If you viewed the binary 0000, each one in the setup will be assigned a number, 1, 2, 4 and 8, from right to left. So, in essence, you end up with this for your 'formula'
8421
Now, say you want the number 6 in the ones area of the thumbwheel, you will need this
0110
(8421)
Since the 1 above 4 is on, you will start with 4. You also have the 1 above 2 on, so this is also entered into the equation. Next, you can add 4+2 and end up with 6. This concludes your 'ones' area.
Next, the tens. You will need a BCD of this... 0001.
(th) (hu) (te) (ones)
Your overall number in BCD would be 0000 0000 0001 0110
If you were to hookup a thumbwheel of this size to an output, say an led display, you could convert those numbers into something that the display can compute. The thumbwheel would see it as 0016, the PLC converts to BCD, 0000 0000 0001 0110, then sends the signal out the wires to the display, which converts back to 0016. Very simplified, but hopefully that clears it up a bit. Here's all the 4 digit combinations under BCD
0000=0
0001=1
0010=2
0011=3
0100=4
0101=5
0110=6
0111=7
1000=8
1001=9
You may be saying, 'Hoot, what about combos such as 1011, 1111, etc...?' That is where hexadecimal comes in. For the numbers 10-15, they assign a letter, a-f. Hexadecimal, in most parts (computers, etc..) is really nothing more then a form of 'shorthand' for binary. Here's the rest of the table...
1010=a
1011=b
1100=c
1101=d
1110=e
1111=f
If you were to use this on the above example of an led, and say that it could display the letters a-f, it would lead to massive confusion on the operator end. "What is this (expletive) f mean?? I just want 16... so I know that it accepted 16..."
To apply hexadecimal to a plc, I have seen it mainly (only?) used for masked moves. Let's say you want to know the measurement of something, but don't want to know the thousands, hundreds or even tens of such a length. Just the ones, from 0 to 9. For that, you would setup a mask of 000f. This would filter out all the thousands, hundreds, and tens of the measurement.
As an example, let's say you have a word (16 bits) set aside for a measurement. It starts with 0000 0000 0000 0000 (nothing has been measured yet). It passes, and you end up with 0100 0111 1010 0110. With the 'mask', it would only pass through the last 4 numbers, or the 0110 and you could work with the number from there.
0100 0111 1010 0110 <--- measured number
0000 0000 0000 1111 <---- mask (000f)
0000 0000 0000 0000 <---- initial number (mask of 1 allows # thru)
0000 0000 0000 0110 <---- new number
To make this a bit more confusing, let's change the mask. How about a hex mask of 00ef? What would our number be then?
0100 0111 1010 0110 <---- measured number
0000 0000 1110 0110 <---- mask (00ef)
0000 0000 0000 0000 <---- initial number
0000 0000 1010 0110 <---- new number
If nothing else, try to remember that hex is a form of shorthand...
Hoot