Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

6536 acquire continuous with trigger -> need faster solution

Hello,

I use a PCIe-6536 card to control a image sensor with ansi C, Microsoft Visual Studio and DAQmx 8.3 . Im able to generate the requiered signals and the sensor send also data back. To acquire data I have to trigger at one control signal, which starts one measure each 240us.

I tried to aquire the data like this:

    DAQmxErrChk( DAQmxCreateTask("read",&taskREAD));
    //create channel with 4 lines(port 2 lines 0,1,2,3)
    DAQmxErrChk( DAQmxCreateDIChan(taskREAD,DEV1/port2/line0:3,"", DAQmx_Val_ChanForAllLines));
    //set sample clock for reading 20MHz ( 2000 samples)
    DAQmxErrChk( DAQmxCfgSampClkTiming (taskREAD, "OnBoardClock", 20000000, DAQmx_Val_Rising , DAQmx_Val_FiniteSamps, 2000));
    //set trigger
    DAQmxErrChk( DAQmxCfgDigEdgeStartTrig (taskREAD, "/DEV1/PFI0", DAQmx_Val_Falling ));

    while(1)
    {
        //start reading
        DAQmxErrChk( DAQmxReadDigitalU8 (taskREAD,2000,timeout, DAQmx_Val_GroupByChannel,inBufffer,2000, &read,NULL));
        //wait until buffer is full
        DAQmxErrChk( DAQmxWaitUntilTaskDone (taskREAD, timeout))

       //*********************************************
       //process and save data
       //*********************************************

    }


Actually everything works, but the problem is, to read once it needs about 2ms.  But I want to use the sensor at maximal rate, it means 10 time faster.
Any ideas to solve this problem?

Thanks

marc


Message Edited by stehsegler on 11-06-2007 05:34 AM
0 Kudos
Message 1 of 7
(8,819 Views)
Please move this thread to Hardware/Digital IO forum

thx
0 Kudos
Message 2 of 7
(8,808 Views)
Hello Marc,

as due the specs of the card, it should be able to do this, but I think that windows is not able to do this.
Try to give your application a "high" or "realtime" priority. But attention: if you choose realtime, windows dont react anymore, just your program.
If the timing is than better its clear that windows is the problem.

whitch data you want to read? are the 4 lines with singel data or parallel data?

best regards,
Stefan
0 Kudos
Message 3 of 7
(8,780 Views)
Marc,

Just a couple quick comments.  The 6536 and 37 don't support hardware retriggering so your response time will be limited by the processing speed of your system.  I am not sure how flexible your application is but the hardware does support a Pause trigger which allows you to stall the acquisition based on a level trigger.  It may be possible for you to use this to use a single acquisition but pause between your bursts.

Also, the HSDIO supported devices such as the 654x/5x/6x support multi-record acquisition which gives you hardware timed "retriggering".  Information on these devices can be found at:

http://www.ni.com/highspeeddigitalio/
0 Kudos
Message 4 of 7
(8,776 Views)
Hello Stefan and Ryan

Thank you both for the answers.

So the problem is that my system (PC) need this 2ms to recognise the trigger event and to react at this.

The Pause trigger punctuate reading data, right. Is it possible to detect when the task is paused? If it isnt possible, then Im not able to process data during aquiring and the best way to be faster is like this:

- increase the in buffer and use pause trigger
- after x burst stop aquiring
- process/save data
- aquire agian.

In this way, the software waste the time not for every burst.
Would that work?


Thank and best regards

Marc
0 Kudos
Message 5 of 7
(8,755 Views)
Hi again,

It looks like it works  Smiley Happy


Thanks for the help

have a nice weekend

Marc

0 Kudos
Message 6 of 7
(8,746 Views)
Thanks for the update Marc!  Let us know if you bump into anything else.
0 Kudos
Message 7 of 7
(8,721 Views)