LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build a Simultaneously output and input

I use NI9265 as output and NI9205 as input. Now I want to make the two moduls start working strickly simultaneously since that is the requirement of my experiment. So I build the following VI.

 

untitled.jpg

 

 

After running this VI, it shows: 

 

Error -200462 occurred at DAQmx Start Task.vi:1

Generation cannot be started because the output buffer is empty.

Write data before starting a buffered generation. The following actions can empty the buffer: changing the size of the buffer, unreserving a task, setting the Regeneration Mode property, changing the Sample Mode, or configuring retriggering.

 

I actually didn't do anything on the buffer. So could anyone help me deal with this tricky problem?

 

0 Kudos
Message 1 of 5
(3,015 Views)

The error comes up because you Start the AO Task (using DAQmx Start Task.vi) before you write the Samples to the Modules buffer (8192 Samples per default) using DAQms Write.vi. You have to write the values before you start the Task.

 

At the other hand they don't start simultaneously! You have to start the AO Task before you start the AI Task, which generates the timebase for the AO Task.

Have a look at the sychronization examples using the Example Finder (LabVIEW>Help>Find Examples)

They refer to M-Series devices but should behave the same with your cDAQ Chassis.

 

 

Christian

0 Kudos
Message 2 of 5
(2,981 Views)

Hello Stephen250, Hope you are doing great!

 

 

Definitely the error you are getting is expected due to the program set-up implemented in the code.

 

When trying to read and write from different modules/channels we definitely would like data to be presented to the buffer before reading this data, in this case there is not something defining which tasks starts first so there is the possibility the reading task is executing before data is written to it.

 

Another thing I noticed in the code is that the start task VI should be located after the write VI so you start the task after the writing parameter have been set.

 

You can take a look at the Multi Function Synch Analog Input-Analog Output VI example located in the example finder for LabVIEW.

 

In order to see this example in LabVIEW, go to> Help> Find Examples...>Hardware Input and Output> DAQmx> Multifunction.

 

 

 

 

Multi Function AI AO.png

 

Regards,

 

Luis A.

Applicatins Engineer.

National Instruments.

 

 

Message 3 of 5
(2,977 Views)

The example VI you just posted does not exist.

0 Kudos
Message 4 of 5
(2,613 Views)

The above post is from 2011.

 

Try this example program as a template to replicate the above.

0 Kudos
Message 5 of 5
(2,590 Views)