On this shock-tube setup, comparing only the newest array value may reduce unnecessary processing, but a LabVIEW polling loop cannot guarantee a prompt, repeatable camera trigger. Changing the comparison or adding an output write does not remove acquisition, loop, operating-system, and output-update delays. The pressure sensor can produce up to 10 V, while the camera expects a 5 V TTL trigger, so do not connect the sensor directly to the camera without confirming electrical compatibility.
Why do the usual software fixes fail to guarantee the trigger?
Reading the latest value instead of comparing the whole array is a useful code correction, not a timing solution. A loop still has to wait for input samples, read them, execute the comparison, and update an output. If the acquisition returns blocks of samples, the latest point may already be old when the loop handles it; checking only that point can also miss a brief threshold crossing elsewhere in the block.
Adding a digital-output write to the existing loop has the same limitation: it asks software to detect the event and then command hardware. A PC-based software response can take milliseconds and vary between attempts. That may work when the timing allowance is generous, but it is a poor choice when the camera must start at a precise time relative to the shock. A Task configured for hardware triggering is not automatically a solution either: the cDAQ-9185, NI-9222, and the output module must support the required trigger source and routing.
Continuous camera acquisition with a rolling frame history can avoid relying on a fast trigger, if the camera supports that mode and retaining extra frames is acceptable. It does not meet experiments that require a precise trigger or cannot tolerate many unwanted frames. The electronic valve also does not provide a dependable advance trigger: the time from valve actuation to diaphragm rupture is unpredictable.
What timing does the shock-wave location allow?
Use the expected shock speed and the distance from the pressure measurement point to the test section to calculate the available lead time. The reported speed is approximately 500 m/s. A sensor at the 4 m mark detects the shock at the test section rather than providing that travel-time lead.
These are shock-travel estimates, not guarantees of camera response time. The usable margin also depends on sensor response, acquisition timing, detection threshold, signal conditioning, output-module update, trigger wiring, and camera trigger latency. Measure the actual sensor-to-camera timing and compare the total with the experiment’s allowed error. For perspective, 100,000 frames per second corresponds to 10 microseconds between frames; that frame interval does not prove the camera will respond to an external trigger within 10 microseconds.
Which part of the signal chain should be measured?
Follow the signal from pressure to camera: pressure transducer voltage, NI-9222 input acquisition, threshold detection, output-module signal, then camera trigger input. A wrong value or delay at any stage changes the result. Measure the transducer waveform and trigger output with suitable instrumentation; record the delay between the pressure threshold crossing and the electrical edge at the camera input.
| Signal | Source | Wrong-value or timing symptom |
|---|---|---|
| Pressure-sensor voltage | Transducer connected to NI-9222 | Threshold never occurs, occurs too early, or is confused by noise or offset. |
| Acquired pressure samples | NI-9222 through cDAQ-9185 acquisition | Detected crossing lags the physical event, or a brief crossing is missed between processed values. |
| Trigger command | LabVIEW logic or supported hardware trigger path | Output edge varies in time or does not occur when the threshold is crossed. |
| Camera trigger input | Output module and trigger wiring | Camera does not accept the level, polarity, pulse, or timing presented. |
The sensor’s stated output can reach 10 V; that does not establish the NI-9222 input range for the selected configuration or the camera’s permitted trigger levels. Check both devices’ specifications and measure the signal before connecting or applying it. If the sensor voltage exceeds the camera’s trigger-input limits, use an appropriate signal-conditioning or switching interface selected for the actual voltage, polarity, and input requirements.
How should the LabVIEW loop process the pressure samples?
First determine the acquisition mode and the number of samples returned per read. In a software-detection design, configure acquisition so the loop reads newly available samples rather than repeatedly comparing the entire accumulated history. Compare every new sample against the threshold; using only the last element is valid only when the read contains one relevant new sample or when the acquisition guarantees that no crossing in the preceding samples can be skipped.
- Choose a threshold from measured baseline and shock-wave traces, accounting for sensor offset, noise, and the sensor’s response. Do not choose an arbitrary threshold from the sensor’s maximum output.
- Read newly acquired samples and evaluate them in chronological order. Detect the first qualifying crossing, not merely whether a later value remains above the threshold.
- Latch the detection so the program issues one camera-trigger command per event. Define how the latch resets before another test.
- Record sample timing and the detected crossing, then command the configured output module only after confirming its electrical compatibility and software support.
A DAQ Assistant Express VI can help configure acquisition or output tasks, but it does not make a software loop deterministic. The correct configuration depends on the specific output module and the required trigger route. Do not select a DAQ Assistant option based only on its label; confirm that the module supports the requested output operation and timing mode.
When is a hardware trigger the better detection path?
When the required response is faster or more repeatable than the PC loop can deliver, move threshold detection and trigger generation into supported hardware. Depending on the installed modules, that may mean a hardware analog-trigger capability or a separate signal-conditioning circuit that converts the transducer event into a camera-compatible trigger. The evidence identifies the NI-9222 as the pressure input module, but the output hardware is not identified; therefore, the exact hardware-trigger route and LabVIEW configuration cannot be selected until that module is known.
Check the specific module and chassis documentation for analog-trigger capability, digital output behavior, trigger terminals, routing, and supported acquisition/output combinations. A chassis trigger terminal or an output task configured to wait for a trigger only helps if the actual signal can reach that route and the module supports the needed behavior. Confirm the complete route in the installed hardware documentation and test it independently of the shock experiment.
If using an external interface, choose it for the measured transducer signal and the camera’s specified TTL input requirements. A switching device such as a MOSFET may be part of a suitable circuit, but component selection and wiring depend on the sensor output, load, common reference, polarity, and required pulse. Do not infer those details from the phrase “5 V TTL.”
How can the trigger be tested before a shock experiment?
Verify the output stage first, with the camera trigger disconnected or safely isolated as appropriate. Use the output module’s supported test method to confirm that the commanded state produces the intended electrical edge and level. Then test the sensor-to-detection path with a known input or recorded waveform, followed by a complete end-to-end test. Avoid a test configuration that leaves a loop running without a defined stop or reset condition.
- Measure the pressure-sensor output during baseline conditions and during a representative pressure event; establish the threshold and polarity from the trace.
- Check that the acquired samples show the crossing at the expected point and that the code detects it once, including when a read contains multiple samples.
- Measure the output edge at the camera end of the wiring. Compare its level and polarity with the camera’s documented trigger requirements.
- Measure event-to-output and output-to-camera response over repeated tests. Compare the delay and variation with the experiment’s timing allowance; change to hardware detection if software timing fails that requirement.
What information is needed before selecting the output configuration?
Identify the output module model, its supported output modes, and its connection to the cDAQ-9185. Also obtain the camera’s external-trigger electrical and timing requirements, the sensor’s measured waveform and output characteristics, and the required maximum delay and repeatability. Those details decide whether software thresholding is adequate, whether a hardware trigger route exists, and what interface is needed between the sensor and camera.
Do not write final output code or wire the sensor to the camera until the output hardware and trigger electrical limits are confirmed. If the output module cannot be identified, stop at acquisition and isolated signal measurements; do not assume another module’s DAQ Assistant options or terminal routing apply.
Frequently asked questions
How do I compare only the latest pressure sample in LabVIEW?
Read newly available samples and compare the newest value only when the read returns one relevant sample and cannot skip a threshold crossing. If a read returns multiple samples, inspect each new sample in order so a brief event is not missed.
How much time is available before the shock reaches the test section?
Use the actual sensor-to-section distance and measured timing for the installation.
How do I trigger a 5 V camera input from a pressure sensor?
Confirm the camera’s permitted trigger voltage, polarity, and pulse requirements, then verify the sensor and output-module electrical limits. Use a compatible hardware output or signal-conditioning interface; a sensor that can produce up to 10 V is not automatically safe to connect directly to a 5 V TTL input.
Stop and escalate to National Instruments support when the installed module documentation does not identify a supported trigger route or when the DAQ task cannot produce the required timing. Contact the camera manufacturer through its official support channel if trigger-level limits or input timing are unclear.