LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executing Acquire upon Digital Line State

I have a homework problem where a analog voltage measurement isn't supposed to start until a digital line becomes true.

I have it working, but just checking if there is a preferable way.

As a test, I used a T/F toggle switch inside a continuous while loop to simulate the digital line state. When I toggle the switch to True, I pass a True value out of the While loop. I pass this True value to a Case structure that accepts 2 values, True and False. On True, it starts the analog data aquisition, which works all OK.

Is there a preferable way to "wait" on a trigger, and then execute a block of code?

thx

Jeff
0 Kudos
Message 1 of 3
(2,715 Views)
There are a number of examples that ship with LabVIEW that already incorporate digital hardware triggering.

The program you described will work, but the amount of time between the triggering event (toggling the switch) and the start of the acquisition will vary because you are monitoring the value of your digital line in software. The latency will depend on how many things your computer is doing at once, as well as the speed/memory of your computer.

By using hardware triggering, you eliminate the software dependancy and achieve a response time in the nanoseconds. You can find the triggering examples by choosing "Search Examples" from the LabVIEW splash screen. Once the help window comes up, choose "I/O Interfaces -> Data Acquisition -> Analog Input -> Triggering a
n Acquisition."
0 Kudos
Message 2 of 3
(2,715 Views)
Exactly what I was looking for, thanks! One of the intermediate Analog Input vi's has an input terminal called "Trigger State" or similar which is used in the example mentioned.
0 Kudos
Message 3 of 3
(2,715 Views)