Plc

Status
Not open for further replies.

apprentice

New member
IS there anybody that can help me with the PLC . I just need little help please. I am having a hard time understanding the conversion from HEXDECIMAL TO BINARY AND SO ON .
 

LarryFine

Master Electrician Electric Contractor Richmond VA
Location
Henrico County, VA
Occupation
Electrical Contractor
apprentice said:
IS there anybody that can help me with the PLC . I just need little help please. I am having a hard time understanding the conversion from HEXDECIMAL TO BINARY AND SO ON .
I could just look for a website, but then, so could you, so I'll just explain what I know. 'Hexadecimal' is merely 'hex' plus 'decimal' (6 + 10), which means 16.

Base 10 counting is convenient because we have 10 fingers, but binary uses multiples of two, because it can be represented as "off"(0) and "on" (1). But, we're halted at 8 (1000 in binary) because we need more than 9 numerals to go higher than that using our normal one-digit numbers.

So, to be able to reach 16 (10000 in binary), they added A through F, so we can now count higher by using 0 through 9 and A through F, So we now can count: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21, 22, 23, etc.

Now, we have 16 values for each numerical place (1's, 10, 100's, etc.) instead of just 10. By using 0 through F, we can have 256 (0 thru 255) possible values using only two places instead of just 99 (0 thru 99). The advantage can be seen in the HTML color codes.

Black is 000000, and white is FFFFFF. The level of red is represented in the first two places, green in the next two, and blue in the last two. Pure red, for example, is FF0000; pure green is 00FF00, and pure blue is 0000FF. Gray can be anywhere with all values the same, such as C9C9C9.
 

Strahan

Senior Member
Location
Watsontown, PA
Larry did the work explaining the meat to you so I won't waste time. Get yourself a plc book and there will be a chapter dedicated to numbering systems. It is one of the hardest concepts to get but don't get to caught up on it. Once you are working with the software it is very easy to go into the data tables and change the radix to prove yourself right. Good luck!
 

jim dungar

Moderator
Staff member
Location
Wisconsin
Occupation
PE (Retired) - Power Systems
For PLC's, I use the website www.plcs.net.

Over the years I find it easier to create a conversion table, with more than ten entries, as a visual reference. I can think in Decimal, BCD, and Binary. I have a hard time even translating Hex


decimal - Hex - BCD - binary
1 1 0000 0000 0000 0001 0000000000000001
2 2 0000 0000 0000 0010 0000000000000010
3 3 0000 0000 0000 0011 0000000000000011
4 4 0000 0000 0000 0100 0000000000000100
5 5 0000 0000 0000 0101 0000000000000101
6 6 0000 0000 0000 0110 0000000000000110
7 7 0000 0000 0000 0111 0000000000000111
8 8 0000 0000 0000 1000 0000000000001000
9 9 0000 0000 0000 1001 0000000000001001
10 A 0000 0000 0001 0000 0000000000001010
11 B 0000 0000 0001 0001 0000000000001011
12 C 0000 0000 0001 0010 0000000000001100
13 D 0000 0000 0001 0011 0000000000001101
14 E 0000 0000 0001 0100 0000000000001110
15 F 0000 0000 0001 0101 0000000000001111
16 10 0000 0000 0001 0110 0000000000010000
17 11 0000 0000 0001 0111 0000000000010001
18 12 0000 0000 0001 1000 0000000000010010
19 13 0000 0000 0001 1001 0000000000010011
20 14 0000 0000 0010 0000 0000000000010100
21 15 0000 0000 0010 0001 0000000000010101
22 16 0000 0000 0010 0010 0000000000010110
23 17 0000 0000 0010 0011 0000000000010111
24 18 0000 0000 0010 0100 0000000000011000
25 19 0000 0000 0010 0101 0000000000011001
26 1A 0000 0000 0010 0110 0000000000011010
27 1B 0000 0000 0010 0111 0000000000011011
28 1C 0000 0000 0010 1000 0000000000011100
29 1D 0000 0000 0010 1001 0000000000011101
30 1E 0000 0000 0011 0000 0000000000011110
31 1F 0000 0000 0011 0001 0000000000011111
32 20 0000 0000 0011 0010 0000000000100000
 

Besoeker

Senior Member
Location
UK
For what it's worth, Excel has a range of built in functions that do number format conversions.
=HEX2BIN(number)
=HEX2DEC(number)
=DEC2BIN(number)
etc.
 

jnsane84

Senior Member
WOW! I used to do alot of work with this stuff and understood it very well but you guys just blew my mind. It's been awhile so I guess I'm a little rusty at this point. I gotta dust off the manuals and brush up on my stuff.:grin:
 

