Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read

Hellooo Everyone,

 

I have one basic question related to VISA Read function. After sending a querry to my unit I received one byte (U8) as 01, but in the property node of bytes at ports it shows the number of bytes as two. Why is it so??? Why it is taking 0 & 1 as seperate byte?

 

Thanks & Regards,

Manisha

 

0 Kudos
Message 1 of 13
(3,421 Views)

What is your "unit"? Are you sure the "unit" (whatever it is) is sending binary data, or is it sending characters. I.e., is it sending the value 0x01, or is it sending the characters "0", and then the character "1"? Or, perhaps your "unit" (whatever it is) is adding, for example, a linefeed character. Or, perhaps your "unit" (whatever it is) is adding some other termination character. Or...

 

Without more information we cannot answer your question.

0 Kudos
Message 2 of 13
(3,416 Views)

Manisha,

 

Without seeing your code I cannot be sure.  Several possibilites exist. The device may have sent more bytes after the read. The device may have sent a termination character which Bytes at Port counted but which the Read stripped off. The device may have sent two bytes but your program is only configured to read one.  Does the Bytes at Port execute before or after the Read?

 

Lynn

0 Kudos
Message 3 of 13
(3,416 Views)

Thanks Smercurio_fc & Johnsoldfor your reply.

 

Am developing a front end for "load cell amplifier". After sending querry to this unit it reads a 6 bytes data. This data is in 0x00 form not in character data types. M attaching the image of output on hyper as well as my code. My actual problem is, I want to calculate CRC for the same data. In the attached VI I have explain that problem also. M getting two different output for CRC, one is in normal form & other is in HEX form. Please see the code n help me out with the same.

 

Thanks & Regards,

Manisha

0 Kudos
Message 4 of 13
(3,400 Views)

So, are you asking a different question now? I'm confused as to which issue is being addressed here.

 

How are you running your program? Please don't say you're using the Run Continuously button. If so, STOP. That is NOT intended for normal operation. Use a loop. Put the VISA Configure outside the loop, your write/read/parse inside the loop, and your close outside the loop.

0 Kudos
Message 5 of 13
(3,390 Views)

Hello smercurio_fc,

 

M not asking a new question now. But problem of CRC calculation is because of this bytes counts thats why I asked that. This is just a part of project n m not using run continuously. The attached VI was only a sample code for CRC calculation. I just want why that 01 is treated as two bytes? What is the form of output in VISA Read?

 

Thanks & Regards,

Manisha

0 Kudos
Message 6 of 13
(3,375 Views)
If you have your string indicator set for hex display, then 01 is one byte. You've been told why the number of bytes read could be one more. Make sure you have the termination character disabled in the VISA Configure Serial Port.
0 Kudos
Message 7 of 13
(3,370 Views)

The string is in Normal display form not in Hex n I have already mentioned that m not using any termination character. It is 01 only i.e. one byte and reading two bytes at port.

0 Kudos
Message 8 of 13
(3,366 Views)
If the display is in normal mode, then the 01 you see is 2 bytes. As already mentioned, it is the ASCII character 0 and the character 1.
0 Kudos
Message 9 of 13
(3,364 Views)

Thanks Dennis.

 

That means labview (VISA Read) accepts asciii as a default data types. Is it like that, if I change the input data types to Int, Float, Signed Int then labview (VISA Read) gives me different 

0 Kudos
Message 10 of 13
(3,361 Views)