LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Independant VIs from a VIT

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

0 Kudos
Message 1 of 13
(3,443 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 13
(3,422 Views)

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.

0 Kudos
Message 3 of 13
(3,408 Views)

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.

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 4 of 13
(3,396 Views)

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!

 

 

0 Kudos
Message 5 of 13
(3,390 Views)

Any idea?

 

Thanks

0 Kudos
Message 6 of 13
(3,362 Views)

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.  

 

 

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 7 of 13
(3,353 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 13
(3,349 Views)

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.

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 9 of 13
(3,343 Views)

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

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 10 of 13
(3,342 Views)