petersonra

Senior Member
Location
Northern illinois
Occupation
engineer
hex and binary are just two different ways to denote the same number.

hex uses a single character to represent the state of four bits, while binary uses 4 characters to do the same thing.

hex numbers are base 16, binary is base 2.
 

wireman

Inactive, Email Never Verified
Binary, Octal, and Hex all came rather easy to me.
BCD still messes me up......just don't get it.
 

jim dungar

Moderator
Staff member
Location
Wisconsin
Occupation
PE (Retired) - Power Systems
wireman said:
Binary, Octal, and Hex all came rather easy to me.
BCD still messes me up......just don't get it.

BCD is simply each single decimal digit (0-9) converted to binary. Because we are dealing only with the digits creating any number greater than 9 takes two or more digits which means two or more groups of 4 binary characters. I find it easier to keep the BCD binary digits separated when I write them down.
 

highendtron

Senior Member
A lot of junior colleges and vo-techs offer basic math/numbering classes that could be used as continuing education credits (CEU). Allen-Bradley starts all of their basic PLC classes off with basic numbering (hex, binary , octal, hdex...)
 

Strahan

Senior Member
Location
Watsontown, PA
This is my bread an butter. The three most important numbering systems that need mastered are binary, decimal and octal. Of course you need to know BCD and Hex but you won't necessarly deal with them everyday and I admit I still have to get my cheat sheet out. We use BCD for all our thumbwheel selectors and we use Hex for our mask move instructions. But all in all going from decimal to octal and back is the most important feat when working with PLCs. Example going from a SLC to a PLC decimal to octal. CLX to PLC same scenario just with 32bit instead of 16. Keep chugging you will get it. If you don't work with it though it will go away.:grin:
 

LarryFine

Master Electrician Electric Contractor Richmond VA
Location
Henrico County, VA
Occupation
Electrical Contractor
TOOL_5150 said:
There are 10 types of people on earth - those who understand binary, and those who do not.
But that's only nine. You must not know what you're talking about. ;)
 

LarryFine

Master Electrician Electric Contractor Richmond VA
Location
Henrico County, VA
Occupation
Electrical Contractor
wireman said:
BCD still messes me up......just don't get it.
I had never really thought about it, but I just figured it out looking at Jim's excellent chart, despite the collapsed formatting. The group of four digits to the rightmost (the least significant digit) is simply the decimal ones digit in binary; the next group of four going left is the tens digit in binary, etc.

It's simply displaying the individual decimal digits as individual binary digits. Note that, for example, that 10, which is one 10 and zero 1's, is shown as 0001 and 0000. Likewise, 24 is shown as 0020 (two in binary) and 0100 (four in binary.)
 

jim dungar

Moderator
Staff member
Location
Wisconsin
Occupation
PE (Retired) - Power Systems
Strahan said:
This is my bread an butter. The three most important numbering systems that need mastered are binary, decimal and octal. Of course you need to know BCD and Hex but you won't necessarly deal with them everyday and I admit I still have to get my cheat sheet out. We use BCD for all our thumbwheel selectors and we use Hex for our mask move instructions. But all in all going from decimal to octal and back is the most important feat when working with PLCs. Example going from a SLC to a PLC decimal to octal. CLX to PLC same scenario just with 32bit instead of 16. Keep chugging you will get it. If you don't work with it though it will go away.:grin:

I have worked with PLC's since the late '70's and have never once used Octal; but, then again I have never programmed an AB PLC.;)
 

Strahan

Senior Member
Location
Watsontown, PA
jim dungar said:
I have worked with PLC's since the late '70's and have never once used Octal; but, then again I have never programmed an AB PLC.;)

Well then that might explain it. Allen bradley's PLC 2's and 5's all use octal addressing. The SLC 500 went to decimal addressing and the CLx also uses the decimal addressing scheme just 32 bit as compared to 16bit. I'm curious as to what brand you are most familiar with? I have some experience with Sencon and Omron plcs but this is limited to replacing them with AB.
 

Strahan

Senior Member
Location
Watsontown, PA
realolman said:
The numbering system used by AB the most is $$.

Totally agree in most situations AB is a little costly but I will say it is the most user friendly. Not just talking stand alone machinery here plant wide networking lots of ethernet and RIO that also incorporates the not so used octal numbering scheme. I guess if I were running my own business I would have the same opinion as most but working as an industrial control tech believe me I have seen AB lower costs when they are competeing for big business.
 
Status
Not open for further replies.
Top