LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to reset XY Graph when used in a Sub-VI. Able to reset XY Graph when no Sub-VI is used.

Hello,

 

Let me preface this by saying that I am a novice LabVIEW user.  I am currently using LabVIEW version 8.0.

 

I am having difficulties with properly resetting an XY graph when dealing with sub-panels.  I am sure that there must be something really straightforward that I am overlooking but I've tried everything that I came across when searching for this problem and have not been able to solve it.

 

In essence I have 3 VIs being used simultaneously:

A: The "Front Panel" VI which has radio controls to swap between various sub-panels

B: The "Sub Panel" VI which corresponds to the user-selected radio control and appears in the sub-panel to the right

C: The "Real Time Graph" VI which is the graph you see in the center of the rightmost subpanel.

 * I had to implement this graph in a sub-panel method because I could not find a solution to display the sample acquisition data in real-time as data would not be sent up the VI heirarchy until the entire scan was  completed. *

 

The "Real Time Graph" VI has coding which feeds an empty array into the XY Graph so that it resets after every iteration.  This works great when I use the "Sub Panel" VI (B) without using the "Front Panel" VI (A) and even when running (B) continuously I do not run into any issues with clearing the graph.  However, when I attempt the same thing but by using the "Front Panel" (A), the XY Graph will not reset and I get overlapping data points constantly.  I have fiddled with multiple potential solutions and have not been able to solve it.

 

I recently experimented with Call Setup: "Reload with each Call" and found that the graph did successfully reset this way but it prevented me from being able to properly interact with the sub-panel (i.e. changing values, etc).  My initial assumption was that it had something to do with open references but it seems like thats not the case as using (B) -> (C) without (A) while on "Run Continuously" successfully reset the XY graph.

 

I hope this is not confusing and thank you so much for reading this far.  I have attached a front panel diagram and a block diagram to hopefully better illustrate my setup.

 

screenshot.4.png

screenshot.5.png


Please disregard the notes that are included in the images as they are not accurate.

 

Thanks so much for reading this,

Regards,

torm

Download All
0 Kudos
Message 1 of 7
(3,222 Views)

 

Torm wrote:

Unable to reset XY Graph when used in a Sub-VI. Able to reset XY Graph when no Sub-VI is used.


If your sub VI contains a loop then remove it and try again.

 


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 2 of 7
(3,216 Views)

Please post your code.

 

SubVI is different from sub panel. You are calling the vi in a sub panel container. You are not calling it as a sub vi.

 

In your front panel VI, you are repeatedly inserting the vi into the sub panel.

suggest you to use event structure inside your case structure. Have one case for the event, where the event is detected for which ever radio button is pressed, then the second case where you insert the respective vi into the sub panel.

 

This will ensure that the vi is inserted only when the event is generated.

 

also, are you sure your 'sub panel VI' is running when loaded into the sub panel? If it is not running, then place a 'Run VI' invoke node next to the insert node.

 

See the attached code. This is a code modified for you from my current project. so, the names may not be relevant.

 

Run the dynamic call vi, befor which, ensure that the static vi reference inside this vi is selected for the correct path of test dll calls vi.

 

Regards
Freelance_LV
TestAutomation Consultant
Download All
0 Kudos
Message 3 of 7
(3,206 Views)

Thank you for your quick replies,

 

I was only able to get back to it now and have tried what you have recommended.  When I used the event structure method I was able to switch between sub panels without a problem but when I tried to click any buttons on those sub panels the program would not respond to them.  It would show the buttons in the "button down" mode but no action would result.  The VIs that you added are in a version higher than what I can open.  As I mentioned, I am using LabVIEW 8.0.  I do believe my VIs are indeed running as I am able to interact with them without a problem.  The problem I have is that for whatever reason the graphs wont reset when accessed through this front panel (A).  I believe that the culprit must be a mistake I have made in the front panel block diagram as I don't have any problems with it when using just (B) and (C) (as explained in my first post).  I have attached my front panel VI in the state prior to experimenting with the event structures.

0 Kudos
Message 4 of 7
(3,175 Views)

Since I have not looked at the code I can not rule a coding error... but...

 

If it does not look like a coding error try searching this site for "Jiggle the handle" to see the various threads where we discussed getting graphics to update in some of the 8.X versions of LV.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 7
(3,159 Views)

Hi

 

I have attached the vis again for LV 8.0. Check them

Regards
Freelance_LV
TestAutomation Consultant
Download All
Message 6 of 7
(3,147 Views)

Hello,

 

I was able to determine the problem preventing me from resetting the graph.  It appears that the Front Panel (A) was keeping both (B) and indirectly (C) in memory which was preventing the graph from properly resetting.  What I did to fix this was I changed the way that the Sub-vi (B) called on (C) from "Load and Retain on First Call" to "Reload for Each Call". (More info here: http://digital.ni.com/public.nsf/allkb/387EF1BC4762A96C8625713B007E0032)

 

This allowed the graph to presumably properly leave memory and be recalled as needed.

 

Thank you everyone for your help in trying to solve this issue for me! 

0 Kudos
Message 7 of 7
(3,133 Views)