Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5565

viRead() always get VI_SUCCESS_MAX_CNT(3FFF0006) even though the buf is big enough

$
0
0

Hi ,

i am using NI-MAX 14.01, with its visa driver, i want to read 75000 bytes data from an agilent instrument via hislip. 

i have already allocated a 99999 bytes long buffer, suppose it is big enough to handle this data.

the code looks like:

 

unsigned char sendbuf[1000];

unsigned char recvBuffer[99999];

status = viOpenDefaultRM(&defaultRM);

status = viOpen(defaultRM, "TCPIP0::192.168.0.1::hislip1::INSTR", VI_NULL, VI_NULL, &instr);

sprintf_s(sendBuffer, "fetch:EVM?\n");
int len = _mbstrlen(sendBuffer); 

status = viWrite(instr, (ViBuf)sendBuffer, len, &count);  // this line can be executed successfully, and the instrument does truly received this command

status = viRead(instr, (ViBuf)recvBuffer, 99999, &count); //  but at this line, i always get 3FFF0006 (MAX_CNT) warning, and the output count is always ZERO. 

i think it does not makes, if the received data really exceeds the buffer, the output parameter "count" should not be ZERO. 

 

I also did the follwing tests

1. change the hislip to vxi-11. replace hislip1 with inst1. the code works very well,  the "count" is exactly 75000. the status = VI_SUCCESS.

2. use VISA-TEST pannel and send the same command to instrument. the VISA test pannel shows that status=VI_SUCCESS, but the output "count" is about 13000, not 75000 as i expected. 

3, I also use Agilent IO library suite 17 provided VISA driver. my test code can also work correctly. 

 

i don't know if i made any mistake in my test code. I do really appreciate for any suggestions correctons, and comments. 

thanks 

KEEHUA

 

 

 

 


Viewing all articles
Browse latest Browse all 5565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>