LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffered Analog Outlout

Hi,  I load an array of Analog Output values to a PCI-6341 that are clocked out by pulses from an external source.  However, say I load a 100 element array, sometimes I may have 101 pulses rather than the desired 100 pulses.  The extra unwanted pulse results in 10volts from the Analog Output which is a disaster for the process under control.

Is there a method to ensure extra pulses result in 0volts ?

 

analogOutputConfig.JPG

0 Kudos
Message 1 of 13
(3,702 Views)

Perhaps I'm thinking too simple, but can you just append some 0s to your array?

 

Maybe it depends on whether this will cause a new problem of having a 105 element array, but only 100 pulses and your task not finishing? You could always stop the task at this point though to solve that.

Ian
LabVIEW since 2012
0 Kudos
Message 2 of 13
(3,694 Views)

I'm appending zeros at the moment as a work around.  The problem I have is that during software development there's often an erroneous extra pulse and sometimes there's not a zero in the buffer ready to soak it up, this results in damage to the material I'm processing, the Analog Output drives an energy level.

Eventually I'll fully debug the source of the extra pulses and the issue will be solved.

I usually request voltages between 1 and 6 volts, I never request 10volts, so where does the 10volts value originate from?

0 Kudos
Message 3 of 13
(3,689 Views)

I would think that if you configure the finite task for 100 samples, the task would end at the 100th external pulse and ignore any subsequent pulses.  Most devices will keep holding the most recent AO value though, even after stopping the task.  If you want a neutral 0V output to be present after finishing the task, you'll probably need to code that explicitly.

 

Can't really guess why AO puts out an unexpected 10V.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 13
(3,682 Views)

Thanks for the reply Kevin, I'm still trying to debug the system.  Do you know if there's a DAQmx command to clear the buffer?  I think that sometimes all the values are not clocked out, then when I load the next array it's appended to the values already in the buffer.  If I could query the buffer size or purge buffer it may help for debug.

0 Kudos
Message 5 of 13
(3,632 Views)

 

1. If there's time available, you can call DAQmx Clear to clear the task, which will include clearing the buffer.  You'd need to reconfigure the task before starting again.

   This would definitely work, but will be relatively slow.  I'd plan for something roughly in the order of 100 msec.

 

2. If you're still doing Finite Sampling, calling DAQmx Stop will *probably* be enough (can't test right now).   It'd also be a good idea to make sure that the # samples you send to DAQmx Write is the same as the # samples you specify in DAQmx Timing.

  I *think* I recall that if you leave the # samples unwired on DAQmx Timing when setting up Finite Sampling, the first call to DAQmx Write will define the buffer length to be the same as the # samples you write.  I do not know how this behaves across a task stop / start if your next run wants to write a different # samples to the buffer.

 

 

-Kevin P

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 13
(3,626 Views)

We can't see from the picture what is the value wired to the samples per channel input of the DAQmx Timing.vi. Can you confirm it is set to 100?

 

Ben64

0 Kudos
Message 7 of 13
(3,621 Views)

I'm machining lines, number of pulses varies with every line.  Clear does work to stop the analog output but is too slow to prevent damage.  My problem is not with the DAQmx as such, chances are it behaves as expected.  The problem I have is that the card does not always receive the exact number of pulses required to clock every value out of the buffer, or perhaps it receives more pulses than expected.  It would would be useful if I had some type of feedback of number of elements remaining in the buffer, or an indication the buffer was empty.

0 Kudos
Message 8 of 13
(3,613 Views)

A Write node will let you check the buffer, total sample generated...

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 13
(3,607 Views)

Its Likely that there is an external pull-up to 10V and the Idle behavior is HighZ.   With that X series device you ARE able to play with these properties:

 

Capture1.PNG

 

 


"Should be" isn't "Is" -Jay
Message 10 of 13
(3,604 Views)