From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I setup this analog output, or, why does this VI suck?

Good afternoon all.
 
I've got this VI started using a DAQ assistant 1 to take a thermocouple reading.  Outputting that to a timed file write and also to a second DAQ assistant which should be turning on an analog voltage when a certain temp is reached in DAQ assistant one.  For some reason my analog voltage turned on and stays on, and once the temperature is reached (92 in this case) the program generates a buffer error, that my samples are set to 1 and the minimum is 2???
 
I just need that voltage to remain off until the temperature specified is reached and then turn on either as a single 'jolt' or continously until the program is terminated, then reset and be off again.
 
VI attached--total newb here--please help.
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 1 of 6
(2,912 Views)
Error -200609 occurred at DAQmx Write (Analog 1D Wfm NChan NSamp).vi:1
 
Possible reason(s):
Generation cannot be started, because the selected buffer size is too small.
Increase the buffer size.
Selected Buffer Size: 1
Minimum Required Buffer Size: 2
Task Name: _unnamedTask<6>
 
This is what I'm getting here...  help?
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 2 of 6
(2,905 Views)
What I ended up with after some playing gave me 10 volts when it was supposed to (yay), but then wouldn't shut it off when the false condition came back...  I created a false state with a 3rd DAQ assistant with a voltage value of zero...  Now it turns on and off at the temperature limit as I wanted--but is there a better way to do it?
___________________________________________________________________
Still confused after 8 years.
Message 3 of 6
(2,891 Views)
Hey Ralph,
 
Here is a new version with a small changes: You were setting daq asst 3 every loop so for instance if it stayed at 80c you would keep turning the daq asst 3 off, if it stayed 90 it would keep turning it on.  I modified it to turn in on or off just once as the 85 threshold is passed. 
 
Otherwise your vi worked well and even this change is a little trivial for such a small application, if you were trying do a lot of processing very fast this could have really slowed things down.

Brian

Message Edited by BrianPack on 05-17-2006 04:00 PM

Message Edited by BrianPack on 05-17-2006 04:01 PM

0 Kudos
Message 4 of 6
(2,879 Views)
Thanks Brian!  I'm going to play with that a bit...
 
Question...  You see in my VI that there is a 'write to file' on a timed delay...  Any chance you can give me some insight as to how to put a data send at the exact moment that the temp exceeds spec and the second DAQ assistant goes 'true'?
 
Basically we're timing the write to file to take one random sample every minute, but it would be nice to have that last bit of data right as the shutdown occurs.
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 5 of 6
(2,850 Views)

This is fairly straight forword.  You just need to OR the output of of your code to write every 60 loops with the output of the code that sets daq 3 to 0. The using the boolean output of the OR gate to decide wether you write the file or not. 

So you want the vi to stop running once the threshold is passed and after daq 3 is set to 0? 

This code should do what you want but with out the setup to really test it I make no guaruntees.  It should write to a file every 60 loops (1minute) or if the 85c is passed.  Also the vi will stop once 85c is passed (but after the file is written) or if STOP is pressed. 


Brian

0 Kudos
Message 6 of 6
(2,825 Views)