LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Take data points within a specified time period using a data acquisition card

Hi guys, I'd like to ask a question concerning DAQ usb6343. Background: I have two signals, one of which is a 400 Hz sine wave and the other of which is a square wave, and I want to record the sine wave's waveform data in the high level of the square wave. Is there anyone who knows how to do it? (The data is collected and the horizontal coordinate corresponds to the high-level length of the square wave.)

0 Kudos
Message 1 of 7
(1,076 Views)

You mean something like the attached VI? (LV2019) You can use it to get the From-To coordinate pairs of a square wave high levels based on a threshold and "cut" the corresponding sections out of the sine wave accordingly.

"Good judgment comes from experience; experience comes from bad judgment." Frederick Brooks
0 Kudos
Message 2 of 7
(1,062 Views)

Your main idea is correct, however, what I'm looking for is: the signal gets saved from DAQ to the local computer, but only the high part is saved; the rest of the signal jumps out of memory automatically. I still have a long way to go with your example before I can implement data collection and storage.

0 Kudos
Message 3 of 7
(1,050 Views)

Here is a VI with the sine wave cutouts. You'd have to add the data acquisition itself, the storing to whatever file format you fancy and the buffering of the signals as you continuously process the data, but in principle this is what you described.

"Good judgment comes from experience; experience comes from bad judgment." Frederick Brooks
0 Kudos
Message 4 of 7
(1,031 Views)

Hi hblin,

 


@hblin94 wrote:

Your main idea is correct, however, what I'm looking for is: the signal gets saved from DAQ to the local computer, but only the high part is saved; the rest of the signal jumps out of memory automatically.


You might use the counters of your DAQ board:

  • use a counter to generate the sampleclock for your AI task
  • use a digital input as a gate for that "sampleclock counter output"…

I'm not an expert in the counter output features of NI's DAQ boards, so you might check the example VIs coming with LabVIEW/DAQmx! Maybe the experts on this matter will contribute…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(1,020 Views)

<Lurch>

    You rang?

</Lurch>

 

GerdW's counter suggestion would work if the square wave is 5V digital logic, but there'd be an even easier way too.  Just configure the AI task itself to use the digital signal as a Pause Trigger, configured to pause while low.

 

Else, the code from Dobrinov looks like a good starting point if you need to capture the square wave as a 2nd AI channel and then apply post-processing to choose what to retain and reject.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 6 of 7
(1,014 Views)

The program you provided comes close to achieving the desired functionality. The program does, however, have several issues. To begin with, the point it intercepts is not a high point, but rather the junction of a straight line and a square wave at the threshold setting. Second, the data is going to drift. Could you please make some changes? The attached graph displays the detailed results.

0 Kudos
Message 7 of 7
(990 Views)