10-10-2005 04:24 AM
Hi,
I’m trying to use digital triggers to start and stop measurement. Program is supposed to wait until start trigger happens, then create a measurement file and start logging to file until stop trigger. I’m using PFI1 as start trigger and PFI5 as stop trigger (PFI0 is already in use for other purpose). When logging has been stopped, program should start to wait again for start trigger.
The problem is that I’m not able to restart logging after first stop, unless I use very slow acquisition rates (when there is no backlog). I have tried DAQ occurrences and AI read in while loop to wait for start trigger. AI is cleared after each stop.
Any ideas how to solve this problem?
Thanks in advance,
Jakke
10-10-2005 04:55 AM
According to your descprition I think what can help you are nested loops.
Have a look at the attached vi.
Hope this helps.
Thomas
10-10-2005 08:17 AM
Thanks, but unfortunately that didn't solve the problem.
I made an example code (LV 7.1.1) without file writing functions. PFI5 and PFI1 trigger lines are used in this example. I included two solutions I tried for detecting start trigger: DAQ occurrence and AI read.
When measuring for example one channel at 1000 scans/sec, there's no backlog and I'm able to start and stop measurement using triggers. But when I rise channel count for example to four, backlog doesn't remain zero and measurement won't start after first stop. I'm using DAQPad-6020E.
Thanks in advance,
Jakke
10-10-2005 08:26 AM
10-10-2005 09:14 AM
10-11-2005 04:06 AM
10-11-2005 04:51 AM
10-11-2005 05:59 AM
Thanks becktho,
Idea of the first loop is to wait until start trigger happens. In final application measurement file is created right after start trigger happens (this is important). After file is created measurement loop starts. I know there's no stop condition in case of an error, but this example is only a simplified version of the full program.
AI read is set to read one second of data or remaining backlog if it's more than one second. Reason for this is to prevent measurement running out of buffer in all situations.
So basicly program is meant to progress like this:
wait until start trigger -> create measurement file -> log data to file until stop trigger (or exit) -> wait again until start trigger -> new measurement file....
And yes, I'm from Finland 🙂
Jakke
10-11-2005 06:17 AM