LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

graph values rounded

Solved!
Go to solution

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?

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

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....

Message Edited by altenbach on 03-12-2009 05:01 PM
0 Kudos
Message 2 of 4
(2,729 Views)

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?

0 Kudos
Message 3 of 4
(2,721 Views)
Solution
Accepted by topic author _blackadder_

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) 🙂

Message 4 of 4
(2,705 Views)