LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Software Triggering for Read & Write

Solved!
Go to solution

Hello,

 

My Goal: Generate a sine wave to output to a BNC-2110 channel (connected to a speaker), listen to the sound the speaker generates via 4 microphones (seperated by a known distance), and record the time difference (or phase difference) between each microphone. The timing here needs to be very precise, and I am having a bit of trouble issuing a trigger command.

 

What I would like to do is have the DAQmxRead start recording data and a short time afterwards (controllable) use DAQmxWrite start outputing the signal. This ensures I can see where the signal starts writing. I also want to make sure that the DAQmxRead continues to record slightly after (also controllable time delay) the DAQmxWrite finishes, to make sure I collect the entire signal.

 

Secondly, I'd like to make sure I'm not wasting my computer's resources by continually checking to see if the DAQmx signal has finished sending, and so I'm happy enough recording using the Finite Samples method. If i know how long the pulse is + my two time delays in the beginning and end, I can calculate the total recording time, and so finite samples is good enough. That should negate the need for a while loop? 

 

The process will look something like this:

 

Start Reading        --> Continue Reading --> Continue Reading --> Finish Reading -->  Output Data
Known Time Delay --> Start Writing        -->  Finish Writing

 

My main issue is that I do not know how to create a 'time dependent software based trigger event', nor do I know how to make sure each DAQmxWrite/Read is ready to start going before I send the trigger to them. Any suggestions?

0 Kudos
Message 1 of 3
(2,546 Views)

Attached is a copy of the VI that I currently have written. My problem now is that I cannot control the time delay between reading the signal and sending the signal, although I could calculate it. I find this program also runs very slowly - taking a second or two before the read/write starts. How could I speed this up?

0 Kudos
Message 2 of 3
(2,533 Views)
Solution
Accepted by topic author Kevin_D

Aha! The timing problem was in the Task. I had enabled Logging, and the default directory was not on my hard drive - I was continuously writing across the network! Works fine now.

0 Kudos
Message 3 of 3
(2,528 Views)