LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Iterating a loop when triggered from an external analog source

Solved!
Go to solution

Hi, first of all I apalogize if this is a trival question, but I am relatively new to LabView programming and I can't seem to figure it out.

I am trying to set up a VI that records data when triggered. My data acquisition setup is a BNC 2090 connected to a PCI MIO 16E-4. As far as I can tell I am able to set up my tasks in DAQmx to read data when triggered, but I can't seem to get the labview VI to record this data with the correct timing.

 



What I would like is a loop that run whenever it sees the analog edge of the trigger, I'm sure labview is capable of this. Can someone help? Thanks in advance!

Message Edited by keony31 on 06-20-2009 06:19 PM
0 Kudos
Message 1 of 7
(3,395 Views)
Update: In addition to the above question, I would also like to know if it is possible to force another iteration of a loop even if the previous iteration is not yet complete. If it is, what will happen to the incomplete iteration? Will the data just be dropped or is there a buffer that will eventually fill in the blanks.
0 Kudos
Message 2 of 7
(3,371 Views)

Hi keony31,

 

I just want to get a little better understanding of your application.  Could you tell me what you want your DAQ card to do and what kind of signal you are reading and what signal you are going to be triggering on?

Regards,
Jim Schwartz
0 Kudos
Message 3 of 7
(3,328 Views)

jschwartz wrote:

Hi keony31,

 

I just want to get a little better understanding of your application.  Could you tell me what you want your DAQ card to do and what kind of signal you are reading and what signal you are going to be triggering on?


 

Thanks for the reply. My DAQ card is setup correctly. I have a task set up to record data when triggered by the rising edge of an analog trigger signal. What I want is for my labview VI to record the data on each trigger. After some additional testing I discovered that the loop to read the signal takes ~6ms which is about 6 times longer than the time between signals.

So I would like to somehow speed up the read signal process.

0 Kudos
Message 4 of 7
(3,320 Views)

Hi keony31,

 

Could you please post your code?

Regards,
Jim Schwartz
Message 5 of 7
(3,305 Views)

Take a look at the Queue Basic.VI included as an example with LabVIEW.

This is a good way to perform buffering when you are collecting data faster than you can process it.

It is also a good way to get some experience using the queue functionality in LabVIEW (if you don't have any experience in this functionality, it may seem confusing at first.)

 

I have attached the LabVIEW Example VI for quick reference.

 

 

CLD | CTD
LabVIEW 2011 SP1 | TestStand 4.5
Message 6 of 7
(3,290 Views)
Solution
Accepted by topic author keony31
Thank you both for the replies. I have figured out a work around for now.
0 Kudos
Message 7 of 7
(3,268 Views)