LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I/O command formatting/logistics? Or alternate solutions to limited driver options?

Hello,

I'm somewhat inexperienced with labwindows, so explanations that start at a simple level are very appreciated.

 

Description of what I'm working on: I'm currently trying to update a program that runs multiple waveform acquisitions on a Rigol DS1202Z-E oscilloscope, stores the data in an array, averages successive arrays, and saves the averaged waveform to a .txt file. I did not write the original code and the oscilloscope is a different brand than the previous version (Tektronix TDS 1001B). The labwindows version I am using is 2020.

 

Big picture issue: A significant portion of the data is lost when reading the waveform from the oscilloscope. The scope will save a maximum of 1,200 data points from the waveform, though the scope reads a minimum of 6,000 data points with each acquisition. I've determined this is a result of the waveform mode the scope is in. When in normal mode, data acquisition is capped at 1,200 points whereas the limit in raw mode is set by the memory depth (which should provide 6,000 to 12,000,000 data points). The extra data points are accessible through other means, such as saving via usb but it doesn't appear that there is any option to access these using the scope driver.  I have looked through the driver .c file and cannot find an option to put the scope in raw mode (though I have found normal mode). I can only get 1,200 points out of the manufacturer usb interface (UltraScope).

 

Specific issue: I can acquire and save the extra data points via I/O commands in the scope interface from the manufacturer and in NI-MAX in the VISA test panel. If relevant, the commands are :WAV:MODE RAW, :WAV:FORM ASCii, :WAV:STAR 1, :WAV:STOP 6000, :WAV:DATA?.

It seems that the command viVxiCommandQuery will work for inputting these commands? However when I test this command with this line

viVxiCommandQuery("USB0::0x1AB1::0x0517::DS1ZE251605342::INSTR",VI_VXI_CMD16, ":RUN", VI_NULL);

I receive an error saying "The given session or object reference is invalid". I have also tried using the session handle from calling the driver

viVxiCommandQuery(rgds1kz,VI_VXI_CMD16, ":RUN", VI_NULL);

As well as putting it in quotes, using simply "USB0", etc. with the same error.

 

Specific Questions:

  • Is it possible to use these I/O commands while also using the instrument driver for other aspects of data acquisition? Or is this a dumb solution?
  • If it is possible, how do I run the I/O commands so that it can communicate properly with the oscilloscope? I read something about driver handles not being the same with drivers vs I/O communication but am not sure how to make an I/O specific handle. 
  • Are there any major issues with how I am attempting to handle this problem and/or more elegant solutions?

Thanks!

 

0 Kudos
Message 1 of 1
(77 Views)