From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Transient analog output when starting/stopping task.

Dear all,

 

I am using a USB-6366 DAQ to output analog waveforms via nidaqmx Python API.

Basically the DAQ serves as an arbitrary waveform generator.

 

I attached the code configuring the DAQ below. Also see the different outputs.

 

Attached, you can find an oscilloscope screenshot of the behaviour.

My problem are the negative and positive peak at the start and end of the output. 

They do not seem to be caused by data that remained in the buffer.

The peaks happen when task.start() and task.close() is called respectively.

 

I have fiddled around the task.start() or auto_start=True as well as task.stop() or task.close() but had no success so far.

This seems to be a transient when the NI DAQ starts to talk to the analog output channel. It also occurs for output ao1.

There will be an amp and high voltage transformer behind the DAQ at some point and such a transient is potentially harmful for the entire system, hence the need to get rid of it.

 

Is there any way to solve this or is this DAQ-specific behaviour?

 

#Configuring the DAQ

self.writeTask.ao_channels.add_ao_voltage_chan("Dev1/ao0")

        self.writeTask.timing.cfg_samp_clk_timing(rate=self.sample_rate, sample_mode=nidaqmx.constants.AcquisitionType.CONTINUOUS)
        self.writer = nidaqmx.stream_writers.AnalogSingleChannelWriter(self.writeTask.out_streamauto_start=False)
 
#reset to zero output in case something is still in the buffer
        self.writer.write_many_sample(np.zeros(self.buffersize))
        time.sleep(0.5)
        self.writeTask.start() #initial negative peak happens when .start() is called!
        time.sleep(0.1)
        self.writeTask.stop()
 
#ramp up outputwaveform 
self.writer.write_many_sample(rup)
            self.writeTask.start()
 
#steady output of the AWG function
            self.writer.write_many_sample(self.awg_fn)
...
#ramp down
            self.writer.write_many_sample(rdown)
            time.sleep(x)
            self.writeTask.close() #final positive peak happens when .start() is called!

 

Best regards and thanks already for your help!

Thomas

 

0 Kudos
Message 1 of 4
(706 Views)

Hello there,

Those peaks looks like charging and discharging the buffer, as you have written in your code and looks very normal process and I don't think it is a DAQ-specific behavior.

As I understood, you are generating the signal using the USB-6366Daq and acquiring it using a Rohde and Schwarz device. You can send me the whole code so I can test it furhter.
 

 

0 Kudos
Message 2 of 4
(662 Views)

Hi Harvey,

 

thanks for your reply.

You got it right. Generation happens via analog out from the DAQ and acquisition is done with a Rohde&Schwarz RTB2000 oscilloscope. 

I try to put a minimal working example together and send it to you for testing. Thanks for the offer!

 

Best regards

Thomas

0 Kudos
Message 3 of 4
(636 Views)

okay 🙂

0 Kudos
Message 4 of 4
(619 Views)