LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex to Normal display

Solved!
Go to solution

Hello

I have a problem with hex to normal conversion:

I have the constant string that is a date 03/02/2010 12:30:00 ( Normal display), if I use the Hex display it will be 3033 2F30 322F 3230 3130 2031 323A 3330 3A30 30

 

So I if  I write this Hex display of the date into a another string diplayed as normal, how can i convert this value to the initial date?

 

Thanks 

 

 

0 Kudos
Message 1 of 21
(4,992 Views)

Hexadecimal String to Number vi should help.

 

HEX time.png

---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
0 Kudos
Message 2 of 21
(4,988 Views)

enzo78 wrote:

So I if  I write this Hex display of the date into a another string diplayed as normal, how can i convert this value to the initial date?


Why do you want to this back conversion? Why don't you connect both of the strings using wires? Post what you have did so far. We will help you out.

 

Mathan

0 Kudos
Message 3 of 21
(4,984 Views)

enzo78 wrote:

Hello

 

I have the constant string that is a date 03/02/2010 12:30:00 ( Normal display), if I use the Hex display it will be 3033 2F30 322F 3230 3130 2031 323A 3330 3A30 30

 

So I if  I write this Hex display of the date into a another string diplayed as normal, how can i convert this value to the initial date?

 

Thanks 

 

 


The point is that converting the value in another format and displaying it in another format is not the same. You are displaying the value in HEX, but it is not in HEX as I understand. So you do not need to convert it, just set that another string indicator to display in normal format.

 

And if you have a string in HEX, then you can use the vi I have mentioned above.

---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
0 Kudos
Message 4 of 21
(4,973 Views)

Hi All

 

I have attached the example

 

0 Kudos
Message 5 of 21
(4,963 Views)

This is the beginning I have made.

 

HEX.png

 

There are two  drawbakcs:

1. No spaces in the input HEX code available.

2. The result is given with a space between every character.

 

This is how it looks like:

 front_panel.jpg

 

Maybe this will give you some ideas while moving on.

Message Edited by Giedrius.S on 02-04-2010 04:53 PM
Message Edited by Giedrius.S on 02-04-2010 05:00 PM
---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
0 Kudos
Message 6 of 21
(4,935 Views)
Solution
Accepted by topic author enzo78

Did the snippet creation create the for-loop with a constant of 1?

 

 

Now for the trivial solution: 

  1. Right-click on the  Prompt User for Input Express VI and select "Open Front Panel".
  2. At the dialog click on the "Convert" button. 
  3. In the new VI that gets created right-click on the "Key" string control and select "Hex Display".
See attached.
Download All
Message 7 of 21
(4,917 Views)

My solution with no drawbakcs.

 

HEX.png

 

HEX front.jpg

 

Anyway, it is very possible that there was a more efficient way to solve this. While I am only a novice, this is the best what I have managed to come with 🙂

 

---

 

smercurio_fc,

 

No, I have made those changes to simplify the execution for testing the program. Originally, while loop was given.

Message Edited by Giedrius.S on 02-04-2010 05:42 PM
---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
Message 8 of 21
(4,912 Views)
Thanks for the help to all
0 Kudos
Message 9 of 21
(4,882 Views)

Hy all.

I'm new on this forum, and I'm coming from Slovenia, so sory in advance for ma "bad language".

 

I'm kind of "a fresh starter" in LabView, so I turned to you guys, if U could help me with this problem, that I have.

 

So...

I'm building VI, to whom i get Hex string from byte array. Now i have to convert this HEX string into a DBL number.

I tryed like this:

- convert byte array to string

- then HEX string into a number

 

But I always get "0" out.

For example, if I put in the HEX string "1388", I would have to get the number 5000 out. But i get "0" all the time.

 

Thanks in advance...

0 Kudos
Message 10 of 21
(4,787 Views)