LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary/hex to ASCII character

I am trying to send 8bits to a microcontroller, who understands ASCII characters. I am having trouble finding out how to convert my 8bits, or hex values, to the corresponding ASCII character....
i.e. 01010101 binary = 55 hex = U char
See the attached file...
0 Kudos
Message 1 of 9
(14,299 Views)
The microcontroller should only see all values as binary and does not differentiate between a hex number and an ascii value but you can easly convert between types using a typecast vi.  feed the U8 into the typecast and a string type to the "type" node and a string type will come out.  LV also has byte array (much like the memory of the microcontroller) to string, this is useful in reading values out from the micro and converting it to human readable ASCII strings.
 
 
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 9
(14,273 Views)
Hi!

  Here's my answer....

graziano
Message 3 of 9
(14,271 Views)
Sorry! I mean, here is my answer:   http://forums.ni.com/ni/board/message?board.id=180&message.id=21223

graziano
Message 4 of 9
(14,268 Views)

Graz, sorry i posted in the wrong forum at first, but thanks for replying.

I am able to check what the microcontroller recieves, by activating 8 LED's corresponding to the byte. When using the attached file: Basic Write 1, wverything works great. The LED's will represent the byte exactly, for example 01010101 when sending the string "U" and so on..

For my project i need to be able to specify 8 bits (or switches) individually, and send this to the microcontroller, in the manner of the attached file Bin2Hex...

I basically just need to combine these two in the correct manner... something im yet to achieve..

Download All
0 Kudos
Message 5 of 9
(14,257 Views)
This is what i have done so far, and it works 50%... By that i mean that i am only able to manipulate the 4 last bits. The first 4 are set at 0011, and does not respond to any change in the VI.. So my LED's look like this: 0011xxxx (x=the ones that work).
 
As you may understand from my VI's so far, i am relatively new at LabVIEW.... So any comments to my programming will be greatly appreciated.
 
 
0 Kudos
Message 6 of 9
(14,252 Views)
Take a look at the attached to see if it does what you want.
Message 7 of 9
(14,240 Views)
Thanks Smercurio, that was very helpful indeed!
 
 
0 Kudos
Message 8 of 9
(14,210 Views)

Thank you!

0 Kudos
Message 9 of 9
(4,704 Views)