03-08-2006 02:00 PM
03-09-2006
01:58 PM
- last edited on
07-08-2025
10:37 AM
by
Content Cleaner
Hello TMDATA,
I do not know what I would call that type of VI, but there are many examples that can help you get started in the NI Example Finder which you can open by going to Help >> Find Examples. For an example of analog input, I would look at the folder Hardware Input and Output >> DAQmx >> Analog Measurements >> Voltage. If you want to do a continuous acquisition where you set the rate of the acquisition, you could look at Cont Acq & Graph Voltage - Int Clk.
For analog output I would look at the Analog Generation >> Voltage folder. If you just need to output a DC voltage, Gen Voltage Update will do the trick. There are also examples for generating a waveform.
In order to trigger the analog output off of the analog input, you could check for the case when the analog input is greater or equal to your value, and then start the analog output operation.
If you are going to use the Gen Voltage Update example, be sure to put the DAQmx Create Channel and Clear Task outside of your while loop. Also, note that while your task is running the analog output voltage will stay at what value you have set it at, so when you want to turn off your solenoid, you will need to set the voltage back to 0V.
Also, you have not noted what hardware you are using. I am going with the assumption that you are using hardware that is supported by DAQmx. To verify that this is true, you can check what driver supports your device at ni.com/support/daq/versions.
Regards,
Laura
03-09-2006 05:51 PM
03-10-2006 11:49 AM
Hello TMData,
In the false case of your case structure when you want your analog output to shut off, I would write 0 volts using the DAQmx Write VI.
In order to properly create and clear your task, you should keep the DAQmx Create Channel and DAQmx Clear Task VIs outside of the while loop. The DAQmx Create Channel VI should be on the left side of the while loop and DAQmx Clear Task should be on the right side of the while loop, much like the analog input example you were looking at. Be sure to keep the task and error clusters are connected between all of the VIs for the analog output task.
Hope this helps,
Laura
03-13-2006 01:27 PM
03-14-2006 11:29 AM
Hello TMData,
To turn off the analog output, I would write 0V to your analog output line after the stop button has been pressed. It would be best to do this outside of the while loop, but before you call the clear task VI. This way, when your user presses the stop button, the analog output will always go to 0V.
Hope this helps,
Laura
03-15-2006 03:46 PM
03-16-2006 11:57 AM
Hello TMDATA,
I have modified a shipping example to write 0 V right before the task clears. Remember that when you stop the program you should click the button on the front panel that says "Stop" so that the program exits correctly. You should not use the abort execution button in the toolbar because you will just kill your program and it will not exit the while loop correctly, so the analog output line will not be set to 0V.
Regards,
Laura
03-21-2006 05:31 PM
03-21-2006
05:52 PM
- last edited on
07-08-2025
10:37 AM
by
Content Cleaner
Hello TMDATA,
I am glad to hear that your VI is working now. You might be interested in knowing that a LabVIEW 8.0.1 update is now available to install. You can take a look at all of the fixes it provides in the readme file. If you do install it, you will have to mass compile after that and the mass compile can take a little while. I would start the mass compile right before leaving for the day.
Regards,
Laura