Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Subpanels and AF

My question is mostly regarding subpanels but I wanted to ask it here because users of the AF typically are heavy users of subpanels.  I have my main application window which loads other actor's core vi's into subpanels.  As I try to restore the user interface of the application between application runs, some of the actor core vi's that are hosted in the main vi's subpanels have splitter bars that I need to restore.  The issue I'm having is that restoring the splitter bar position results in an error or simply is put it the wrong positon if they window is not fully resized yet to it's finaly value.  I was hoping that someone would have a way to trigger when the actor core vi was finally loaded into the subpanel.  I inititially tried using the pane size event, but for some reason this event doesn't seem to get fired every time at startup, it's as if sometimes the actor core vi's are reused from memory and they are already the same siem.  Anyway, I was hoping for some ideas on how to handle this. 

0 Kudos
Message 1 of 6
(8,002 Views)

Thanks to the asynchronous nature of subpanels, I'm also using AF in a UI. I've been experiencing some weird bugs of my own, and your description of "restoring the splitter bar position results in an error or simply is put [in] the wrong position" sounds eerily familiar:

  • I've been getting VI Server errors and incorrect outputs from Property Nodes when I run the UI several times.
  • Sometimes no errors are thrown, but panes fail to resize or orient themselves at (0,0) as directed.
  • And I have definitely seen subpanel VIs retain their last-run size/position settings against expectations.

They're all Heisenbugs, but they go away if I completely exit LV and reload my project. I haven't tried building my code yet to see if they persist in the RTE...I have a (probably blind) suspicion that references to my Actor Core.vi clones aren't being cleaned up, and the stale refs are causing the errors. No way to prove it though, even with AQ generously trying to help out one afternoon.

How certain are you that the cause of your buggy behavior is the Actor Core.vi clone not being "fully loaded into the subpanel"? Have you isolated that behavior and made it reproduceable yet?

0 Kudos
Message 2 of 6
(4,810 Views)

I've made the following observations, but never really felt like calling NI because they are hard to reproduce and would almost require me shipping my entire code:

1) I found that I needed to unload subpanels as the application is shutting down, otherwise I would get erratic behavior and vi's would fail to load in the subpanels

2) My application restores floating windows that are receive windows in a protocol analyzer.  There was a loading sequence that would results (erratically 1 in 5 to 10 times) where the window would not accept any events like mouse clicks but when I would load the vi onto the subpanel it would work and then if I unloaded it, again it would work.  Very strange!

3) I created property node accessors for my data members.  Almost everytime I commit my changes to source countrol, the next time I open the VI the property node looses the properties where they all become black text and reselcting one of the properties restores all of them.

Anyway, these were the weird bugs that I discovered as I worked through a large application with AF.  I have managed to work around them and they don't affect me anymore, but I'm still struggling with restoring my application state as I mentioned in my first post.  And to answer your post, there is definetely some reuse of actore core clones that happens between application runs.

0 Kudos
Message 3 of 6
(4,810 Views)

The more I look into this, the more erratic the behavior is.  There is definetely some reuse of actore core.vi when you load the same actor multiple times that is not handled well by the actor framework.  The main issue is as David pointed out, the location of controls within the front panel not going back to where they should.  I also noticed that the controls are initialized with values from other instances of actor core, for example the selected row in a multi column listobox.  I'm gonna try to record my screen tomorrow and post the video of what I'm seeing.

Thanks, and if anybody from NI can comment on what could be happening that would be great.

Jorge.

0 Kudos
Message 4 of 6
(4,810 Views)

To anyone who may be reading this thread, I wanted to point out one final observation.  I did manage to fix my problem.  The issue occurs when you have an actor with subpanels and you load a nested actor into that subpanel.  If you then launch multiple copies of that top level actor which in turn opens various copies of the actor core.vi you have to be VERY carefull to unload the nested actore core vis from the top level actor's subpanels, otherwise, actore core.vi keeps some sort of reference which Labview doesn't handle well.  This only hapens if you load the root actor and close it and then relaunch it within the same application run.  For me this was happening because I was opening and closing multiple "Receive Windows" in my protocol analyzer and closing them as the user saw fit.

In conclusion, override your stop core vi and then unload all your subpanels that you may have in your actor core vi.

Hope this saves someone a lot of trouble, it nrearly drove me crazy.

Message 5 of 6
(4,810 Views)

Anyone reading this thread may also want to look at this other post:

https://decibel.ni.com/content/thread/15491?tstart=0

0 Kudos
Message 6 of 6
(4,810 Views)