Jump to content

Writing to end of buffer in continuous mode


Scatterplot

Recommended Posts

I have a recurring problem that I have been unable to solve so far with any satisfactory methods.

My company has the frequent need to be able to begin writing an arbitrary waveform, then have it repeat indefinitely until something happens (user presses Stop or similar). This part is easy- set the daqmx to continuous with regeneration, then stop the task when I need to. The problem here is the stopping- I need a way to write out the ENTIRE waveform, then stop. We are using voltage controlled actuators, and a step input is almost unacceptable here. We need to be able to finish the cycle before halting the task. So far, the only really good way I can think of to do it is to use an analog input to monitor the output voltage and stop it based on that signal, which is obviously undesirable.

The ideal case is to be able to say, ok, this next write is the last, stop regeneration after this. However, the regeneration property is unsettable while the task is running. I have also tried software re-buffering, where I write a new waveform every cycle in non-regeneration/continuous samples mode. This doesn't work either. When I write the last set of desired samples, I do a Wait Until Done, but get an underflow error. I have also tried setting the property NextWriteIsLast, but I get an error saying it is not supported by the device or is not applicable to the task.

I am using a USB-9263 in a USB-9162 carrier, if that makes a difference. ANY help would be GREATLY appreciated!!!

Thanks

Bert

Link to comment

Just thinking out loud here, I don't have any hardware in front of me to test this. If you have a regenerating AO happening and you write a new waveform to DaqMX write, doesn't it allow the old waveform to finish generating before starting in on the new waveform? I'm not sure, but I think it does.

What if the new waveform was all zeros or some other safe waveform that shut down your equipment? You let that go for a few cycles, and then stop the output. Without knowing the specifics of your application I don't know if that will work, but might be worth a try.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.