LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error from array input

I'm using a DBL array input so the user can set several values.
Now I recognized an error: When the user inputs "0", the VI gives
me a ~"-1E-12", this leads to an error message as I do some range
checking... What's wrong?
This only occurs, when the user manually inputs values. When I preset
the array with values loaded from a config file, everything works fine.
0 Kudos
Message 1 of 8
(3,660 Views)
I've read your question several times and i've come to the conclusion that you need to explain yourself a bit more and maybe even include some code to illustrate your problem. I dont understand why a "0" inputted manually gives a different outcome to a "0" inputted from a config file - surely you load the config file into the manual array, or use the same vi paths?

I look forward to slightly more info and hopefully solving your problem.

Kim
0 Kudos
Message 2 of 8
(3,660 Views)
Gerd, this may help if you could paste a VI which exhibits this behavior in this discussion. I'm not quite sure what you are seeing yet. Attach an example to a message and we will take a look at it.
J.R. Allen
0 Kudos
Message 3 of 8
(3,660 Views)
Well, how to add an attachment, when you use www.google.com to post
messages? If somebody wants to have an example vi, send me an email!

I try to explain: this vi is part of the inputs & configuration vi's
of a bigger measurement program (+100 vi's).
It get's its predefined values from global variables. Then it copies
these globals to the local controls. The user can change/add/delete
values in these controls (in this case an array input) and when he/she
is ready, he/she just presses an ok-button. Then the vi does a range check
and when all is ok, the values from the local array input is copied
back to the global variable.
The problem now: Normally the user loads a config file, all values are
read and copied into the global variables. Then the user is force
d to
check all values in those configuration-vi's by pressing "Ok" in every
sub-vi and everything is ok. But the last time I didn't use a config file
and tried to input all the values from the configuration vi's. That's
when I noticed this misbehavior: I tried to input a "0", but the vi
thought of getting ~"-1E-12" (found out via debugging mode).
Any help/advice?

JRA wrote in message news:<506500000005000000198F0000-1027480788000@exchange.ni.com>...
> Gerd, this may help if you could paste a VI which exhibits this
> behavior in this discussion. I'm not quite sure what you are seeing
> yet. Attach an example to a message and we will take a look at it.
0 Kudos
Message 4 of 8
(3,660 Views)
I'd love to send you an email for the example but you havent included your email address. I think an example is what is needed here, as i still cant really see any explanation for this behavour from what you have written.

Post your email address, or follow my name link and send me an example and i'll try to help you.

Kim
0 Kudos
Message 5 of 8
(3,660 Views)
Hi

This is just a Guess... Maybe it will help.

Please right Click on the the Problematic Array Control. Then Click on "Data Range". In the Data Range Box, Please Check your Minimum, Maximum, values. The manual input to the Control Array cannot be anything Outside these ranges. Also your "If Value is Out of Range" Box in the Data Range may be set to Ignore so VI does not physically show out of Range but Forces the Value to Maximum Value.

I Hope this helps you...

Good Luck!!

Mache
Good Luck!

Mache
0 Kudos
Message 6 of 8
(3,660 Views)
Well, using www.google.de to read news, I can see my email address,
even when I'm not logged in. But I can't find yours...
Anyway, my email is gerd.wieczorek@epost.de.

storeyk wrote in message news:<50650000000500000088910000-1027480788000@exchange.ni.com>...
> I'd love to send you an email for the example but you havent included
> your email address. I think an example is what is needed here, as i
> still cant really see any explanation for this behavour from what you
> have written.
>
> Post your email address, or follow my name link and send me an example
> and i'll try to help you.
>
> Kim
0 Kudos
Message 7 of 8
(3,660 Views)
I have looked through your emailed example and i have come to conclusion that the max and min coerced valves were causing 0 to become -0.000000000000000014 when using Pascals as the unit.

So in the 'changed' vi (included in the library) i have changed the Min and Max valves to -Inf and Inf and added a 'In range and coerce' function to make sure the valves are in the correct range. This sorts your problem. Although your solution actually does the same thing in the end.

I dont really know why it happens, but i have seen a similar problem: Put a numeric on the front panel, change the digits of precision to 17, then type in 0.6 in the display and enter. It shows 0.5999999...! I think it's something about the way the processor handles numbers, but
maybe someone can enlighten us?

Well, i hope this has helped you, and not confused you even more!

*smiles*

Kim
0 Kudos
Message 8 of 8
(3,660 Views)