09-23-2008 08:12 AM
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'
Solved! Go to Solution.
10-07-2008 03:31 AM
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,