From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxReadDigitalU32 returned data question

Reposted from Hardware > Digital I/O forum.

Greetings,
I have 4 NI-6511 (64 bit digital in) boards installed in a PC.
I've written code (Delphi) which does the following (the prefix DAQmx stripped from the orignal DLL function calls):


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
(2,990 Views)
Hi Salemation,

You can consider using the function: DAQmxReadDigitalLines to read from the individual lines.
The PXI-6511 supports unstrobed digital input only (software timed), hence your current method of using the timer is the way to go.

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