Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

0 views
Skip to first unread message

Duuce

unread,
Aug 13, 2008, 1:40:21 AM8/13/08
to
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. 


Unique Serial READ WRITE.vi:
http://forums.ni.com/attachments/ni/170/348873/1/Unique Serial READ WRITE.vi

muks

unread,
Aug 13, 2008, 2:40:06 AM8/13/08
to

muks

unread,
Aug 13, 2008, 2:40:07 AM8/13/08
to

Duuce

unread,
Aug 13, 2008, 12:10:06 PM8/13/08
to
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).


Unique Serial READ WRITE LV8.vi:
http://forums.ni.com/ni/attachments/ni/170/349015/1/Unique Serial READ WRITE LV8.vi

muks

unread,
Aug 14, 2008, 4:10:09 AM8/14/08
to
<img src="http://forums.ni.com/ni/attachments/ni/170/349223/1/save.PNG" border="0">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


save.PNG:
http://forums.ni.com/ni/attachments/ni/170/349223/1/save.PNG

Duuce

unread,
Aug 15, 2008, 1:10:10 PM8/15/08
to
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:&nbsp;000102......1F &nbsp;Any help is greatly appreciated.


Unique Serial READ WRITE LV8.vi:

http://forums.ni.com/ni/attachments/ni/170/349666/1/Unique Serial READ WRITE LV8.vi

Dennis Knutson

unread,
Aug 15, 2008, 2:40:05 PM8/15/08
to
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.&nbsp;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.


Save Data as Hex.PNG:
http://forums.ni.com/ni/attachments/ni/170/349686/1/Save Data as Hex.PNG

0 new messages