ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do make an analog output of a USB 6008 increase by 1V for 1s, each time AI0 exceeds 1.5V, then return to the previous value?

How do make an analog output of a USB 6008 increase by 1V for 1s, each time AI0 exceeds 1.5V, then return to the previous value?  And repeat this pulse anytime AI0 has been below 1.5V.
0 Kudos
Message 1 of 4
(3,317 Views)
Hi,

What rate are you planning to read the analog input at?  Do you want to be continuously monitoring the analog input, or just read that once every second as well.  Assuming that you are programming in LabVIEW using DAQmx, I have attached a VI that can help you get started.  I am monitoring the analog input once every second and sending the analog output in a case structure, based on what the value of the analog input is.

There are many ways to do this and the attached VI is just one of them.  This VI is just a starting point to make your application.  Please keep in mind that this is all software logic.

Also, I am resetting the analog output value to -5 every time it crosses 5V, because you did not mention what will happen to the analog output once it crosses the maximum value supported by the 6008.  I just made this assumption.  You can change it around to suit your needs. Smiley Happy

Hope this helps.  Please feel free to post back with any further queries.

Regards
Raajit L
National Instruments
0 Kudos
Message 2 of 4
(3,300 Views)
Thank you Raajit L.   I should have stated that I am using Labview version 8.0.  I get an error about a newer version when I try to open AIAO123.vi.
I'm trying to make a 1V pulse on top of a 0 to 4V level, so my analog input and output will always be between 0 and 5V.
0 Kudos
Message 3 of 4
(3,294 Views)
Sorry about that.  Try this new attachment.  I think I currently have it set up to go between -5 and 5 volts.  It should be pretty easy to change though.  The initial step outside the while loop needs to be changed to zero and also the inner most case structure where I have wired a -5 constant needs to be changed to 0.  Once again, there are many ways of achieving this, you can play around with the code and see what is best for you.Smiley Happy

Regards,
Raajit L
National Instruments
0 Kudos
Message 4 of 4
(3,286 Views)