LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between VI_SUCCESS_MAX_CNT and VI_SUCCESS

Solved!
Go to solution

Hello,

 

I use visa with a serial port.

 

When I use viread, sometimes I have success status of  VI_SUCCESS and sometimes VI_SUCCESS_MAX_CNT.

 

But I can't figure out the circumstances which gives one rather the other : to me, a successfull call necessarily implies VI_SUCCESS_MAX_CNT.

I also get VI_SUCCESS even if unsuccessful.

 

Open the attached capture.spy with nispy.

If you take a look at the third (starting from the bottom) line I ask for 7 bytes, get 2 and VI_SUCCESS !!!

What can lead the function to be successfull even if count bytes have not been read ?

On the next line, I ask for 5 bytes, get 5 and VI_SUCCESS_MAX_CNT which is correct.

 

Can someone explain me this ?

 

Regards

 

Jolaf'

0 Kudos
Message 1 of 2
(4,718 Views)
Solution
Accepted by topic author Jolaf

Hi Jolaf,

 

Each time you request N bytes and you get N bytes in return, you get VI_SUCCESS_MAX_CN. However if you request N bytes and you get lower number of bytes you will get a  VI_SUCCESS. The purpose is : If you ask N and receive N you might have others byte that you should request for. This could imply to call for byte at port left. However, if you ask for N and receive lower, this induce that all bytes available at this moment has been read.

 

Regards,

Alexandre M. | Certified LabVIEW Developer
Embedded and Control Systems Engineer (NI France)
0 Kudos
Message 2 of 2
(4,656 Views)