How To Use One Channel To Trigger Another in NI-SCOPE

Updated Jun 27, 2023

Reported In

Hardware

  • PXI Oscilloscope

Software

  • LabVIEW

Driver

  • NI-SCOPE

Issue Details

How to use channel0 to trigger channel1 to acquire signal with PXI Oscilloscope like PXIe-5122. There is such feature in Soft Front Panel. How can I make it with LabVIEW program?
 

Solution

You are not able to use NI-SCOPE API to configure trigger to realize such feature. Since the API configures reference trigger which is different from acquisition trigger. To realize such feature, you need to do some logic programming. The block diagram is shown below.



1. Open a session to the digitizer.
2. Configure the vertical parameters such as input range, offset and coupling.
3. Configure the sample rate.
4. Configure a software reference trigger, which will never be sent, so as to acquire data continuously.
5. Configure the digitizer to fetch relative to the current read pointer and configure the number of samples per fetch.
6a. Initiate the detecting of trigger signal.
6b. Detect the trigger signal.
6c. Check if the fetched signal is higher than the threshold. If so, it tells the trigger has arrived.
6d. Abort the trigger detecting task.
7. Initiate the acquisition of signal waveform.
8. Check the Fetch Backlog to determine if the Sample Per Fetch has been acquired.
9. Fetch the requested number of samples with the niScope Fetch Binary 16 VI.
10. Check if the Total Samples to Acquire have been fetched, and stop the loop.
11. Close the session to the digitizer.
12. Merge and handle errors.

From the block diagram, you can see that the program uses channel0 to fetch trigger signal. When the trigger signal's amplitude is higher than a threshold, it stops channel0 and starts channel1 to fetch signal waveform. 

Additional Information

The NI-SCOPE trigger functions in the functions palette are all reference triggers which do not tell the digitizer to start acquiring samples. Rather, it tells the digitizer to fetch a certain number of a pre-trigger samples from the onboard buffer of the digitizer. As a result, by default the digitizer begins acquiring once the digitizer initiated an it stops as acquisition when the reference trigger is received.