Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting error 200557?

I have a NI USB-6251 DAQmx card.

I use the attached VI inside a while loop. At each iteration two waveforms are generated, then fed to the VI to output them.

The VI is used twice: the first time to output the waveform; the second time, after few seconds, with a constant "0" waveform to set the analog output channel to 0V at the iteration end.

The VI runs fine and outputs the two waveforms only once, generating error 200557. Then, no longer produces outputs at DAQ channels (although error in is always clear).

After searching the forum, I see that error 200557 should appear when a property of the task is changed while the task is running. But between "start task" and "stop task" there isn't anything!

And why is the VI working once?

 

Many thanks

Message Edited by xdaf on 05-10-2010 05:59 PM
0 Kudos
Message 1 of 4
(4,626 Views)

Hi,

You are getting this error because you trying to configure your task multiple times.

To be clearer, once you start a task using DAQmx Start VI, you cannot use task property nodes to change its configurations.

In this case, you're not using property node but you said that you call this VI inside a while loop so after the first iteration that goes well, in the following iterations your VI tries to set again the channel properties and to Start it again even if you didn't not stopped it.

In general you should not put task configuration VIs (timing, triggering, start, stop, etc) inside loops.

You should put into loops only IO functions (Write, Read) and set the timing of your task to be in Continuos generation mode.

Hope to help you

Luca Gallo
Sales Engineer
0 Kudos
Message 2 of 4
(4,603 Views)

Hi Luca,

thanks for replying.

But since I use the "waveform timing", the number of samples to be generated must be taken from the waveform. So, since at every cycle iteration waveform length may change, the "wavefom timing" should be set at every iteration with the current waveform

Unless I misunderstand the use of waveform timing?

Thanks again for your support

0 Kudos
Message 3 of 4
(4,601 Views)

Take a look a this example.

 

http://decibel.ni.com/content/docs/DOC-10821

 

it should solve your doubts.

Greets

Luca Gallo
Sales Engineer
0 Kudos
Message 4 of 4
(4,584 Views)