Hex/Bcd help

monkworm

Member
Join Date
Feb 2003
Location
Indiania
Posts
25
Converted a program from a Plc-2/17 to a Mitshubushi Q01 program works and runs machine great except for 1 thing. I have a sequencer with no Information about it. I went to computer looked up Data address and found value in table of 0001 0012 0120 0030 hex/bcd does this mean anything. If so how do I read it. These bits are in a sequential output controlling outputs on a output module addresses 022/-- these outputs fires up another controller which puts faults on a CRT. No papers exists and we have no software to read other controller. If these numbers mean nothing does anyone know if correct values are located on original program in computer and where it's location is. Thanks
 
Could you check ...your's communication network

From my idia (may be not correct one)
Do you use any communication network...please check ..between each link..
Do you transfer all fungtion from plc 2/17 to Mitsu ...at the correct way and the same fungtion?
Do you check the program ..sequence is it work properly?(check I/O)
I hope this some suggestion may be useful.

A.Char
 
The Windows calculator in scientific mode can convert HEX, BINARY and OCTAL for you.
beerchug
 
Numbers are so confusing!

Understand this, it is very important to your future.

The output module of a plc may indeed have 16 outputs numbered from 0-15 in the case of a SLC500 or for the PLC using 1771 I/O it is 0-7,10 17 due to the octal addressing for the I/O rack. In any event, the 16 bits are assignable to anthing you like, including a sequencer output. So, if the sequencer data file contains the value of lets say 0120 as you suggest yours does, the Hex/BCD encoding makes a difference here. 0120 in BCD has a bit pattern as follows:

0000 0001 0010 0000 binary is = 0120 BCD
However:
0000 0001 0010 0000 binary is = 0120 HEX

In the two examples the outcome is the same and as you can see the bits that are a one are in the same position. As far as output numbering goes, in the 1771 I/O it is bits 022/05, and 022/10 respectively starting from the right end and moving left.
Be careful with HEX and BCD encoding though, because BCD only encodes the decimal values of 0-9 in four bits and HEX can encode the values of 0-15 in the same four bits. BCD is Binary Coded Deciaml and it takes 4 bits to encode each digit in a number. HEX is short for Hexadeciaml which is just a base 16 number system.
Maybe this helps a little, at least I hope it does.
 
Bits,Words,BCD and Hexadecimal

Dear monkworm
I am not sure you are using plc Mitsu. or not.(If not ..sorry)

If you have question about Bits,Words,BCD and Hexadecimal in mitsu..
Please check from the ManualMelsec-F in Advance Devices section page
4-41 to 4-48

A.Char
Mechatronics
RIT.Non
 
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
 
Sorry, still kinda new to this forum...

Some of it didn't come through, the (th) (hu) (te), etc... that was to be over the 4 sets of binary in BCD.

thou hund tens ones
0000 0000 0000 0000

I'll see if that posts proper ;)

Hoot
 

Similar Topics

I'm working on updating a waste water plant to modern processors except on vendor supplied systems. On of the vendor systems uses old Direct...
Replies
2
Views
1,800
Guys, I have an issue that i dont understand and am hoping that someone has an idea. I have a Lauer PCS950C HMI communicating with a Siemens...
Replies
5
Views
2,334
Hi all, I am looking for a BCD or hex thumbwheel switch. I only plan to use 0-7 (3 bits). I prefer something that has leads already. I would...
Replies
6
Views
2,745
i'm newbie in PLC, would u like to help me, plese.. i'm using an instruction MOV, for moving Hexadecimal data #0020 which is &32 in decimal,to...
Replies
3
Views
1,821
i'm confusing about an instruction in PLC, need your help, please.. i MOV(021) a data #0010 in hexadecimal then i stored it in memory D100 after...
Replies
4
Views
1,919
Back
Top Bottom