Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Finite Voltage Acquisition Update on Front Panel

Solved!
Go to solution

I have this simple motor driver program that communicates with a stepper motor controller. I need to now combine this vi with one that acquires a finite number of voltage data points. I found a finite voltage example that works with my daq (usb 6009). I was thinking another stacked sequence in a for-loop would work to record voltages, drive motor, record more voltages, etc. for a desired number of repeated times.

 

I would like to be able to view the voltages on the front panel as I am recording them. Is there a simple way to do this when requiring a finite number of voltages? I am using finite because I only need say 10 seconds of data at each motor position and setting the number of samples with rate is a simple way to set the timing.

 

The examples I have seen update the voltages using a while loop. If i do this then the while loop keeps going until the user stops it.

 

Thanks very much. The 2 vi's I am working with are attached.

 

BTW I am a mechanical engineering graduate student.

 

 

 

Download All
0 Kudos
Message 1 of 5
(2,908 Views)

Hi lfgrdwill,

 

The best programming option to take in your situtation will depend on how frequently you need to sample.  For fast data acquisition, it isn't necessary to update the front panel for every point as the change will happen so quickly you will not be able to see it anyway.  I have attached a couple of screenshots with a few comments that displays a couple of options.  

 

The first uses hardware timed finite acquisition, much like you were considering.  With finite acquisition, by default the DAQmx Read will only output when the full number of samples to be read are in the hardware buffer.  However, you can specify fewer samples and place the read in a loop as I have done to update more often.

 

FiniteAcquisition.PNG

 

The second option uses software to time when a sample is taken.  You'll see that it only gathers one sample each time the loop is executed and at the rate I specified with the 'Wait Until Next ms Multiple' timer.  

SinglePoint.PNG

I hope this will at least give you some direction!

 

 

 

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 2 of 5
(2,892 Views)

Cole,

 

Thanks very much. Couple questions:

 

What is the difference between using the waveform data type and the double data type? Right now this data is output as double and then converted automatically for use with the Write to Measurement File Express VI.

 

The top solution using finite samples will write to a spreadsheet file the full number of samples at the sample rate, both input to the sample clock, correct?

 

I have four differential analog channels, so I would need 4 different charts, or maybe just numeric indicators would suffice. Do you have a recommened front panel numeric display to use instead of a chart?

 

Thanks very much. Even though my program is running real-time display would be awesome.

0 Kudos
Message 3 of 5
(2,886 Views)
Solution
Accepted by lfgrdwill

Hi,

 

Check out this link on the waveform data type.

 

http://digital.ni.com/public.nsf/allkb/B965F316364DE17B862572DF00363B10

 

The Write to Measurement File Express VI will likely work as long as the sample rate and, consequentially, loop rate is not too high.  This is because the Write to Measurement File, while convenient, contains quite a bit of overhead.  If you want to display multiple channels, you can either merge the signals and display them on one chart, or use multiple.  That will be up to you.  

 

The best indicator to use will depend on what data you want to display.  The waveform chart is going to be the most comprehensive, but since you are getting the samples back as an array of type double, you can array indicators, or pull points out of the array and use numeric indicators as well.   

 

 

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 4 of 5
(2,880 Views)

Cole,

 

I appreciate your help. Thank you.

0 Kudos
Message 5 of 5
(2,866 Views)