11-23-2009 09:50 AM
I am using the USB 6009 DAQ module to read 8 analog voltages, and based on the level, control a digital output to turn on a relay. I have a accomplished reading the voltages but I am stuck as to how to control the outputs. Here is how I would like it to work.
- measure incoming voltage
- if it's below lower setpoint then turn on appropriate digital output (pulse output, x ms on and y ms off then repeat if still below lower setpoint)
- the digital output activates a relay that turns on a valve that fills a cylinder with water (cylinder sitting on load cell)
- once the weight (voltage) reaches the upper setpoint the output should turn off
- after the ouput turns off the weight will gradually drop again due to evaporation
I need to measure 8 voltages and control 8 digital outputs per module and there will be 3 modules (24 scales to weigh and 24 valves to control)
It will take approx 12-24 hours for the weight to go from the upper setpoint to gradually drop down to the lower setpoint so I only need to sample the input every minute or so. Once the lower setpoint is reached, the output will be turned on and off until reaching the upper (we don't want to fill the cylinder to quickly to allow for water to absorb into the soil)
I have attached the VI I have so far so any help would be appreciated. If there is a way to accomplish this easier or better than this I am all ears. We will be using Labview 2009 (this VI was done on 8.5) Thanks
11-23-2009 11:13 AM
Hi,
Did you allready had a look at the digital I/O examples from DAQmx (LabVIEW>Help>Find Examples).
Christian
11-23-2009 01:36 PM
11-23-2009 02:02 PM
You don't have to combine anything. A single DAQmx Write is enough. You would want the Create Channel, Start Task, and Clear Task outside your loop. You could also use the DAQ Assistant (ugh) by creating one for each channel. I believe that if you use the DAQ Assistant, you will have to convert the Boolean to an array.
11-23-2009 03:41 PM
11-23-2009 04:19 PM
11-23-2009 04:32 PM
11-23-2009 04:56 PM
You should be minimizing your use of both locals and Value property nodes since the potential for race conditions is there. I'm not aware of any upper limit on the number of locals.
11-24-2009 10:26 AM
11-24-2009 11:20 AM
Dennis wrote: ..You should be minimizing your use of both locals and Value property nodes...
This could be the first step. And you could create SubVIs
Christian