Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

cont gen voltage wfm-int Clk-non regeneration immediate update doesn't work with NI-6218

I am attempting to generate a signal which will be used as a marker during later data analysis. This signal will eventually be included with 7 other signals which will all be acquired during a sleep study. In my main program, which is too involved and I will not post here, the signal will change from outputting a constant 5 volts to 0 volts or vice versa. In order to make this diagnosis easy, I am trying to use the VI included below to update the signal immediately. I understand that the NI-6218 DAQ device has its own onboard buffer but when I try to get around the buffer by changing the Regen mode to "Not Allow Regeneration", or changing the Output.onbrdbufsize, or by changing the AO.DataXferReqCond, it doesn't work. I need the signal to immediately update so it marks the correct time (hopefully within a tenth of a second). The VI included below will represent this by changing from a sign wave to a triangle or square wave, but the generation of the new signal is not immediate. It seems to take a few seconds for the updated signal to propagate through the onboard buffer. Is there a way around this that I have not found so that the signal will be immediately updated and output as soon as a user pushes the button on the front pannel?

 

Software: LV15

DAQ: NI USB-6218

0 Kudos
Message 1 of 7
(4,743 Views)

I almost forgot to mention that when I try to change the Output.OnBrdBufSize to anything other than 8191 the progam also gives me an error. Is there a reason this is not able to be updated to a different value that I am not realizing?

0 Kudos
Message 2 of 7
(4,741 Views)

Instead of writing an entire waveform at a time, I would use a case structure within a while loop to switch between writing a single sample (either 0V or 5V). This will most likely speed up the process much more.

Message 3 of 7
(4,708 Views)

Johny,

 

Thank you for your answer, sorry it has taken me so long to get back to you. I have been busy with other assignments.

 

I tried what you mentioned but it seems to freeze my computer now! The program gets hung up at the first write VI. I am really having trouble with this. I will include the new VI I created. If I set it up to allow regeneration it works fine but it doesn't have the immediate response I was looking for as mentioned above. Please help!

0 Kudos
Message 4 of 7
(4,547 Views)

You're missing a DAQmx Start Task VI after your first write so the task is never starting

0 Kudos
Message 5 of 7
(4,527 Views)

It starts itself when it hits the property nodes. If I put the start task vi in there it come up with an error saying the task is already running.

0 Kudos
Message 6 of 7
(4,517 Views)

I tried the code you attached in your post and I did not run into any errors. Could you debug the VI (using either breakpoints, stepping through, highlight execution or probes) and let me know if there are any errors being thrown?

0 Kudos
Message 7 of 7
(4,483 Views)