05-19-2010 06:20 PM
Hi everyone
We have a PCI-6115 card which we want to use to sample image data from a PMT in a microscopy system.
What we would like to do is to acquire a finite number of samples at each synchronization pulse from the scanning mirror and do this continuously in a loop.
We are programming in C++ and I tried to just put a Read function in a loop and set the task as finite acquisition with a digital start trigger. However it seems like this cannot be done faster than about 100 Hz, before it starts to miss some of the synchronization pulses. I guess the starting and stopping of the task takes quite a bit of overhead. Ideally we would like to do it at 4 kHz which is the scanning frequency of the mirror. Is there anyway this could be done in continuous acquisition mode?
Magnus
05-20-2010 09:03 AM
Dear Magnus,
thank you so much for your post on our webforum. I thin you need to have a retriggerdable task; this is not supported for this device, however there is a solution. I came across a Labview example (I know you are using a different environment, but the hardware and driver stays the same); Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock.vi. Maybe you are able to find a similar example with the DAQmx C++ examples, it works in this way;
- a continuous task is created for the analog input
- a triggered finite counter pulse frequency task is also created (with the property retrigerdable enabled)
the counter output is used as timing source for the continuous analog input.
These are the staps in Labview;
Steps:
1. Create an analog input voltage channel. Also, create a Counter Output channel to produce a Pulse in terms of Frequency. If the Idle State of the pulse is set to low the first transition of the generated signal is from low to high.
2. Define the parameters for an External Clock Source. Additionally, define the sample mode to be continuous. Also, use the DAQmx Timing VI (Implicit) to configure the duration of the pulse generation and the number of pulses to generate.
3. Use the DAQmx Trigger VI to configure a counter trigger to start on a digital edge.
4. Configure a buffer which is 1000 plus the number of samples per channel. This is necessary when simulating retriggerable finite transfers with a continuous acquisition because DMA needs a slightly larger buffer than the Samples per Channel.
5. Use a DAQmx Trigger Property Node to set the operation for retriggerable.
6. Call the Start VI to begin the acquisition and to arm the counter which begins the pulse train generation.
7. Use the DAQ Read property node --> AvailSampPerChan to see how many samples have been acquired. If 'Samples per Channel' number of samples have been acquired, as you can set on the front panel, then Read the data, otherwise continue looping. This allows the user to stop the program by pressing the 'STOP' button at any time.
8. Read the waveform data in a loop until the user hits the stop button or an error occurs.
Note: This example reads data from one or more channels and returns an array of data. Use the Index Array function to access an individual channel of data.
9. Call the Clear Task VI to clear the counter Task.
10. Call the Clear Task VI to clear the AI Task.
11. Use the popup dialog box to display an error if any.
I hope this will bring you further,
Best regards,
05-20-2010 09:25 AM