LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help to develop a Trigger for an analog voltage signal

Solved!
Go to solution

Hello guys,

 

I have a real problem designing a trigger for an application, what I'm doing is to power up a motor actuator and measure the current and voltage consumption during every actuation. What I would like to do is to start acquiring the signal once the voltage rises to a certain value and finish it when it falls to another certain value. The hardware that I'm using is a cDAQ 9178 with a NI9205 and 9221 modules.

Any help / samples / detailed explanation on this matter will be truly appreciated. I have no idea on how to work with the triggering vi's in Labview.

 

Regards

 

SergeArmz

0 Kudos
Message 1 of 11
(3,211 Views)

I am not familiar with your devices to know what triggering capabilities they have.  Another option might be to do continuous acquisition and then extract in software the data segments which meet the rising and falling criteria.  This has the advantage that you can do some signal processing such as filtering or smoothing if necessary to deal with noise or interference in the signals.

 

Lynn

0 Kudos
Message 2 of 11
(3,199 Views)

Hello johnsold,

 

Thanks for your response, I'm afraid that you are right regarding to the capabilities on my devices to trigger certain signals, however I'm interested on your second satement  "Another option might be to do continuous acquisition and then extract in software the data segments which meet the rising and falling criteria", I would like to know how you will do that.

 

I attached a screen shot of the plot I've been acquiring and where would like to have the start and ending points

 

Thanks again for your valuable help

 

SergeArmz

0 Kudos
Message 3 of 11
(3,160 Views)

SergeArmz,

 

I do not see anything on those plots which marks the start or end points. Can you list the time and amplitude values for the two points?

 

I will put together something to show what I had in mind and post it later. What version of LV are you using?

 

Lynn

0 Kudos
Message 4 of 11
(3,148 Views)

johnsold,

 

Here they are:

 

The plot that I would like to use as a trigger is the blue one (voltage) from rising value of 2 V and 600 msec total acquisition time. That will work for sure, my motors use to have a pulse duration time between 200 and 400 msec, so 600 msec will be great to catch all the event in the plot.

 

The LabView version I'm using is 2013 SP1

 

Thanks again

 

SergeArmz

0 Kudos
Message 5 of 11
(3,140 Views)

Here is a VI which will give you some ideas. This will not do exactly what you want.

 

General notes:

1. I used a single cycle of a sine wave for a test signal.

2. Threshold 1D Array may not be the best way to do this because of its limitations on polarity and threshold value related to first element in the array. If you do use it, you will need to add several tests to account for those limitations.  Read the Detailed Help for more information.

3. The Negation functions before the second Threshold 1D Array are there to deal with some of those limitations.

4. The array of NaN (Not A Number) is used for the second plot because NaN values do not plot.

5. Use the Start and Stop indexes to extract data from the other channel using 2 Split 1D Array functions or (better) Array Subset.

 

To do a timed segment extraction modify:

1. Find trigger point (Start index) as in this VI.

2. From the sampling rate or dt of a waveform determine the sample interval. 

3. Determine how many samples will be in the acquisition duration you want.

4. Use Array Subset with Start Index and the number of samples to get the desired segment.

 

If you have questions after you have tried this, please post your VI with some typical data saved as default.

 

Lynn

 

 

0 Kudos
Message 6 of 11
(3,126 Views)

Hello jonhsold,

I got your points, let me start doing some trials in order to see if it will work on my needs. I'll reply back with an answer whether it works or not.

 

Regards

 

SergeArmz

0 Kudos
Message 7 of 11
(3,094 Views)

Hello SergeArmz,

 

The following VI acquires a continuous signal and generates a Software Analog Trigger, maybe you can adapt this code for your specific needs (BTW: this VI was used with the NI 9205 too).


Best Regards.

David P.
National Instruments
Applications Engineer
www.ni.com/soporte
0 Kudos
Message 8 of 11
(2,998 Views)
Solution
Accepted by topic author SergeArmz

Finally after a lot of research, trials and many developments, here it is a VI that I developed that is capable to do what I was looking for. Thanks to the guys that helped me out in to figure how to solve my issue.

I'm attaching the VI for all of those that may have the same problem that I had.

 

And of course if you can improve what I did will be great, I think this is the the goal for this forum

 

Cheers!

 

SergeArmz

0 Kudos
Message 9 of 11
(2,945 Views)

Insert into Array is not the best choice when appending to an array. Use Build Array. Better is to preallocate the array (as you do with Initialiize Array) and then use Replace Array Subset inside the loop. This does not result in the array continually decreasing and increasing in size.  To get the presample array in the form you want it is necessary to rotate the array after exiting the loop.

 

You can wire to the shift register terminal outside the loop. No need for an additional tunnel.

 

No need for local variables. Use wires. No need to calculate dt twice.

 

Note that I used Diagram Disable structures because I do not have DAQmx or any suitable DAQ devices. I used "i" as a data value for the pretrigger array to verify that the pretrigger points appear in the same locations in the array as with your code.

 

Lynn

Message 10 of 11
(2,922 Views)