LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cDaQmx

Hi,

I want to extract one period of voltage signal (1/50 = 0.02 second )  from a device I am using cDAQ9188 and Voltage module NI-9242. 

Signal Information :

  • frequency: 50 HZ 
  • Voltage: 230 V 
  • Sampling frequency: 50 kHz (50000 HZ ) 

I want your opinion about the VI below.

 

Voltage .PNG

 

0 Kudos
Message 1 of 3
(1,924 Views)

Some thoughts:

  • You'll acquire for a full second with those constants (50kHz sample rate, 50000 samples acquired).
  • The loop will probably run twice (because on the first call, it doesn't give elapsed time > 0).
  • As a result of the first two points, you could 
    • Remove the While loop - you know how much you want to acquire
    • Set to Finite Samples, 0.02*50k (duration * rate = time)
    • Remove the unnecessary Elapsed Time and Stop button
  • Further, note that the "Export Data to Excel" will only export what is visible in your graph. If the scales are not what you need, the output will not be what you want. This can be a problem in some situations

GCentral
0 Kudos
Message 2 of 3
(1,894 Views)

@Emna20 wrote:

Hi,

I want to extract one period of voltage signal (1/50 = 0.02 second )  from a device I am using cDAQ9188 and Voltage module NI-9242. 

Signal Information :

  • frequency: 50 HZ 
  • Voltage: 230 V 
  • Sampling frequency: 50 kHz (50000 HZ ) 

I want your opinion about the VI below.


My opinion is you would benefit greatly by learning about DAQmx.  NI has a very nice series of Tutorials, plus there is LabVIEW Help and LabVIEW Examples.

  • To take one period of a signal when you know the acquisition time (0.02 sec) and acquisition frequency (50 kHz) means that you only need to take a finite number of samples (50,000 samples/sec * 0.02 sec = 1000 samples.
  • Use Finite Samples (instead of Continuous Sampling), and get rid of the While Loop.
  • Learn that the DAQmx Read function you are using is its own "Clock" -- it returns (and gives you the data) when the number of points you specify (here 1000) has been acquired.
  • You are acquiring the points as a Waveform.  Use LabVIEW File I/O functions to write the Waveform to a file.  Decide for yourself what File Format would be most convenient for use with further processing routines.
  • This means also understanding the virtues of the Waveform data type and why it is useful for hardware-sampled data.

Bob Schor

0 Kudos
Message 3 of 3
(1,873 Views)