09-09-2020 09:49 AM
Hi all,
My VI is connected to a NI module that is an analogue output and has a range of 0 to 0.02A.
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.
09-09-2020 09:54 AM
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 %.
09-09-2020 10:09 AM
Hi,
for your first solution I tried it like this:
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:
-Emilie.
09-09-2020 10:42 AM
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.