Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

output one voltage at every coming external clock rising edge

Hi,all.
    I wrote the attached code to output voltages triggered by an external clock.The external clock is about 1 Hz.For examle,I want to output 256 different voltages and change the voltage value when a new coming rising edge is ditected.
    The problem is when I run the code it says there is no data in the output buffer.
    Can anyone help me out with this puzzle?
    Thanks
Download All
0 Kudos
Message 1 of 3
(3,177 Views)

Hello Jyp,

 

The reason you receive this error is because you need to put samples in the write buffer before you start the task.  I’ve included instructions on how to find an example that shows how to buffer and execute a finite analog output task below.  You will need to modify the example to include the PFI0 as the sample clock source to use an external clock and then just buffer the write task by sending the array of data you want to write to the DAQmx Write VI.  NOTE:  You'll also need to change the Timeout input on the DAQmx Wait Until Done VI.  If you try to generate 256 samples at 1Hz you need to timeout needs to be at least 256 seconds--otherwise this VI will error out and stop execution before you're done generating your samples.

 

To access this example:

1.  Open LabVIEW and go to Help>> Find Examples...

2.  Navigate to Hardware Input and Output>> DAQmx>> Analog Generation>> Voltage>>  Gen Mult Volt Updates-Int Clk.vi

 

I hope this helps, and have a great day!

 

Brooks
0 Kudos
Message 2 of 3
(3,161 Views)

Thanks for your advice,Mr Brooks_C.

Following your instructions I finnally get it working now. But after the program has done the work I need it outputs an error:

Measurements: Wait Until Done did not indicate that the task was done within the specified timeout.

Increase the timeout, check the program, and make sure connections for external timing and triggering are in place.

I don't know why,but I want to be perfect though it's not a big problem.Hehe.

Hope for your reply!

 

 

0 Kudos
Message 3 of 3
(3,144 Views)