LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading serial strings from the serial port and saving to a text file in Hexidecimal form.

I am able to send 32 uniques binary bytes as a string (not ASCII) via the serial port but I am unable to Read the binary string from the serial port and store the string as hexidecimal values in a text file? For example, I can generate a binary string (0000111100001111), but how can I store it as a hexidecimal value in a text file with a carriage return so the format is:
 
0F
0F
 
Attached is my code so far. 
0 Kudos
Message 1 of 11
(3,829 Views)





Message Edited by muks on 08-13-2008 01:34 AM
Download All
Message 2 of 11
(3,822 Views)


Message Edited by muks on 08-13-2008 01:36 AM
Message 3 of 11
(3,811 Views)
Can you post your code for lv 8.0?
0 Kudos
Message 4 of 11
(3,807 Views)

I've attached my code in LabVIEW 8.0 and added some notes in the code to better explain my application. Keep in mind, it is sending and recieving on the same serial port (simple loopback test).

0 Kudos
Message 5 of 11
(3,780 Views)
Did my above explanation help u?
Message 6 of 11
(3,753 Views)
The vi u attached is not for 8.0 it is for 8.5.
Message Edited by muks on 08-14-2008 02:44 AM
Message 7 of 11
(3,752 Views)

I tried saving this vi in 8.0 again. Please verify if it is correct. Nothing has worked so far. I would just like to capture a string of binary values (32 bytes) from the serial port, convert and store them as hexidecimal characters in a text file. So, a string read from the serial port (00000000000000010000001000000011.......00011111) would look like the following when stored as a text file:

 

000102......1F

 

Any help is greatly appreciated.

0 Kudos
Message 8 of 11
(3,721 Views)

You haven't posted anything that you have tried so far but try the code that is in the image below. I'm sure that there is several other ways to do this.

 

Please not that you are not able to view the received data as binary. If you create a string indicator on the VISA Read, right click on it and select Hex Display.

Message 9 of 11
(3,708 Views)
You have not tried much.So Let us know If any of our above suggestions helped.
Message Edited by muks on 08-18-2008 04:57 AM
Message 10 of 11
(3,659 Views)