Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to probe private data of actor when running?

Solved!
Go to solution

A book is a good idea...  If you want a collaborator, let me know!

0 Kudos
Message 21 of 31
(2,882 Views)

I just had a look at the two AF sample projects in LabVIEW 2015, "Actor Framework" and "Feedback Evaporative Cooler".  They could do with improvement to help promote the AF to new Users.  With neither project was it easily possible to open the block diagram of the main running actor.  I had to modify both main actors to allow the BD to be openned.    With "Actor Framework" I had to modify the Run-time menu to allow "Open block diagram, then I set the inputs on the launch of Actors A and B to show front panel.  Easy if you know, but a new person would not know this.  I was pleasently surprised to find I could click on Actor.lvlib:Actor Core and get the right clone (how long has that worked?), and so I could probe the Actor object inside its message-handling loop.   Though I had to make a custom probe to get useful info, as in the Actor message-handling loop is a parent-class wire. I then went after the messages, opening a "Do" method and selecting 'View>>Browse Relationships>>Reentrant Items' to get to the running clones.  Could have used a breakpoint, too.  Didn't need a custom probe here, but then, in the Do methods I may be probing multiple actors, and I'm not probing every message to an actor, so this is not at all an ideal location to probe actor state.

This isn't "Debugging 101".  Simple LabVIEW programs (LVOOP included) are double-click-to-open, ctrl-E, click-on-wire.  Very easy, very quick.   Debugging shared-reentrant clones requires additional knowledge that a lot of developers may not have when first trying the Actor Framework.  I recently introduced non-reentrant actors to my "Messenger Library"; I don't need them myself, but they an easier route in for a new person.

Message 22 of 31
(2,882 Views)

No, it is obviously not "Debugging 101", but it doesn't require a CS degree to debug.  It's at the level of debugging re-entrant code -- something I learned 15 or 20 years ago when I was new to LV.  It's something that beginners aren't expected to know (as with many aspects of LV), but they shouldn't ignore or gloss over it either.

I have never found it useful to probe 'Actor.lvclass:Actor Core.vi'.  My main running actors have several block diagrams; they have several methods, and probing within the methods has proven more useful for me.  (And, as mentioned above, a simple override to 'Receive Message.vi' for an actor will provide the actor's PDC wire for probing every message/reaction without having to resort to opening the innards of the AF.  But I still find it more effective to probe within specific actor methods.)

I have never had to modify actors in any unusual way in order for their methods' block diagrams to open so that I could probe.  This includes the block diagrams of Actor Core overrides (which I find rarely requires probing anyway).  For those actors which I implement an Actor Core override, their FP opens when they're launched -- the purpose of the override is to present a GUI, in nearly every case.  (If I need a "helper loop" for an actor, I prefer to delegate to a second actor, not the Actor Core override.)

It's still not complicated, even with re-entrancy: double-click to open, Ctrl-E, set a breakpoint, run the actor, wait for the BD to open (in a clone, but it's still a BD), probe wires.  Very easy, very quick.

Message 23 of 31
(2,882 Views)

Use "Open Actor Core front panel?" and then when the VI opens, you can double click on the call to the parent implementation to open that clone, and so on, all the way to the actual clone of Actor:Actor Core.vi.

0 Kudos
Message 24 of 31
(2,882 Views)

In my experiments with the AF Sample Projects I impoved my Cyclic Table Probes to show some internal object data (this is "Object Cyclic Table" probe):

 

Evap Cooler, Live User Controller, Actor:Actor Core incoming messages:

Object Cyclic Table in AF.png

Live User Controller Actor object inside Actor:Actor Core:

Object Cyclic Table on Actor.png

I think this is a better method for a new user to explore an AF Sample Project, then having to identify which VI of many to place a breakpoint in, even if it may not be useful to an experienced AF user.

0 Kudos
Message 25 of 31
(2,882 Views)

Just a note on the custom probe I just posted.  You'll see that some of the messages seem to be missing data.  That's actually because they are default data, and the LabVIEW flattening functions don't include a class's data if it is default (the probe uses "flatten to XML" as its way of breaking object encapsulation to query the data).   Confusing, but not easily fixed.

0 Kudos
Message 26 of 31
(2,880 Views)

Anyone try out this custom probe with AF messages?  Useful?  Improvements needed?

0 Kudos
Message 27 of 31
(2,880 Views)

@drjdpowell wrote:

I just had a look at the two AF sample projects in LabVIEW 2015, "Actor Framework" and "Feedback Evaporative Cooler".  They could do with improvement to help promote the AF to new Users.  With neither project was it easily possible to open the block diagram of the main running actor.


Just a nudge, but I checked the "Actor Framework" sample project in 2017 and it is still ridiculously heavily armoured against the uninitiated.  One has to have quite advanced knowledge to even open a running block diagram**.   At the very least, please add "Open Block Diagram" to the menus of the top-level Actor.

 

**Unfortunately, the "click on Actor.lvlib:Actor Core and get the right clone" thing I previously mentioned doesn't seem to work in LabVIEW 2017.

0 Kudos
Message 28 of 31
(2,421 Views)

 <double post deleted>

 

0 Kudos
Message 29 of 31
(2,420 Views)

@drjdpowell wrote:

**Unfortunately, the "click on Actor.lvlib:Actor Core and get the right clone" thing I previously mentioned doesn't seem to work in LabVIEW 2017.


Known issue. Fix will be in the first patch. It's my personal screw up. Sorry.

0 Kudos
Message 30 of 31
(2,388 Views)