Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET NiDAQmx Continuous Analog Output Buffer

Hi

I am controlling the movement of a mechanical device by a "control signal" (a sequence of instantaneous positions) generated voltage output task. Being mechanical, it is important that the voltage variation is nice and smooth under all circumstances in order not to overload and damage the device.

Under “normal circumstances” this is of course obtained by feeding a nice and smooth control signal into the continuously running analogue output task, ensuring that the tasks buffer never runs empty. Due to the rather unpredictable scheduling of the Windows operating system and Net framework, this, however, requires that the task.stream’s buffer is large and normally filled with the desired movement well ahead in time.

The problem is the abnormal situations:

In case it is necessary to “abort” it shall be possible “ramp down” the movement from whatever position the device has reached to a halt position.  But, due to the large buffer, a normal “WriteMultiSample” containing a ramp down signal will only have an effect after all the movement already stored in the buffer has been output to the DA converter by the task, which is too late.

What is the best way to overcome this problem?

One approach would be to keep the task running, but replace the “unused” contents (i.e. not yet transferred to the DA converter) of the buffer with a ramp down signal, but this would require that it is possible to get information on the “current position” in the buffer and also that is possible to write data to that position and onwards.  Can any of the Task.Stream properties be used for this?

Another approach would be to stop the task and restart it with the ramp down signal.
That would require that it is possible determine where the stopped task has left the device (i. e. the voltage last fed into the DA converter). Is there a way to determine this value?

Regards

Morten

0 Kudos
Message 1 of 1
(3,291 Views)