Discussion:
Read in Binary form in VISA read function
(too old to reply)
ritesh024
2008-08-12 04:10:06 UTC
Permalink
Dear All, I have connected my Device to the serial Port. and data read from the buffer is stored in text format. I want to view the data in binary format .Actually, i have performed the same function in Visual Basic. there also if i view the data in text format, it shows some junk values. but if i view the data in binary, it shows the actual data coming from the instrument .I dont know how to modify the VISA read function. can any one pls tell me how can i read the data in binary format?ThanksRitesh
MikeS81
2008-08-12 06:40:08 UTC
Permalink
Hi Ritesh,
what do you mean. If you read your data it should be in binary format. Where is the difference between binary and text for you?
Mike
smercurio_fc
2008-08-12 16:10:06 UTC
Permalink
You need to typecast the string to your appropriate data. For instance, if you want to see it as individual bytes then you can use the String to Byte Array function. If your data consists of something larger, like 16-bit integers, then use the TypeCast function. <img src="Loading Image..."> Message Edited by smercurio_fc on 08-12-2008 10:45 AM


Example_VI_BD6.png:
http://forums.ni.com/attachments/ni/170/348677/1/Example_VI_BD6.png
Continue reading on narkive:
Loading...