LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Input data by Trigger, but some data before and some after the trigger

Solved!
Go to solution

Hello everyone!🖐

 

Equipment and SW:

  1. LavView 2021;
  2. DAQmx driver;
  3. ADC NI USB 6212

I have a goal to acquire analog input data, bit it must start read data by trigger impulse. And by the trigger i want read some data before and after it. I created VI where i use DAQmx blocks:

  1. For AI signal:
    • Virtual Channel;
    • Timing;
    • Start Task
    • Read
    • Clear Task
  2. For trigger
    • Triggering

 Also I used Property Nodes for:

  1. Timing
    • SampMode (idk really i need it btw);
    • SampPerChan (in docs this property uses in Trigger property "PretrigSamples");
  2. Trigger
    • PretrigSamples

 

For example I put params Samples, Rate And PretrigSamples 100000, 200000 and 5000 respectively, and when I give trig impulse I get some chart. But if i change PretrigSamp to 10000, the chart doesn't any change

 

Pls, could yall help me and explain how to work with samples and rate and etc in LabView

 

0 Kudos
Message 1 of 4
(826 Views)

Can you please save your example as 2019 or earlier.

0 Kudos
Message 2 of 4
(757 Views)

I was able to open this VI, which was difficult to read because the Original Poster had turned off "View as Icon", which really messes up the view on the Block Diagram.  I turned View as Icon back on and tried to arrange the wires in an Easy-to-View order, which I'm posting here as a 2019 VI Snippet, and also attaching.  I've not actually done pre-triggering, so I'll defer to those who have used this feature.

 

Bob Schor

AI sync BS 2019.png

 

0 Kudos
Message 3 of 4
(723 Views)
Solution
Accepted by mrBelyash

Don’t have LabVIEW on this iPad, but will assume @Bob_Schor’s snippet is correct.

 

I believe you are using the wrong trigger type; you need to use a reference trigger. See the following link for suggestions 

 

https://www.ni.com/en/support/documentation/supplemental/21/ni-daqmx-data-acquisition-triggering-tec...

Message 4 of 4
(712 Views)