LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Logic Analyzer, read data with LabView works CVI does not

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.

 

spy.data.quary.output3.JPG 

 

 

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

 

 

 

0 Kudos
Message 1 of 5
(4,205 Views)

 

 

**** message deleted****

Message Edited by muks on 09-09-2009 01:32 PM
0 Kudos
Message 2 of 5
(4,192 Views)

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.

Message Edited by Roberto Bozzolo on 09-09-2009 12:36 PM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 5
(4,184 Views)
Thank you Roberto, setting the options to display the entire buffer was what I was missing.
0 Kudos
Message 4 of 5
(4,160 Views)
You're welcome!


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(4,150 Views)