LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex to numeric value does not workl!!!!!!!!!!!

Hex to number doesn't work!!!!  I'm reading from a serial port.  I'm able to format the text to a display in hex, but the damn NI function hex_to_number doesn't work!!!! I've tried everything (including reading the worthless hints and discussions) and spent four hours without resolve?  What is going on?????????????????????????????????????
0 Kudos
Message 1 of 8
(3,593 Views)
If you could explain your problem in more detail and/or post a screenshot of it someone might be able to help you 😉
0 Kudos
Message 2 of 8
(3,583 Views)

If you have set your string control to hex display to see the correct characters, then you are using the Hex String to Number incorrectly. The function converts the ASCII characters A-F and 0-9 to a number. When you turn on hex display, that is not ASCII. To convert your non-ASCII cahracters to a number, use the type cast as shown below or String to Byte Array.

Message Edited by Dennis Knutson on 12-05-2006 11:57 AM

Message 3 of 8
(3,584 Views)

Dennis,

 

I'll try your suggestion, as what you mentioned makes good sense.  I couldn't get the answer immediately from NI tech support.  I would sent a screenshoot, but I can't host it on a server.

 

Thanks

 

Rick 

0 Kudos
Message 4 of 8
(3,554 Views)
You don't have to host it on a server. You can simply attach it. See the 'Browse' button below this box. Click it and select the file to attach.
Message 5 of 8
(3,534 Views)

Dennis,

Close but no cigar!  This is my screen dump

 

 

thanks again,

 

Rick

 

0 Kudos
Message 6 of 8
(3,527 Views)
Since you have a two byte response, you can't use the U8 as in the example I posted. Change the representation of the constant to U16.
0 Kudos
Message 7 of 8
(3,520 Views)
Dennis,
 
That was only half the problem.  The other was using the debug probe which gave me -1.  I have reassigned the output for unsigned integer and this works fine.  Thanks again!!!
 
 
 
Rick
 
0 Kudos
Message 8 of 8
(3,513 Views)