LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with handling data in serial communication

Solved!
Go to solution

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?

0 Kudos
Message 1 of 7
(2,825 Views)

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.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 7
(2,816 Views)

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

0 Kudos
Message 3 of 7
(2,798 Views)

If you really want to transmit a hex number, you can use the typecast function or the byte array to string function.

0 Kudos
Message 4 of 7
(2,790 Views)
Solution
Accepted by topic author mnx

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

0 Kudos
Message 5 of 7
(2,757 Views)

So you did exactly what I told you to do.

0 Kudos
Message 6 of 7
(2,728 Views)

@dennis:Smiley WinkSmiley Winklol..Smiley LOL..to be honest yes i did...Smiley Very Happybut i also got this doc while browsing for the sameSmiley Happy..thank you!!Smiley Happy

0 Kudos
Message 7 of 7
(2,717 Views)