hex/bcd

berni

Guest
B
It is possible to showing Hex/BCD data into panelview.
I'm trying to do that with panelview 1400
 
It depends on the meaning of the word "POSSIBLE"

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.

Allen-Bradley Company, LLC, Copyright © 1993-2001, All Rights Reserved

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.
 
Last edited:
Typo.

Oops. Numbers greater than 9 should add 55, not 64.

Code:
Value in          Decimal            ASCII          Final 
Masked Register   Representation     Coversion      ASCII
0000                  0               + 48     =    48 ("0")
0001                  1               + 48     =    49 ("1")
0010                  2               + 48     =    50 ("2")
0011                  3               + 48     =    51 ("3")
0100                  4               + 48     =    52 ("4")
0101                  5               + 48     =    53 ("5")
0110                  6               + 48     =    54 ("6")
0111                  7               + 48     =    55 ("7")
1000                  8               + 48     =    56 ("8")
1001                  9               + 48     =    57 ("9")
1010                 10               + 55     =    65 ("A")
1011                 11               + 55     =    66 ("B")
1100                 12               + 55     =    67 ("C")
1101                 13               + 55     =    68 ("D")
1110                 14               + 55     =    69 ("E")
1111                 15               + 55     =    70 ("F")

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.
 
Last edited:
to allen

My problem is: I have 6 Indramat drive on devicenet connected to a plc 5/30.

I want to display the status word of each drive on the panelview.

ex: C104 (in status word ) = loss communication

I want to showing "C104" in the panelview, but you said that panelview display only integer file. ****!

Thanks Allen
 
Re: to allen

berni said:
...you said that panelview display only integer file. ****!

I also said that there was a workaround. .

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.

hex2ascii.gif
 
Last edited:
Might try this...

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.

Just a thought.
Keith
 

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,917
Back
Top Bottom