09-24-2021 02:43 AM
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.)
09-24-2021 03:52 AM
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.
09-24-2021 04:41 AM
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.
09-24-2021 06:40 AM
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.
09-24-2021 07:14 AM
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:
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…
09-24-2021 07:32 AM
<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
09-24-2021 11:17 PM
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.