01-30-2013 04:01 AM
I am working on UART communication between LabVIEW and my PIC microcontroller.It works absolutely fine with character Txn & Rxn.But I am facing problems in transmiting & recieving hexadecimal nos. through this interface.Firstly, is it possible to transmit & recieve these numbers without ASCII to character conversion & vice versa? and is there any efficient technique to deal with hex nos. written in string controls for transmission?
Solved! Go to Solution.
01-30-2013 05:01 AM
Can you please let me know where exactly you are facing problem, and if you are able to send & receive ascii data then you should be able to Tx & Rx hex data also. There should not be any problem with HEX nuimbers.
01-30-2013 08:40 AM - edited 01-30-2013 08:42 AM
Do you have termination characters enabled (the default)? If so, and your data includes a byte which is equal to the termination character, you will have problems.
When transmitting binary (or hex) data, you should use a protocol with fixed message lengths and have termination characters disabled.
The serial communication transmits bytes. It does not care how you display them, what generated them, or whether they represent ASCII or random numbers.
Lynn
01-30-2013 09:12 AM
If you really want to transmit a hex number, you can use the typecast function or the byte array to string function.
01-31-2013 11:24 PM
Hi all,
Thanks for replying...I tried the things you all suggested and finally got the way to communicate with hex nos..:)..More details can be obtained at:
http://digital.ni.com/public.nsf/allkb/6C24F2F07BC23BB78625722800710865
02-01-2013 09:25 AM
So you did exactly what I told you to do.
02-01-2013 10:50 AM
@dennis:lol..
..to be honest yes i did...
but i also got this doc while browsing for the same
..thank you!!