I don't know what your fluid is, but I just looked up info on sonar which gives a propagation speed of nearly 1 mile/sec in water. That leaves you with <30 microseconds to traverse your 40 mm container.
Soooo...., I don't know if you can do your measurement with a 6034E. It's max sampling rate is 200 kHz or 5 microseconds/sample. I doubt that'll be enough resolution to reliably distinguish the varations in time-of-flight that you're after.
If you're stuck with the 6034E, you'll probably need to perform the measurement with one of its counters and then build a little external interface circuitry. There's several ways, here's one:
Use ctr0 to generate a single high pulse with a duration longer than your worst case time-of-flight. Use ctr0_out to switch on a transistor that allows your ultrasonic stimulus signal to get through to the speaker. ctr0_out should also be NAND'ed with a signal to be desribed in the next paragraph.
Run the mike signal into a comparator and let the comparator's output drive a latch. The idea is to produce a digital rising edge at the instant the mike first receives a significant signal, i.e., your stimulus. NAND this signal with ctr0_out and pass the result into ctr1_gate.
Configure ctr1 for event counting, set to count 'while gate is high'. (Under the newer DAQmx, the terminology is 'pause trigger.') Software select its source to be the internal 20 MHz timebase.
How it works:
Start ctr1 first, then ctr0. On the rising edge of ctr0's pulse, ctr1 will increment once every 50 nanoseconds (i.e., counting cycles of the 20 MHz internal clock). ctr1 will stop incrementing when the mike detects a sound level above the threshold you've set up in your circuit, driving the . The value of ctr1 multiplied by 50 nanoseconds is your time-of flight.
Then, software reset your counters, hardware reset the latch, change or manipulate your fluid, and try again.
There's very likely a simpler solution. Anyone?
-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).