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: 

DAQmx change on-the-fly waveform amplitude

Solved!
Go to solution

Hi!

I try to program my DAQmx device. I have an array of double (custom waveform), a variable amplitude depending a other operation (feedback), frequency of 50Hz. I want to change the waveform between to cycle with the new amplitude.

 

I have error like:

 

Error -200288 occurred at DAQmx Write (Analog 1D DBL 1Chan NSamp).vi:1780001

Possible reason(s):

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: 40
Property: RelativeTo
Corresponding Value: Current Write Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<28>

 

How I can do it?

 

Thank

0 Kudos
Message 1 of 4
(4,479 Views)

This is working, but take around 6 second before updatingAnalogOut_WithAplitudeFeedback_2.png

0 Kudos
Message 2 of 4
(4,466 Views)

 

 

IMG_2941.png 

and the update need to be at the end of cycle...

0 Kudos
Message 3 of 4
(4,429 Views)
Solution
Accepted by topic author CFiset

I toke

https://decibel.ni.com/content/docs/DOC-25373

and modifiy a litle bit and this's working!

 

 

AnalogOut_WithAplitudeFeedback_3.png

Message 4 of 4
(4,415 Views)