03-12-2009 06:53 PM
I have a multiplot xy graph with as an input a range of x values and y values from 5.8 to 6 that are doubles.
However, once the graph is displayed all the y values are rounded off to 6.
I guess it must be a matter of setting somewhere that the values in the graph are not integers, but i can't seem the find it.
I've already changed in graph settings->format and precision->digits of precision to 8 but still i get rounded off to 6?
Where is the magical setting for this?
Solved! Go to Solution.
03-12-2009 06:59 PM - edited 03-12-2009 07:01 PM
There is a coercion dot going to the local variable, so all bets are off. The datatypes don't match. (Also, why is there a breakpoint?)
Why don't you wire directly to the graph terminal instead of a local variable????
Please attach some real code instead of an image. We can't tell much from an image....
03-12-2009 07:13 PM
There wasn't really a reason why i didn't connect it directly. Now that I did it works! Thanks!
However, just to make me understand labview more: why is there a difference between putting the values in a local variable and putting them in the graph itself?
03-12-2009 09:04 PM
The graph autoadjusts to the datatype wired directly to it. If you wire to a local variable, you don't get that feature for good reasons.
Most likely you had an integer wired to the graph terminal at one point in the past and LabVIEW remembered that.
The first choices should always be to wire directly to the terminal. Don't think of local variables as "variables" in text based code, they are not and should not be used as such. Local variables break dataflow, can cause race conditions, complicate debugging, and force extra data copies in memory (can be very expensive for xy graphs!), so there is a big difference. Local variables should only be used if there is a very good reason.
(See also this link and many other similar discussions) 🙂