LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200428 on DAQmx Write

Hello,

 I am new to DAQmx, so please forgive me if this is a trivial question. I created several DAQmx tasks in LabVIEW, then wrote my vi automatically generating the configuration code by right-clicking a DAQmx Task constant and selecting generate code. When I run the Standalone Solenoid Controller.vi in the Standalone Modules folder, I get a Error -200428 during the first call of DAQmx Write.vi.

What is going on? Please advise. Thank you.

 

Best regards,

 

Peter

0 Kudos
Message 1 of 6
(2,923 Views)

May be because you are clearing the DAQmx task at each write. You have to call 'DAQmx Clear Task' VI only once at end of the execution as a cleanup.

(The same way how you have used 'Initialize',  create one more case for clean-up)

Regards,
Yogesh Redemptor
Message 2 of 6
(2,895 Views)

Hello Yogesh Redemptor,

 

I doublechecked. But unfortunately, removing the DAQmx Clear Task.vi did not fix the issue. The error occured the first time the DAQmx Write.vi was called, i.e., even before calling the Clear Task.vi for the first time.

 

Best regards,

 

Peter

0 Kudos
Message 3 of 6
(2,879 Views)

It kind of concerns me that you are creating one large task just to pull out its channels.  I think what you really want to do is create a different task for each channel.  Do not call the Clear Task after a Write.  You should add a case to your Action Engine for cleaning up the tasks.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(2,872 Views)

Hello crossrulz,

Thank you for your reply.

I will definitely add a case for cleaning up the tasks.

The rationale behind creating one task for multiple channels was to organize channels with identical functionality into one task in MAX. As you can see in the *.nce file included in the zip file attached to my original message, I have created three tasks, two of which include multiple related channels.

I am wondering what would be the advantage of creating a task for each individual channel over just creating a NI-DAQmx Global Virtual Channel for each physical channel.

Also running the task in a MAX test panel did not generate an error. Please advise. Thanks.

Peter

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

The problem with having a single task is that you have designated those channels to be used for that task.  Once that has been done, you shouldn't be able to put those channels into another task or use them on their own.

 

When wiring the channel into the DAQmx Write, a task is created.  That task is what is passed out.  So by having that channel already designated for a task, you can't put it into another one.  You need to either write to everything with a single task or separate them into multiple tasks.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(2,853 Views)