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,477 Views)

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

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

 

 

IMG_2941.png 

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

0 Kudos
Message 3 of 4
(4,427 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,413 Views)