Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the resolution on read timeouts?

Can anyone tell me the resolution on timeouts for digital input tasks, please? In the documentation it shows timeouts specified to four decimal places, which would mean a resolution of 0.1ms.
 
By way of explanation - the C function clock() has a CLOCKS_PER_TICK of 1000, which is a resolution of 1ms. However in DOS the actual clock used is 55ms period, so you can only actually achieve delays which are multiples of that. It appears with Windows that I am getting only multiples of 15ms using clock().
 
What is the corresponding resolution for DAQmx read timeouts? Can it actually achieve 0.1ms (which would be great - 1ms would be fine for me).
 
Thanks,
 
Paul
0 Kudos
Message 1 of 6
(7,160 Views)
Hi Paul,
 
Is there a chance you could please tell me the product you are using?
Thanks
 
Rob W
National Instruments
Application Engineer
Applications Engineer
0 Kudos
Message 2 of 6
(7,142 Views)
Hi Paul,
 
Also could you clarify a few things for me, you mention using the clock function is this the resolution you want the information on? Unless you board has a hardware clock it will use the software clock (which obviously is no where near as fast, and relies heavily on the speed of your machine etc).
 
Also when you ask for timeout resolution? could you clarify what you mean by this,
 
Thanks,
 
Rob W
National Instruments
Application Engineer
Applications Engineer
0 Kudos
Message 3 of 6
(7,131 Views)

Hi, Rob. Thanks for the reply.

I am using a 6229 USB OEM board.

The example with the clock() function from the Visual Studio v6 C Library was just an attempt by me to clarify what I meant by resolution. Sorry if it has confused the issue. Please ignore it.

I am using a task based on the change detect hardware. When I do a read I am using the ReadDigitalScalarU32 function from DAQmx, which allows me to specify a timeout. I would like to use various timeouts, but the lowest is 500us (0.5ms or 0.0005s). It doesn't have to be accurate, and indeed anything round about that value would be fine.

I guess what I am asking is - what is the smallest timeout I can request and achieve? Another way to ask the question would be - what speed is the clock you are counting to do the timeouts?

Hope that clarifies,

Best Wishes,

Paul

 

For information, this is the task and some of its properties:

**Task: Change Detect
  Task - Name: ChangeDetect
  Task - Channels: Vestibular/port0/line21...
  Timing - Sample Mode: 10123 DAQmx_Val_ContSamps
  Timing - Sample Timing Type: 12504 DAQmx_Val_ChangeDetection
  Timing - Change Detect Rising Edge Physical Channels: Vestibular/port0/line19, Vestibular/port0/line11
  Timing - Change Detect Falling Edge Physical Channels: Vestibular/port0/line19, Vestibular/port0/line11
  Read - OverWrite Mode: 10159 DAQmx_Val_DoNotOverwriteUnreadSamps
  Read - Wait Mode: 12547 DAQmx_Val_Sleep
  Read - Sleep Time: 0.0010
  Buffer - Input Buffer Size: 10000
  Channel - Input Data Transfer Mechanism: 10054 DAQmx_Val_DMA

0 Kudos
Message 4 of 6
(7,121 Views)

Hi Paul,

The 622x family of DAQmx hardware shows the following clock frequencies on page 9 of this manual:

http://www.ni.com/pdf/manuals/371290g.pdf

 

I will find out more for you now, just leaving you that PDF incase it's any help in the meantime.

 

Rob W

National Instruments

Application Engineer

Applications Engineer
0 Kudos
Message 5 of 6
(7,116 Views)

Also if you check page 6 of that manual, the SampleClock is the speed at which you will be aquiring from.

 

Rob W

National Instruments

Application Engineer

Applications Engineer
0 Kudos
Message 6 of 6
(7,114 Views)