LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggered Plotting and Holding of Results

Hello.
 
I am using 7.1 and a 6071E card.
 
I am reading and continuosly plotting 3 voltage signals.
I have a digital input to the card from an external trigger signal.
I would like to use this trigger signal, when activated, to display a certain number of pre trigger samples, and post trigger samples, and hold the plots in a different display (or window) to the continuous display. Possibily export the data to excel also.
 
I was looking at the Acq&Graph Voltage-Int Clk-Dig Ref.vi in the examples, and trying to incorporate this.
I was planning on using the pf0 input as a trigger.
(Will this input trigger when a constant 5Ddc is applied?)
 
I kinda know what I am doing, but I would like a few pointers in the right direction.
 
Many Thanks
 
Regards
 
Tom
0 Kudos
Message 1 of 30
(3,292 Views)
Let me put it another way.
 
What is the most efficient way of switching between contuous and finite sampling of the same channel?
 
Thanks
0 Kudos
Message 2 of 30
(3,267 Views)
Hi Tom,
 
I'm not quite sure what you are trying to do.
Could you be a little more specific please?
 
With a triggered input, you can configure the trigger to perform one of a number of functions.
Start, stop, pause an acquisition when an edge is detected or use an external trigger to pulse a single point acquisition (when a rising edge is detected a single value is read from the card.
 
It might be worth looking at the LabVIEW help files (Help >> Search the LabVIEW Help/ select the Index tab and type in "triggering".
This will give you a bit more information as to how triggers are read by LabVIEW.

As for the 5Vdc signal, this will not trigger the input.  However you can set up (using a property node on a trigger signal reference) a pause trigger, that will pause an acquisition when the the input is set to a certain state (high or Low)
Again it might be worth looking at that help file for more information
 
Hope this helps.
Feel free to post backj if you need some more information
 
AdamB - NIUK & Ireland
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 3 of 30
(3,245 Views)

Hello Adam.

Thanks for the reply.

The main difficulty I am having is trying to switch between a continuous display of input samples, and a finite number of samples (pre and post) when triggered by an external reference. I am not sure how to switch between the two.
 
I have charts constantly plotting the input samples I need.
 
Perhaps I can use some sort of graph and configure it display a certain number of samples, and hold the plot?
 
I would also like to holds the plot of the triggered samples in a seperate window to the continuous plots.
 
I am stuggling with this at the moment.
 
 
 
Best wishes
 
Tom
 
 
 
0 Kudos
Message 4 of 30
(3,248 Views)

Hello.

I have found the trigger and gate block.

If I can change the trigger from channel 0, to another channel which is triggered by an event, would this work?

 

Thanks

0 Kudos
Message 5 of 30
(3,220 Views)
Hi Tom,
 
The only way to do this really is not to confuse the aquisition with the plotting.  You need all of the data, all of time.  If you use a trigger with post and pre aquisition, you will only get that data.  The other data will not be read by the card.
Therefore I would reccomend that you set up 2 aquisition tasks.
The first is aquiring the analog data, the second the digital data.
 
Store all of the data that you are aquiring into an array (or write it to disk).  Then, when you detect a change in the digital input, timestamp that data, and use that timestamp to reference the analog data, and "pull out" the previous 200 samples and the next 200 samples.
 
This negates the problem with triggering, instead you are simple referencing the inputs.  (you need to set up the polymorphic vi's to read out Waveform data as this will timestamp your data for you)
 
Does this shed some light on the situation?
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 6 of 30
(3,218 Views)

Hello Adam.

 

That will perform the desired functionality.

I am not sure that I know how to do any of it though, Lol. I am new to Labview.

I will look through the help files now, and brush up on the items you have mentioned.

 

Thanks again for the device, its greatly appreciated.

0 Kudos
Message 7 of 30
(3,211 Views)
Another way, similar to what AdamB suggested, is to record your trigger signal on another analog input channel. Then the data related to the trigger can be found by using the Threshold Array function. The array index found by the threshold operation is the trigger time reference for all the analog channels. Subtract the number of pretrigger samples to get the start_of_plot index. I did exactly this back in LV5 for a stimulus-response experiment with conditional triggering. The program is still being used, but I do not have any simple examples to post.

Lynn
0 Kudos
Message 8 of 30
(3,206 Views)

Hi Lynn.

I have found the block, but I am not sure how to use it.I am using another analogue channel ai3 as a trigger.

I cant follow how to use the threshold trigger.

Regards

Tom

 


 


 

 

 

0 Kudos
Message 9 of 30
(3,202 Views)
Tom,

I located my old program and found a subVI which shows what I was talking about. I modified it slightly to make it more general purpose. Notice that I have created a threshold subVI which will look for either a positive or negative slope, which the Threshold Array function will not. Each channel is in a separate column of the Data in array. You can select the trigger channel, slope, and threshold. I have not tested this revised version, but the original has been working well for years. Modify to meet your needs.

Lynn
0 Kudos
Message 10 of 30
(3,195 Views)