LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

pause sample clock

Hi!

 

I'm faced with the following problem:

I want to program data via USB-6259 to a hearing device. Writing bits to the line works without trouble but the hearing device is only able to receive a certain amount of bits (one page) and then I have to wait 5 ms until programming the next page and so on...

 

I already tried to handle it by setting the size attribute of the clock like this:

 

DAQmxCfgImplicitTiming (clockHandle, DAQmx_Val_FiniteSamps, breaks);

 

where "breaks" is the size of one page at maximum.

 

So I start new tasks everytime when the done callback was called. But starting a new task and cleaning takes more then 5ms. this is not really performant.

 

Is there any other posibility to do a 5 ms break?

 

Best regards,

Matthias

0 Kudos
Message 1 of 4
(3,231 Views)

Hi Matthias,

 

you might want to consider using an asynchronous timer, see the example asyncdem.cws that comes with CVI. The minimum time interval value that you can use depends on the operating system that is running the asynchronous timer, see the help. But even this minimum time is not guaranteed because Windows is not a Real Time OS.

 

Wolfgang

0 Kudos
Message 2 of 4
(3,229 Views)

Hi Wolfgang!

 

Thank you for your reply! But I think this doesn't help me with stopping the DAQ Clock Task for 5 ms.

For example:

The chip of the hearing device is able to receive 512 bits. and then the buffer is full. now it has to move the 512 bits to another register before it is able to receive the next 512 bits. The time span of moving from the chip to the memory register takes 5 ms.

with the digital writing functions of the DAQ API I can stream a certain amount of bits to the output lines of USB-6259 while running the clock. The amount of bits is defined by ONE task.

 

I already tried to split the programming into more tasks (with delays in between) but starting a new task after 512 bits were programmed takes longer than 5ms. this is not really performant.

 

Or did I get the use of an asynchronus timer wrong? 😉

 

Best regards,
Matthias

0 Kudos
Message 3 of 4
(3,203 Views)

Hi Matthias,

have you made progress in your approach? If I understand your application correctly, you are looking for a sample clock that pauses for 5 ms after the write is complete. Basically you would have to combine two counters to create such a sample clock: One that generates a slow pulse (high for 512bits @ n bits/s, then 5ms low), another that uses said pulse as a pause trigger.

 

Please see this KB "Creating a Delayed, Retriggerable and Finite Pulse Generator" on some functionality required for this.

 

The resulting sample clock would be your external clock required for your actual writing operations.

 

Regards

--
Peter A.
Field Sales Engineer, NI Germany
0 Kudos
Message 4 of 4
(3,108 Views)