Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxReadDigitalU32 Task/Channel plus Timing Question

Greetings,
I have 4 NI-6511 (64 bit digital in) boards installed in a PC.
I've written code (Delphi) which does the following:


enumerate installed boards (GetSysDevNames)
Create a Task for each installed board (CreateTask)
Create 2 Channels for each task (CreateDIChan - Channels are 'Dev#/port0_32' & 'Dev#/port4_32')
Start each task (StartTask)
Read data 1 sample/channel specified (ReadDigitalU32)

All are successful with the following exception:
ReadDigitalU32 returns only the first channel in the task. These channels are 32 bits wide, so is there a limitation that I can only read 32 bits worth of data with this function call ?

I expected to see DataArray[0] contain the data for Dev1/port0_32 and DataArray[1] the data for Dev1/port4_32, but this was not the case. I then expanded the array to be a multidimensional one (UINT32 ArrayData[2,100]) but this also did not produce the desired results. Any suggestions ?

Other Question:
I currently use a system timer to generate the reads every 70ms or so. Is there a call I can use with the 6511 board that creates a continuous read task ? I tried CfgHandshakingTimng, but DAQmx_Val_ContSamps is not defined, and trying DAQmx_Val_SampleContinuous (or whatever it's defined as in DAQmx.TLB) produces a GPF.

Thanks in advance,

Jim
0 Kudos
Message 1 of 2
(3,288 Views)
Hi Jim,

Try using the DAQmxReadDigitalLines function, which will allow you to read multiple samples from each digital line in the task. For each sample per channel, the parameter, "numBytesPerSamp" would be the number of bytes that channel consists of.

Thanks,
Lesley Y.
0 Kudos
Message 2 of 2
(3,274 Views)