LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write.vi error

In the attached VI, I am getting the following error

 

Error -200547 occurred at DAQmx Write (Analog Wfm 1Chan NSamp).vi

Possible reason(s):

Measurements: DAQmx Write failed, because a previous DAQmx Write automatically configured the output buffer size. The buffer size is equal to the original number of samples written per channel, so no more data can be written prior to starting the task.

Start the generation before the second DAQmx Write, or set Auto Start to true in all occurences of DAQmx Write. To incrementally write into the buffer prior to starting the task, call DAQmx Configure Output Buffer before the first DAQmx Write.

Task Name: _unnamedTask<9>.

 

In this the physical channel is a simulated device PCI-6251.

 

How can I rectify this error ??

0 Kudos
Message 1 of 7
(2,629 Views)

You're configuring the Sample Clock with 500,000 samples at a rate of 1000 samples per second. How long will it take then to output all 500,000 samples?

 

Then look at your loop rate.

0 Kudos
Message 2 of 7
(2,622 Views)

It will take 500 seconds for the output.

What do you mean by loop rate ??

When I made write.vi autostart to true, that error is gone. But I am getting another error.

0 Kudos
Message 3 of 7
(2,618 Views)

I am giving iterations as 10.

Maximum value of DAQ as 10 and minimum as 0.

0 Kudos
Message 4 of 7
(2,617 Views)

I stand corrected. The measurement task only starts automatically when doing a DAQ Read.

 

The DAQ Write will return immediately (while the data is transmitted). You need to wait until the samples are done before writing again. Try using a DAQ Wait Until Done after the Write.

 

What's the new error?

0 Kudos
Message 5 of 7
(2,607 Views)

Error -200288 occurred at DAQmx Write (Analog Wfm 1Chan NSamp).vi

Possible reason(s):

Measurements: Attempted to write a sample beyond the final sample generated. The generation has stopped, therefore the sample specified by the combination of position and offset will never be available.

Specify a position and offset which selects a sample up to, but not beyond, the final sample generated. The final sample generated can be determined by querying the total samples generated after a generation has stopped.

Attempted to Write Sample: 250000
Property: RelativeTo
Corresponding Value: Current Write Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<58>

0 Kudos
Message 6 of 7
(2,600 Views)

I made some changes in the VI. Now it seems to be working properly.

 

Hope it is fine. Thanks for your help

0 Kudos
Message 7 of 7
(2,589 Views)