07-01-2013 06:32 PM
Hi all,
In my Labview program, I am calling a few times a VIT. The VIT creates a graph and set the Xmin and Xmax thanks to a couple of property nodes. The values of those nodes are dynamically set and are inputs of the VIT.
When I run the program and call the VIT 3 times for example, the first "clone" shows the correct X axis but the two other "clones" show a X axis complety off but always the same. Obviously, I have checked that the inputs for the Xmin and X max are correct. As a proof, if I stop the second and third clone and re-run them right away, the X axis is then correct. Therefore, I suspect that the 3 "clones" share some RAM space together (whereas I want them to be completely independant from each other).
I have tried to change the VI properties as shown here, but that did not change anything:
http://digital.ni.com/public.nsf/allkb/98847B4E4C715E6D86256C59006B57CC?OpenDocument
I have also tried to change the options of the Open VI reference function, but then no graph at all is displayed:
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/open_vi_reference/
I'm sure it is somehting stupid but I can't figure it by myself. I can post a VI file if it helps.
Thanks
07-02-2013 02:49 AM
I've had similar problems when i used an array of graphs, it didn't update properly. Try adding a Invoke -> Force redraw in the VIT after setting the values.
/Y
07-02-2013 08:32 AM
I've had similar problems when i used an array of graphs, it didn't update properly. Try adding a Invoke -> Force redraw in the VIT after setting the values.
Thank you for your answer Yamaeda.
Why would you put the Invoke after settings the values? I would tend to think it is better to have it before.
I tried what you suggest (after and before setting the values), but sadly the issue still remains. I also added an Invoke -> Reinitialize To Default with no better result.
07-02-2013 09:10 AM
Hey MattWSU,
Are you using an XY graph? If so, make sure you are setting your Y axis before your X axis. If you set your X axis before your Y axis it will reset the X axis when you set the Y axis. It is an inconvenience but it is due to the algorithm that tries to make the graph plot look good.
If it is not that, could you post your VI? I will take a look.
07-02-2013 10:12 AM
I think I have narrowed down the problem. It seems that whatever the situation, the clone has to run twice to display the correct X axis. I realized that by creating a VI from the VIT (see attached). If the user changes the X min and/or X max in the VI, the VI has to be run two times to be able to display this correct X axis.
Now, I feel like the problem is even simpler than I thought, but I still can not figure it out...
Are you using an XY graph? If so, make sure you are setting your Y axis before your X axis. If you set your X axis before your Y axis it will reset the X axis when you set the Y axis. It is an inconvenience but it is due to the algorithm that tries to make the graph plot look good.
If it is not that, could you post your VI? I will take a look
Thank you Peter for taking a look at my issue. I'm actually using a Waveform Graph. Just to be sure, I tried to set the Y axis before the X axis (see attached), but that does not change the situation.
The VI is below.
Thanks!
07-03-2013 09:34 AM
Any idea?
Thanks
07-03-2013 11:14 AM
Hi MattWSU,
So I am still looking at clear definite solution because this is a very odd problem but if you need a quick work around you could always put the property node that sets the X-axis in a for loop that iterates twice before moving on.
07-03-2013 11:28 AM
Alright, i've got it to work!
Based on the "Set y before X"-tips i did some testing, and it seems you also need to set the scale maximum before the minimum.
/Y
07-03-2013 12:31 PM
Hi MattWSU,
So your problem is coming from wiring both the X minimum and the X offset to the same value in the property node. You shouldn't need the offset since you are already setting the X-min. I went ahead and attached your code that I modified.
07-03-2013 12:33 PM
I didn't see you just replied before I posted, but still if you keep it how it was and get rid of the offset, it will work on the first iteration. Good to hear you resolved the problem!!