07-08-2008 09:17 AM
In our measurements we perform retriggerable DAQ. The application is complicated but attached code represents the core of the DAQ. We encountered following problem(s).
1] If I simulate the process everything seems to work smoothly. But if I use the real device (PCI 6110) and I utilize it to acquire 8000dbls on each trigger it acquires into the buffer only 7994dbls on the first trigger. Following trigger has already 8000dbls but the first 4dbls obviously belong to the end of the data from the previous trigger.
What could cause this? I am able to do some workaround by acquiring 8004 and cutting first four dbls but I would like to know why is this happening and why exactly 4dbls.
2] Is it possible to simulate trigger occurrence in retriggerable DAQ? My problem is that if I use simulated device the triggers occur immediately and it's not what I want. Would be nice to generate trigger on button press.
Thanks for any help
We used LabVIEW 8.2 and NiDAQ 8.3
07-09-2008 02:27 PM
07-09-2008 03:11 PM
07-10-2008 09:11 AM
07-10-2008 12:51 PM
07-16-2008 03:17 PM
Hi Zach and thanks a lot.
Your explanation is magnificent! I would never guess that it is actually hardware property of the card itself.
The workaround I have used before knowing this was that I generated one more trigger at the beginning and I read 7996 samples acquired in the buffer. All other triggers had proper amount of samples to be read and because I was anyway cutting first couple of ms of the signal I didn't have to take care of the first 4 samples (that were actually from the previous trigger).
Now if I know what causes this I would like to use the workaround suggested in the KB:
#1 - When the first trigger rises I will utilize the card counter to produce 8004 pulses but I will read only 8000 samples
#2 - On the second trigger I will utilize the card counter to 8008 pulses. I will read 8004 samples from the buffer. First four samples will be cut off and the rest is my signal. There are still 4 samples in the buffer that will be used to push other data when next trigger rises /ACCORDING TO MY OPPINION THERE IS 8 SAMPLES NOW -SEE Q#2/
#3 - Same as #2 and so on.
Q#1- But how to change the number of pulses after first trigger is processed - this is parameter set before the measurement starts and I am not sure if can be changed during runtime.
Q#2- I also don't understand why should I produce 8008 pulses in the #2. I still have 4 samples in the buffer from #1 and if I produce again 8004 pulses and read 8004 samples - the 4 first are from the previous trigger and I cut them off and remaining 8000 is my signal - AND THERE IS 4 SAMPLES STILL IN THE BUFFER FOR NEXT TRIGGER
I will have chance to test it in 14days but I want to alter my software according to this new fact that's why I am asking if got it right.
Thanks a lot 🙂
07-16-2008 05:43 PM
07-16-2008 05:54 PM
07-16-2008 06:40 PM
07-17-2008 12:10 PM - edited 07-17-2008 12:11 PM
Hi Dan,
Yes I acquire signal only from one channel so your explanation makes sense.
What I do not understand is this part: 'If you are only reading 8000 (1st read) and 8003 (subsequent reads) samples at a time, you will slowly build up a backlog...'
I understand what it means but I would read 8004 in subsequent reads so that was just a warning what I should avoid, right?
I will consider your suggestion of using even number of channels but I want to keep the resources as low as possible. So if I still want to acquire only from one channel the proper way will be:
#1 When first trigger occurs, use counter card to produce 8004 pulses. Read 8000 samples.
#2 On second trigger, use counter card to produce 8004 pulses. Read 8004 samples. Discard the first 4. #3 Goto #2
Using this way the 8000 samples I always get are the proper ones and there is no other problem.
Thx a lot again Dan!