LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Voltage controlled analog output

Solved!
Go to solution

I have more or less failed in my attempts to use DAQmx analog output features.  What I would like to do is create a program that will switch the analog output channel on depending on the voltage of an analog input channel.  The basic idea is this: I'm measuring the differential voltage in a simple temperature sensing circuit.  When the voltage crosses a threshold (for example, 2.5V), the analog output channel kicks out a steady 5V and will stop kicking out 5V when the ai voltage crosses back over the 2.5V threshold.  Is this even possible? I have struggled to find any examples or starters to help me out.  Any suggestion would be appreciated. Writing the code to acquire the ai signal is not an issue, I'm just not sure how to incorporate the ao functionality.


Thank you.

0 Kudos
Message 1 of 7
(2,753 Views)

The behavior you described for your analog output is exactly the behavior of a digital output. Is there a reason that you want to use an analog out to accomplish this? If you can, you should use a digital output. What you want to do is continuously sample your analog input at a certain frequency and run a check each time to see if the value returned is greater than 2.5V. If it is, write a TRUE to the digital output. If it is not, write a FALSE to the digital output. 

 

You can accomplish the same thing with the analog output, just instead of writing a true, you need to write whatever value corresponds to 5V.

 

Can you show us your code? If you have no problem gettin getting the analog input to work, you really shouldn't have any issues with the analog output. They are very similar processes.

0 Kudos
Message 2 of 7
(2,750 Views)

All you really need is to use a DAQmx Write to output the desired voltage.  I would perform the read and compare the AI voltage to your threashold.  The output should be a boolean.  Use the boolean with the Switch primitive to write out your desired voltage.

 

Give this a try and share what you have.  Then we can help you with more specifics.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(2,745 Views)

BFeigum, can you explain in a little more detail about using the digital channel?  The DAQ I woudl prefer to use has 8 digital channels but no AO; the DAQ's with AO have a significantly lower bit count and so I'd prefer not to use them . . .

Thanks.

0 Kudos
Message 4 of 7
(2,742 Views)

I've attached the code I would like to use.  It is written using a DAQmx equivalent by Measurement Computing.  It would be no trouble at all to switch things over to DAQmx for the sake of this discussion if need be.

thx

0 Kudos
Message 5 of 7
(2,740 Views)
Solution
Accepted by topic author Geologian

Unfortunately I do not have the Measurement Computing libraries so I can't really see what you are doing with your code, but I will attach an example VI I did with DAQmx to get you going and hopefully thinking in the right direction. I have added both the analog out and digital out to show how each works. If you can do your code in DAQmx, please do and post it and I can help you further.

0 Kudos
Message 6 of 7
(2,714 Views)

Thanks, this example worked perfectly. Cheers.

0 Kudos
Message 7 of 7
(2,686 Views)