NI Home > Community > NI Discussion Forums

Instrument Control (GPIB, Serial, VISA, IVI)

Reply
Knight of NI
Posts: 18,064
0 Kudos

Re: VISA Read


Man_Can wrote:

Thanks Dennis.

 

That means labview (VISA Read) accepts asciii as a default data types.


It does not. It reads bytes. You can interpret the bytes any way you need to based on the instrument you are communicating with. It uses a string since that's the most efficient way to store a sequence of bytes whose length you do not know ahead of time.

 


Is it like that, if I change the input data types to Int, Float, Signed Int then labview (VISA Read) gives me different 

I do not understand what this means, since I do not know what you are referring to. Change the input data types of what?

 

 

Also, please do not use text-speak like "m" and "n" to replace "am" and "and". This is a professional forum, not Facebook.

Member
Man_Can
Posts: 63
0 Kudos

Re: VISA Read

Thanks all for their support.

 

Sorry for the late reply and I apologize smercuio_fc for my language mistake.

 

After reading documents I understand that LabVIEW VISA accepts as well as returns the data in ASCII form. So 1 byte it reads as 2 character. I hope this is correct.

 

Thanks & Regards,

Manisha

Knight of NI
Posts: 18,064
0 Kudos

Re: VISA Read

NO! That is still not correct. One byte reads as one byte. Period. End of story. Stop thinking about characters, and think about bytes only. The character "A" is represented in ASCII as the decimal 65. That's one byte. Thus, if you read one byte from VISA Read and its value is 65, then you could intrepret it as the character "A". Or, it could also simply mean a byte value of 65, which could correspond to a specific command code (i.e., command code of 64 = read voltage; command code of 65 = read current). It all depends on the device you are talking to.