Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxGetWriteSpaceAvail not working for X-series PCIe-6363 device before TaskStart

With the PCIe-6363, after writing to an Analog Output device’s buffer using DAQmxWriteAnalogF64, then reading back the space available using DAQmxGetWriteSpaceAvail, the returned value does not reflect the fact that data was written to the device.

The attached code gets the space available using DAQmxGetWriteSpaceAvail and writes to the AO buffer using DAQmxWriteAnalogF64. This sequence is repeated twice.

 The 1st call gets the space available and is followed by a call that fills up the buffer (these 2 calls work as expected). The next call to DAQmxGetWriteSpaceAvail should get zero space available since we filled it up, but in the case of PCIe-6363 it returns the same value as the 1st call. This causes the 2nd call to DAQmxWriteAnalogF64 to fail.

 

The attached code demostrates this problem. It was tested with PCI-6251 and USB-6211 using actual hardware and works as expected. The error was observed with actual hardware when testing the same code with the PCIe-6363.
 

 

The output of the attached code for PCI-6251, USB-6211, and other M-Series devices is show below:
Write to AO Buffer before starting task.
Space Available = 1000

(Fill buffer using DAQmxWriteAnalogF64)

Space Available = 0

The output of the attached code for X-Series PCIe-6363 device is shown below for comparison:
Write to AO Buffer before starting task.
Space Available = 1000

(Fill buffer using DAQmxWriteAnalogF64)
Space Available = 1000                                      <--- ERROR

DAQmx Error: The generation is not yet started, and not enough space is available in the buffer.
Configure a larger buffer, or start the generation before writing more data than will fit in the buffer.
Property: DAQmx_Write_RelativeTo Requested Value: DAQmx_Val_CurrWritePos Property: DAQmx_Write_Offset Requested Value: 0

Task Name: MyTask
Status Code: -200293

Thank you for your help,

 

Wael Hemdan
Data Acquisition Engineer
The MathWorks

0 Kudos
Message 1 of 9
(4,564 Views)
This issue was observed using both NI-DAQmx driver versions 8.9 and 9.0.2

Thanks,

Wael Hemdan
Data Acquisition Engineer
The MathWorks
0 Kudos
Message 2 of 9
(4,533 Views)

Wael,

 

I'm a little confused by your last comment. The 6363 was not supported in DAQmx 8.9. Did you mean that you saw the correct behavior of the 6259 in 8.9 and in 9.0.2, but the wrong behavior on the 6363 in 9.0.2?

0 Kudos
Message 3 of 9
(4,514 Views)
Hi Balki,

My bad, the PCIe-6363 does not return the correct value for DAQmxGetWriteSpaceAvail when tested with NI-DAQmx 9.0 and 9.0.2.
The 6259 behaves correctly on NI-DAQmx 8.9, 9.0 and 9.0.2

Thanks,

Wael
0 Kudos
Message 4 of 9
(4,512 Views)

Hi Wael,

       I was able to reproduce your error and have a filed a corrective action request for it.  It wasn't reproducible with a simulated device, but I definitely saw it with hardware.  Thanks so much for bringing that to our attention!

 

0 Kudos
Message 5 of 9
(4,498 Views)
For reference the CAR number is 191661. 
0 Kudos
Message 6 of 9
(4,487 Views)

Hi aNItaB,

 

Thank you very much for you help.

Can you provide me with any information as to when a fix for this bug (CAR #191661) will be available?

And if it's not soon, is it possible to get a patch in the meantime?

 

Thanks,

   - Wael

0 Kudos
Message 7 of 9
(4,367 Views)

Hi aNItaB,

 

Do you know if this problem happens with all X-Series boards or is it just with the PCIe-6363?

 

Thanks,

   - Wael

0 Kudos
Message 8 of 9
(4,340 Views)

I'm not sure when there will be a fix, or if there's a work around, but I'm looking into it and will let you know- have a good one!

 

0 Kudos
Message 9 of 9
(4,306 Views)