Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make detection and acquasition processes faster on 6602 board ?

Hi to everybody, Currently I am using a NI 6602 board. And I am designing my project using VC++ in .NET framework(1.1) . In my application, I have to wait a digital signal(triggering signal) to go high level to start my acquasition. At first, I tried to check continuously that incoming digital signal in a seperate thread using ReadSingleSampleSingleLine() fxn (polling). In my application there aren't so much threads , just 3-4 threads, and this thread has the highest priority. But I recognised that I am missing some acquasition data after I detect the trigger signal. In more detail the case is: when the trigger signal arrives, I have to capture an incoming byte(which is available on another 8 digital input lines for just 5-6 microseconds). And the problem is : I can detect the trigger signal by polling but I am missing the incoming byte. I am trying to detect the incoming byte using ReadSingleSamplePortByte() function again by polling. The incoming byte disappears before I manage to read it. My fist question: 1. Is there anything that you can suggest to make my detection and acquasition process faster? I tried to use digital edge triggering and change detection events hoping to faster my process. But I got an exception about my board does not support that kind of triggering. My second question: 2. Is there any way to use digital edge triggering or change detection events in 6602 board? This is the first time I am using an NI board. I noticed that 6602 is specialized on timer counter concepts, not on digital I/O concepts. But I don't have a chance to use any other board right now and I have to manage my application using 6602. any help is welcomed. thanks in advance. koray.
0 Kudos
Message 1 of 7
(5,060 Views)
In a more readable form:

Hi to everybody,

Currently I am using a NI 6602 board. And I am designing my project using VC++ in .NET framework(1.1) .

In my application, I have to wait a digital signal(triggering signal) to go high level to start my acquasition.
At first, I tried to check continuously that incoming digital signal in a seperate thread using ReadSingleSampleSingleLine() fxn (polling). In my application there aren't so much threads , just 3-4 threads, and this thread has the highest priority. But I recognised that I am missing some acquasition data after I detect the trigger signal.
In more detail the case is: when the trigger signal arrives, I have to capture an incoming byte(which is available on another 8 digital input lines for just 5-6 microseconds).
And the problem is : I can detect the trigger signal by polling but I am missing the incoming byte. I am trying to detect the incoming byte using ReadSingleSamplePortByte() function again by polling. The incoming byte disappears before I manage to read it.

My fist question:
1. Is there anything that you can suggest to make my detection and acquasition process faster?

I tried to use digital edge triggering and change detection events hoping to faster my process. But I got an exception about my board does not support that kind of triggering.

My second question:
2. Is there any way to use digital edge triggering or change detection events in 6602 board?

This is the first time I am using an NI board. I noticed that 6602 is specialized on timer counter concepts, not on digital I/O concepts. But I don't have a chance to use any other board right now and I have to manage my application using 6602.

any help is welcomed.
thanks in advance.
koray.
0 Kudos
Message 2 of 7
(5,059 Views)

Hi koray,

 

The 6602 only supports software-timed digital input and output. That means you cannot use hardware triggers or digital signals to time your acquisition. If you're already doing a multi-threaded application, it will be difficult to get more performance out of it. Perhaps others here can offer some suggestions from their experience. 

Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 3 of 7
(5,043 Views)
thanks Joe for replying.

I want to ask one question more.
When I use ReadSingleSampleSingleLine() fxn for reading a digital line, it takes about 400 microseconds for completing this read operation.
Is it normal time for this read operation or should it be more faster ?

koray.
0 Kudos
Message 4 of 7
(5,022 Views)
Hi koray,

Yes, that time is acceptable for that function. The best way to optimize a read call is start the task and then enter the loop that reads the data. If you start, read, and stop every iteration, your loop time will be very long. From the time you quoted, it sounds like you're already doing this, though. I just wanted to mention it for completeness.
Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 5 of 7
(4,998 Views)
could you show the reading method of your code? mine is much slower... I only get 3 values per second.
0 Kudos
Message 6 of 7
(4,581 Views)

Hello,

 

I think that what Joe is referring to is something like the following pseudo-code:

 

 // Create the task
 CNiDAQmxTask digitalReadTask;
       
 <CONFIGURATION>

 

//Start the Task

StartTask();


for (int i = 0; i < samples; i++){


        // Read the data
        data = reader.ReadSingleSamplePortUInt32();

}

 

//Stop the Task

StopTask();

 

This is not working code, FYI. Just an idea of the point I think Joe is meaning to get across.

 

Chris W

Message Edited by Chris W. on 06-01-2009 03:21 PM
0 Kudos
Message 7 of 7
(4,561 Views)