From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange VI behavior after switching tab pages in tab control (even though no code is executed after switching pages)

I need some help debugging a strange problem with tab control.

I have a test VI that I made to illustrate the problem I am having that I cut way down in size from an actual VI we use here. But I think the size is still too large for an attachment here so anyone that is interested in looking at this, please email me and I will send you the file or put it on ftp server.

The architecture I am using is an event-driven state machine with a tab control based user interface. The main tab control also has a second and third level of nested tabs on the last page entitled "Locations Compare." We use this tab page to compare underlying data from different points on an intensity graph labeled "dbloss image".

The problem that I am having is this. When I move the cursor on the intensity graph and choose 'select location,' it triggers an event structure case to execute code ('select location, value change) that puts some dummy data in 3 XY plots on 3 successive tab pages of the most nested (3rd level) tab. One can select up to 4 locations, and data for all locations will be displayed on these plots along with associated changes in the plot legends. All works fine if I stay on the same tab page (on the most nested tab page) and choose the 4 locations. However, if say, after selecting 2 locations, then switching tab pages on the most nested tab, then selecting another location, and switching tab pages again, you will see that the plot legends and the XY plot colors are no longer consistent from plot to plot. Here is the crux of the issue: when switching tab pages, no events are triggered and no code is executed. Thus, I cannot figure out an underlying reason why the bug is occurring.

Anyone who wants to look at this, please let me know. Thanks much,

Don
0 Kudos
Message 1 of 18
(3,234 Views)
It's hard to tell without seeing the code.
Can't you cut it down to have just that part with nothing else? Would that affect the behavior?
Are you sure the file is too big? It may take some time to upload, but you can easily load a file up to a few MBs.
It seems to me that a file with a tab and a few graphs should not be too big.

___________________
Try to take over the world!
0 Kudos
Message 2 of 18
(3,215 Views)
Your VI is a bit hard to start following for someone who doesn't know it.
If you think this problem is a bug, it would be better if you can reproduce it in a smaller VI.
Alternatively, it would be good if it had some more documentation to say what each part does. Try placing comments on the FP as well explaining what the proper behavior is and what should be done to see the problem.

That said, I did give it a quick run. As far as I can tell, it generates 4 plots on the tab page you're on and 2 plots in the other pages. It's quite possible this isn't so. I only ran it a couple of times and it crashed LV (I used highlight execution). I also recieved several errors from the property nodes. I didn't look into them, but maybe they're also part of the problem. I will try to look into it again when I'm feeling better (probably not anytime soon). In the mean time, maybe someone else can help. Also, you can try making the problem more "user friendly" by following those suggestions.

Hope this helped, at least somewhat.

___________________
Try to take over the world!
0 Kudos
Message 4 of 18
(3,192 Views)
I appreciate you taking a look at it. I reduced the LLB from its original size of over 14 mbyte to 0.7 mbyte. That should tell you how much I cut it down.

HERE IS AN EVEN SIMPLER VERSION SO ANYONE WHO WANTS TO TRY SHOULD THIS SHOULD USE THIS ONE. NEED AN NI EXPERT HERE TO LOOK AT THIS STRANGE BEHAVIOR I THINK.

YOU CAN TEST IT IN 30 SECONDS TO SEE WHAT I AM SAYING

The architecture is very simple; it is just a state machine using event structures. Don't worry about any of the tab controls but the lowest (3rd most nested tab). I left the nested tab structure in there because it might hold an important clue for NI to figure out what is going on here.

I have no idea why you are getting crashes but just following these simple steps.

Run VI

Procedure A:

Move cursor on dbloss image to new location.
Hit 'Select Location' Button
REPEAT 4 TIMES
Check XY plots on all 3 pages of 3rd level most nested tab. They should all have consistent color plots and all legends should be visible.


Procedure B:

Move cursor on dbloss image to new location.
Hit 'Select Location' Button
REPEAT TWICE.
Change tab page of 3rd level most nested tab to 'I vs. t (insp)' page
Move cursor on dbloss image to new location.
Hit 'Select Location' Button
Change tab page of 3rd level most nested tab back to 'DBloss vs. I' page
Move cursor on dbloss image to new location.
Hit 'Select Location' Button to give a total of 4 plots

Check XY plots on all 3 pages of 3rd level most nested tab. They DO NOT have consistent color plots and legends. WHY? The event structure is not triggered when I change tab pages so no code is executed yet that action seems to be messing this operation up.

Any Help is appreciated.

Sincerely,

Don
0 Kudos
Message 5 of 18
(3,183 Views)
ps. I hope you feel better!!
0 Kudos
Message 6 of 18
(3,184 Views)
Oh yeah, prior to running procedure B, hit the 'Reinitialize' Button to clear the XY plots....thanks, Don
0 Kudos
Message 7 of 18
(3,184 Views)
As before, I think you should narrow it down more. Everything you can get rid of and still have your problem, get rid of. If the outer tab control isn't part of the problem, get rid of it. The best bug report is the one you can rebuild from scratch.

That said, I only had one crash, because I ran the VI in highlight execution, but I also kept getting errors 1077 (invalid property value) and error 1055 (invalid reference) from the nodes inside your for loops. I understand the second one (the plot ref is invalid), but I don't know where the first one came from. You don't have these errors at all? They keep popping up when I run the VI. Maybe you have auto error handling disabled. I don't know if they have anything to do with your problem, but just in case - that might be the answer.

___________________
Try to take over the world!
Message 8 of 18
(3,181 Views)
I do have the automatic error handling disabled and that is because usually I control all the error handling in my code as you can see from the error case in my code. However, in this case, I was not vigilant about running all error clusters to my subvi entitled "Event to generate1.vi" which in my true code I have in every event case and sends errors to my error case.

When I enable automatic error handling, then yes, I do get those same errors you got. Sometimes these errors are irrelevant but I can look into this. It is just strange that everything works properly (which you can verify) if you do not change tab pages.

Sincerely,

Don
0 Kudos
Message 9 of 18
(3,180 Views)
Hi Don,

I took a quick look at the code and have to echo tst's comments re:trying to narrow things down.

Theories that may help.

1) I have seen issues with firing events within events.

2) I do not think the images on on non-viewed tabs is updated (I hope, I hope). If you are relying on the FP objects to be updated, this could casue an issue.

These are just my first thoughts.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 18
(3,174 Views)