Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

My vi works fine with the debug light bulb on, but not when i run full speed

Solved!
Go to solution

I have two writes on the same channel, when i use the light bulb the signal works properly. When the vi runs at full speed it never sends the second write.

 

 

0 Kudos
Message 1 of 3
(3,133 Views)
Solution
Accepted by topic author mike_fit
I fixed it but, i think it is a cheap solution. I added a stop and start. I still get the warning, but so not to screw up the operator I changed the error message to only ok message, and not warnings.
0 Kudos
Message 2 of 3
(3,132 Views)

Hi mike_fit,

 

By default, DAQmx will regenerate Analog Output data from a buffer in PC memory (see the KnowledgeBase Analog Output Regeneration Modes for more info).  I'm not sure if this is causing the problem, but I believe what is likely happening is that you are stopping the task before the new data is output on the card--in this case the DAQ device would still be outputting the original data.

 

When Highlight Execution is enabled this slows down execution long enough to write the new data and output it before the task is stopped.  Restarting the task would clear the old data from the buffer, which would explain why doing so fixes the problem.

 

 

From the looks of the program it seems like you are writing a single voltage update to your analog output line.  For an application such as this, you shouldn't need to use buffered output since you are writing one value to the DAQ device per DAQmx Write call.  In your case I would recommend not using buffered analog output and just stick with Software-Timed updates.  The following shipping example shows what this might look like:

 

Help >> Find Examples... >> Hardware Input and Output >> DAQmx >> Analog Generation >> Voltage >> Gen Mult Volt Updates-SW Timed.vi

 

 

Of course, if everything is currently working as you need it you may not have to change anything--I just wanted to offer another possible alternative and try to shed some light on what is going on.  Thanks for posting!

 

-John 

John Passiak
0 Kudos
Message 3 of 3
(3,090 Views)