Hex

DBLD99

Member
Join Date
Oct 2003
Location
USA
Posts
230
Is there a way to display a hex number on a panelview plus? I dont want to convert it to a decimal, but when I use a numeric display this is what is does.

thanks for anyones help
 
Nope, no way without a lot of work. PV+ doesn't provide any method of supplying a numeric format.

Maybe you could write an ActiveX control.

I'd say use a 'Local Message Display', but in Rockwells less than infinate wisdom, they do not allow values of 0 as an index in LMD's.
 
thanks, thats what I thought. I just wanted to show the devicenet message display on the scanner card on the HMI but if I have to do all that work they can just open the panel and look at the scanner card. Thanks again
 
Oh, well, for DeviceNet scanner messages, you could actually do with a Local message display, as the number of status codes is fairly small, and within bounds of the message list.

Really, there are what, 30? Status messages that you could expect to get, bounded from around 65 to 100 or so. And actual text is much better than a number, especially as it will be decoded on the PV+, so it doesn't result in any message traffic overhead.
 
As George (Ken) indicated (...I think), you have to "construct" the displayed value.

If the display doesn't display Hex, as you indicated... (it converts the value to Decimal)...

Then take the Hex value and use a Hex>Dec function to convert it to Decimal.

Then... assuming a 16-bit word... consisting of 4-nibbles (each consisting of 4-bits)...

Grab the MSN (Most Significant Nibble) and read it as a decimal version. Then use that value as an index into a table so you can grab a pointer to a "Character" in your display program memory. The MSN is Digit-1... the LSN is Digit-4 (LSN = Least Significant Nibble). When you grab and interpret the first Nibble (convert it from a simple decimal value to an Index Value), save the value as the Pointer to Digit-1.

Surely you must be able to store a set of characters in your display handler? And surely... you must have a way to grab a particular nibble??? If not, you can do the painful exercising of masking and shifting.

One way or another, grab a nibble and read it as a simple decimal value. Then use that simple value as an Index into a Table.

Table Base + Index = Pointer to memory location of the particular character.

0 => Pointer to "0"
1 => Pointer to "1"
2 => Pointer to "2"
3 => Pointer to "3"
4 => Pointer to "4"
5 => Pointer to "5"
6 => Pointer to "6"
7 => Pointer to "7"
8 => Pointer to "8"
9 => Pointer to "9"
10 => Pointer to "A"
11 => Pointer to "B"
12 => Pointer to "C"
13 => Pointer to "D"
14 => Pointer to "E"
15 => Pointer to "F"

Digit-1, Digit-2, Digit-3, Digit-4

Where Digit-1 is the MSN and Digit-4 is the LSN.

Example...

1234(Decimal) => 0000-0100-1101-0010(Bin)

0000 is the MSN, Digit-1. 0010 is the LSN, Digit-4.

Nibble-1 = 0000, Digit-1 = 0, Index = 0, Character = "0"
Nibble-2 = 0100, Digit-2 = 4, Index = 4, Character = "4"
Nibble-3 = 1101, Digit-3 = 13, Index = 13, Character = "D"
Nibble-4 = 0010, Digit-4 = 2, Index = 2, Character = "2"

Then it is simply a matter of assigning Digit-1 to a particular place on your display, followed by Digit-2, etc.

Then, with Digit-1 along side of Digit-2, along side of Digit-3, along side of Digit-4... you have "constructed" the appropriate Hex Value for display.
 
There are several technotes on the AB website about how to convert a Hex number to a string. Then you can display the string on the PV+.

They mostly all work on the same principle: deconstruct the 16 bit integer into 4 4 bit fields (nibbles - a half byte), then use a 16 character lookup table to construct the string based on the value of each nibble.

http://domino.automation.rockwell.c...54?OpenDocument

http://domino.automation.rockwell.c...81?OpenDocument

http://domino.automation.rockwell.c...F5?OpenDocument

http://domino.automation.rockwell.c...42?OpenDocument


edit: Thats pretty much the method Terry explained as well. The first technote actually has a sample PLC program attahced.
 
Last edited:

Similar Topics

Hello, I'm trying to setup a TCP connection from a Compactlogix 5069-L306ER to a TDI checkweigher to receive real-time weight data of the...
Replies
6
Views
359
I am using a Micro 850E PLC (the new one with implicit messaging capability) to drive a Kinetix 5100 servo drive. The error code number on the...
Replies
7
Views
1,756
only done small bits with modbus 984 and there is no register from the manufacturer of the equipment i have to be able to read and write to...
Replies
11
Views
2,461
Hi I need to convert a DINT with HEX value e.g A0F15663 to a string with the same value 'A0F15663'. Any tips of good instructions to use ...
Replies
11
Views
3,453
Hi there, How to do HEX conversion to ASCII in Rockwell software? In Siemens there is HTA instruction. Any advice's? I have RFID scanner I...
Replies
2
Views
2,215
Back
Top Bottom