09-08-2009 02:50 PM
I am using the following logic analyzer: HP16500C with a 16557D in slot E (5).
I would like to use the SYSTEM:DATA? query command to read the data from the instrument using CVI. After writing the DATA command I try using the CVI read command for the 16500C. I try reading the buffer two times intending to read the transfer size with the first read and the data with the second read:
hp16500c_readInstrData(la1, 10, tmpRdBufferHeader, &retCnt);
hp16500c_readInstrData(la1, 31000, tmpRdBuffer, &retCnt);
I will be changing the 31000 to the value read from the first read. I am using 31000 in this example just to make the description a little more clear. Note the first read works as expected and I am able to extract the transfer data size. The second read stops populating the tmpRdBuffer after 11 byes of data. In the NISpy screen shot below, the GPIB bus show that all the data was transferred but tmpRdBuffer only contains "DATA " without the quotes. The following is a GPIB bus activity snapshot for the second read.
If I set up LabView to do the same read and I use the following command to read the data: HP1655xA Read Data/Setup.vi
With this labview command I get the same GPIB buffer as above and the output buffer also has the data. That is LabView will populate a read buffer without terminating.
1. Why would the LabView command read all of the data and the CVI command terminate before reading all the data into an output array?
2. Is there a setup command I need to add to CVI that will suspend the termination character until all the data is read? This is binary data and I want to read the block with out terminating.
I have tried setting VI_ATTR_TERMCHAR_EN attribute to VI_FALSE.
Regards,
Jeff Kirkpatrick
09-09-2009 03:01 AM - edited 09-09-2009 03:02 AM
**** message deleted****
09-09-2009 05:34 AM - edited 09-09-2009 05:36 AM
Which value does the read function return in retCnt? I suppose it returns the correct number of characters transferred (i.e. >10).
The reason you are seeing only the first 10 characters is the nul character in position 11 of the buffer, as can be read in NISpy screenshot (nul character is the string terminator in C). To read the entire message you must break program execution afre reading response from the instrument and either expand the string in the Variable window or double-click on it and select Options >> Display entire buffer in the string display.
09-09-2009 12:49 PM
09-09-2009 04:18 PM