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: 

Analogue Output Module

Hi all,

 

My VI is connected to a NI module that  is an analogue output and has a range of 0 to 0.02A.

erabrannan_0-1599662892406.png

 

 

Therefore, I can only input values within that range or it gives me an error.

 

My analogue output NI module is connected to valves that open or close when the user inputs a value from 0 to 0.02A.

 

However, I have been asked to change the input values into percentages instead.

 

For example, an input of 0% is 0A and an input of 100% is 0.02A.

 

 

bear in mind that I tried to change the control to percentage through the advanced editing mode and as I suspected any time I put a value higher than 0.02 it still gives this error.

 

I would appreciate any help thanks!

 

emilie.

 

 

0 Kudos
Message 1 of 4
(1,011 Views)

Two options.

 

1.  You do the math in code.  So take your desired percentage and multiply by .02.

2.  You create a DAQmx scale where you start with 0 to .02 amps that get mapped to 0 to 100 %.

0 Kudos
Message 2 of 4
(1,009 Views)

Hi,

 

for your first solution I tried it like this:

erabrannan_0-1599663704632.png

Is that what you meant?

In any case I still get the error...

 

 

And for your second solution I think it worked!! I did not get any errors.

 

This is how I did it:

 

erabrannan_1-1599664127084.png

-Emilie.

 

 

 

 

0 Kudos
Message 3 of 4
(993 Views)

I'm glad the second one worked for you.

 

The first one should have worked as well.  What error did you get?

Was the value of valve greater than 100?  It is possible that because of resolution errors with the math of floating point numbers 100 x .02 could have wound up being something just slightly larger than .02.   Something that could help prevent an issue is feeding the result of the multiplication through an In Range and Coerce function.

0 Kudos
Message 4 of 4
(979 Views)