Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample clock control of Digital lines

I am building a measuring application using a NI DAQPad-6016 and a Microsoft.Net VB.
 
Since program loops are to slow (10-30 ms) for controlong the measurement I am trying to use a sample clock to sinhronise all operations.
 
I produce a sample clock with a Ctr0 and a cable conection of Ctr0Out pin with PFT8 pin . Ctr1 is used for counting pulses from the photomultiplier using sample clock from PFT8.
 
I need to simulatneously control shutters and illuminator using digital lines, but there is no software option of using sample clock with a DOChannels.

Is there a way using trigers or else to sinhronise digital line states with the sample clock?

0 Kudos
Message 1 of 7
(3,938 Views)
luka,

Unfortunately, it is not possible to perform synchronized DIO with this device. All digital control must be software timed. To do correlated, synchronized, or triggered DIO, please have a look at our M-series boards. 10-30ms seems awfully slow for a software loop. If you are doing a lot of processing in this loop, perhaps you could try making your application multi-threaded and have a small, tight loop to do your digital control?

Hope this helps,
Ryan V.
National Instruments
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 2 of 7
(3,929 Views)

Ryan, thank You for the reply.

I noticed that, I can make a multisample write operation if I do not declare timing with a sample clock.

I would like to know what is the write speed (number of signals writen to the DIO line per second) and which clock is managing multiple writ to DIO lines. 

 

0 Kudos
Message 3 of 7
(3,921 Views)
luka,

As per the 6016 datasheet (attached), the maximum update rate for digital lines is 250 samples per second. This is completely dependent on your system, however. If you have a slower computer or other devices on the USB bus, this rate will go down.

Ryan V.
National Instruments
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 4 of 7
(3,907 Views)
About the duration of the control loops - here is one example of simple analog read loop in VB.NET
 

t1 = DateTime.Now.Ticks

For i = 1 To 100

data(i) = aIReader.ReadSingleSample

Next

t2 = DateTime.Now.Ticks

 
It takes 2328 ms or 23 ms/loop. Also other nidaqmx commands take 10-30 ms.
I am using a Pentium 4, 2.6 GHz, 512 MB RAM, Windows XP SP2.
 
Am I doing anything wrong?
 
I thougt that USB 2.0 communication is faster.
 
 
 
0 Kudos
Message 5 of 7
(3,891 Views)
luka,

USB 2.0 is faster, but the 6016 does not support it. Additionally, USB has large latencies, which is the time it takes between a data request and the reception of data. This time would be much smaller with a PCI DAQ card.

I was under the impression that you were doing a digital acquisition. If you are acquiring analog data, I would reccomend a hardware timed, buffered acquisition rather than a software timed, point-by-point acquisition. There are several examples that illustrate this.

Finally, your computer is plenty fast enough! Are you running any other software that could be occupying the CPU? Also, do you have any other USB devices on the bus? Are you going through a USB hub?

Ryan V.
National Instruments
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 6 of 7
(3,884 Views)

Ryan,

About the timing: I am not using USB hub and DAQ-PAD6016 is the only device connected to the USB. No other software is running simultaneously. I have checked timing on other computer and it was similar.

The reason for choosing USB card was in building a portable luminometer. I use digital lines for the control of the shutters, illuminator and high voltage supply of the fotomultiplier - which is used for light detection. I am using one counter for sample clock generation and the other for photon pulse counting. So for my application I need a corelated DIO and Counter operation. I think I have achived it with a combination of software timing for DIO and hardware timing for counter.

I have to say, that I am a little disapointed about the speed of data reading from the counter in a buffered operation - the maximum read frequency of 33 Hz. This limitation of DAQ-PAD6016 was not presented in the product documentation.

Thank You for help.

Luka

 

 

0 Kudos
Message 7 of 7
(3,869 Views)