LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 200209 occurs in the daqmx digital write block.

Solved!
Go to solution

Hello I want to measure 40 analog inputs and output 5 square wave digital signals using Labview and cDAQ. A 200294 error occurs in the digital write block when running after connecting to cDAQ. How can I do it? Attach the code.

Download All
0 Kudos
Message 1 of 6
(2,172 Views)
Solution
Accepted by topic author GChae

Hi GChae,

 

the error description of the error -200209 is pretty clear: do you want to use a channel twice in the task? (Unfortunately you forgot to set some useful default values in the DAQmx channel control for the AI task.)

Error -200294 also is clear: not enough samples in the DAQmx write buffer…

 

Some other problems:

Your DO task is created with 8 DO channels (line0:7), but the array you create before the DAQmxWrite just contains 5 elements. Where are the missing 3 samples?

The AI task is created as "continuous" with a sample rate of 1000S/s, but in the loop you read just 1 sample per DAQmxRead call: this will quickly lead to "buffer overrun" errors (-200279)!

I recommend to place AI and DO tasks into their own separate loops…

Try to use less/no local variables. Especially the "Checked cycle" locals can be replaced by a shift register!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(2,139 Views)

Thank you for the reply.

After reviewing the answer, I tried applying the new code, but it was confirmed that the same error occurred in DAQmx Write still the same.

As shown in the attached picture, if SimDEV is used for Digital Out, it works normally, but if it is used for an actual CDAQ device, the same error code occurs.

What could be the reason?

- error point

capture.png

- In case of Using real cDAQ(Error occur)

capture1.png

- In case of Using SimDEV(Operating)

capture2.png

0 Kudos
Message 3 of 6
(2,130 Views)
Solution
Accepted by topic author GChae

Hi GChae,

 

you still set a sample rate for the DO task (of 100S/s), but you only provide one sample (per channel) in the DAQmxWrite call.

Don't set a sample rate for this type of DO output, set outputs just "on demand"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(2,117 Views)

Now it works. Thanks. 

0 Kudos
Message 5 of 6
(2,112 Views)

Hi,

 

Try to go to this forum post as the same error is discussed and solved:

https://forums.ni.com/t5/LabVIEW/error-200294-in-Daqmxstart-task/td-p/3088409?profile.language=en

0 Kudos
Message 6 of 6
(2,083 Views)