From the Penelview Help file, under the search "Hexadecimal"
Notes
· PanelBuilder also supports Octal (0 to 177777), Hexadecimal (0 to FFFF) and Binary (0000 0000 0000 0000 to 1111 1111 1111 1111) formats for data entry. However, the terminal does not display/or transfer these formats. Use the Unsigned Integer or Bit Array data type with these formats.
One work-around would be to take the integer you are interested in, MVM it to 4 consecutive integers with 000fh, 00F0h, 0F00h, and F000h as your four masks. Now you have the the individual hex element in each register. For each of those register, if the value is greater than 9, add 64 to it. If less than or equal to 9, add 48.
What you now have are 4 consecutive registers with the ASCII representation of the four-digit hex number. This can be displayed using a Character Array tag type and an Character embedded variable in a Text object.
If a number is in BCD format in the PLC and you want to display it on the Panelveiw, just use the FRD (FRom bcD) instruction to convert it to an integer and display normally.
The following code uses N11:0 for the Indramat Status. N11:0 might have a value of 1100 0001 0000 0100, or C104 in Hex.
If you display N11:0 on the Panelview, you'll get -16124, which isn't what you want. But if you use this code:
[attachment]
and configure the following tag:
Tag name: Indra_1_Status
Data Type: Character Array
Tag Address: N20:0
Array Size: 4
Then put a text object, and use an Character Embedded variable (field width 4, read tag Indra_1_Status), you'll get "C104" displayed on the screen.
Caveat: I haven't been able to test this - my Panelview is currently in the middle of acceptance testing so i can't make any changes. But it looks sound.
Allen has a good general purpose converter listed above. However, you have a very specific case. As I recall the Indramat dirve status value is actually a descriptive letter followed by what is the equivalent of a BCD number.
The reason I say this is that the vallue will always be 4 hex digits long and will always lead with the letter A,C,D,E or F. The three digits that follow will always be between 0 and 9.
You might want to mask off the upper 4 bits in the word and use a BCD to integer conversion to get the numeric part. Then use the Upper 4 bits to make a decision on what letter needs to be sent and send that as ASCII. Probably use Allen's converter to get an ASCII value and send that.