LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manually change trigger threshold

Solved!
Go to solution

I'm new to LabView and I was looking around the forum trying to find a solution to a problem I have. I'd like to be able to have a Trigger that detects a threshold that I can change on the fly. Right now my program has a set amplitude that it triggers on, but I'd like to be able to drop in a slider and change the threshold as I go. A bonus would be to have the threshold value be displayed on the graph I'm using, but it's not necessary.

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=283779

 

The above post is pretty much what I need, but I didn't recognize most of the controls being used, and there was no source file to look at. Is there any way to change the threshold on the fly without having to mess with arrays like in the above example? If not, could someone please explain the process to me.

0 Kudos
Message 1 of 15
(6,215 Views)

If you can post the code you have so far, it would help.  Also, please let us know what hardware you are using.

 

It sounds like you need (at least) an event structure inside a while loop.  At least one of the events you would need to define would be where you change the trigger level -- and that would send the appropriate command to your instrument. 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 15
(6,195 Views)
The code thus far is fairly non existant. It's basically just a 'Trigger and Gate' that is set to trigger when the amplitude is rising and gets above 5. I'm using LabView 8.6, and I'm not really sure about the hardware.
0 Kudos
Message 3 of 15
(6,188 Views)

Hi rmhughes,

 

Have you looked at this example here? It mostly uses Express VI's (there doesn't seem to exist an example yet that uses the lower level VI's).

0 Kudos
Message 4 of 15
(6,175 Views)
That is similar to what I would like to be able to do, the problem is that the 'Trigger and Gate' function doesn't have an amplitude input like the 'Simulate Signal' function does.
Message Edited by rmhughes on 07-28-2009 01:58 PM
0 Kudos
Message 5 of 15
(6,171 Views)

Hi rmhughes,

 

The Trigger and Gate VI is an express VI and the threshold property cannot be configured programmatically. Is there a particular reason you have to use this VI? If you are looking for a certain number of signals before or after the trigger, you can use arrays to achieve a similar purpose. 

 

I've attached the source code of something similar to the linked forum post from above. Basically all it does is generate a sine wave and the threshold line and plots them both on the same graph. No comparisons are done. The stuff with getting the waveform components and using arrays is to create the threshold line for the graph. 

 

 

Message 6 of 15
(6,150 Views)

Hi Olivia,

 

The project I am working on looks at the amplitude of a sound and upon sensing an amplitude of a certain amount for a specified amount of time, it plays a sound back. I was initially drawn to the 'Trigger and Gate' VI because it allowed me to easily configure an amplitude on which I could trigger. The problem came once the project was run in a real environment and it was realized that the amplitude won't always be that set number and will need to be changed frequently during an experiment.

 

The file you have attached will help greatly! I still have two questions though. How can I apply something like a DAQ Assistant to that model so that I can have real time data? And is there a way to have that model spit out a True/False like the 'Gate and Trigger' VI does?

0 Kudos
Message 7 of 15
(6,145 Views)
Take a look at this community example. It uses the lower level VI's for DAQmx instead of the DAQ Assistant but is very close what you are asking for. You will have to replace the threshold numeric indicator with a slider as well.
Message 8 of 15
(6,129 Views)
Thank you for your help, but I'm getting the error indicated in the image below. When I click browse on the Digitial Channel Parameters it just comes up with an empty list (I assume the blank is what it's compaining about).
Message Edited by rmhughes on 08-05-2009 01:35 PM
0 Kudos
Message 9 of 15
(6,094 Views)
In the example the Digital Channel Parameters a physical digital line on a data acquisition card. What the example does is compare the incoming analog signal to a threshold value. If the incoming signal is above the threshold, a high signal is written to a digital line. If you don't have a digital line, you can remove the DAQmx VI's used for the digital output.
0 Kudos
Message 10 of 15
(6,070 Views)