binary to hexadecimal conversion

jerry859

Member
Join Date
Dec 2010
Location
ky
Posts
12
I am trying to mask the first 8 digits of binary code in a Allen Bradley remote I/O module for alarm tracking puposes. I only need to read the last 8 digits of that 1 word . My problem is that I need to convert that to the equivalent Hexadecimal number. I'm not sure how to convert those first 8 binary digits into the Hexadecimal number. Any help would be greatly appreciated. Thank You.

Jerry
 
I often use the Windows calculator in "Scientific Mode" to convert decimal/hex/binary or just change the Radix in a tag display in RSLogix.

To "mask out" the lower 8 bits of a 16-bit word, you can use the Masked Move.

1111 1111 0000 0000 binary = FF00 hex = 65280 decimal (unsigned integer) = -256 (signed 16-bit integer)
 
I only need to read the last 8 digits of that 1 word . My problem is that I need to convert that to the equivalent Hexadecimal number.
Two possibilities: you want the 16-bit Hexadecimal equivalent of an 8-bit hex number, OR you want the 16-bit Hexadecimal equivalent of a 16-bit hex number where the 8 rightmost bits = 0. These two cases are not the same.
 
Hmh. Where do you need to see them as hex? You know that hex, dec, bin, oct etc. are just way of showing same data? You know that in computers (plc is computer of sort) data is stored as binary but can be shown by different things in one form or other?

BCD to bin, hex, dec, oct etc. would need to convert data itself. But bin to hex does not need. Or is it BCD?
 
Last edited:

Similar Topics

Hi folks, I'm trying to parse a binary string on a Red Lion DA30D using a Raw UDP/IP input port. I've done this before with ASCII strings so I do...
Replies
38
Views
992
So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC. I have two identical machines however one...
Replies
6
Views
547
Hi, I want to extract every second bit of a double word and place it in a new word but the position of placement should be from 0,1,2......15...
Replies
17
Views
3,076
Hello, I am trying to convert a incoming string that is in Binary format (See attachment) to a DINT. Any ideas? When I use the STOD command it...
Replies
6
Views
2,222
How can I read individual binary bits from a SLC500 within FTH SE? With the Tag Browser I can get to the Binary Files and get each Integer from...
Replies
5
Views
1,608
Back
Top Bottom