Actor Framework Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

AF Sequence Diagram Logger

Attached is a debugger/logger that I put together that I hope will end up being pretty useful in my own actor framework designs... and hopefully for you too (: One of my main gripes with the Actor Framework is how hard it is to follow the flow of the program and hopefully this will help some.

In essence, I wanted to have something that looks like a UML Sequence Diagram that is updated as messages are being sent. Columns are generated the first time an Actor is spawned and then the lifelines of the Actors are generated and terminated in their column.

Hopefully this is a good step towards what AQ mentioned on the DEBUG fork page. I would love if I didn't have to do it all in a multi-column listbox but it was the best I could come up with.

I am using Actor Framework 4.1 and it is all in LV2012.

To use:

1. Have LV 2012, Actor Framework 4.1 and the DEBUG fork

2. Unzip into a location of your choice (I have mine in the user.lib).

3. Open <vlib>\ActorFramework\DEBUG\DEBUG Actor\Launch Debug Actor.vi

4. Modify the path to point to the AF Sequence Diagram Logger.lvclass that you just unzipped.

5. Run "Launch Debug Actor.vi"

6. Run the program that you want to monitor.

Note: In order to work properly, the actors all need to be named. I changed the “Actor Name” input of the Actor Framework.lvlib/Actor.lvclass/Launch Actor.vi to be required so that I was forced to give names to all of the actors. This will keep the "Sequence Diagram" Lifelines understandable and working properly.

Version 1.0

Through the right-click menu you can do the following:

1. Change the color of the message that is right-clicked on (based on the name of the vi called in the do.vi)

2. Choose to ignore the message that is right-clicked on in the future (useful if you have some logging or acquisition that repeats messages)

3. Open any of the vi's that are on the call chain to the message vi. (a convenient way to open higher level actor clone.vi's)

4. Manage the lists of colors and ignored messages

5. Abort all VI's (code from the default logger)

Known bugs:

1. Not currently filtering out messages from the Logger, so when you right-click or double-click etc, that gets added to the Default Lifeline. (Version 1.0)

2. It can't keep up with a lot of messages. I tried it with the Measurement System example and it was able to keep up fine. I tried it with Simon's Windows 8 UI Demo  and it couldn't keep up until after I added many of the UI updates to the Ignore messages list. I haven't done any extensive testing to see how long it will take to bog down when watching a framework with a lot of messages. Unfortunately it might not take too long because in order to have the right-click options available I have data tied to each row in the MCL which would grow to a very large array over time. If there is interest and it does start bogging down for people, let me know and I will add a no-right-click menu version with less overhead.

Version 1.1

1. Now filters out messages from the Logger

2. Includes arrows pointing to the message recipient

3. Export to PlantUML. This generates a very basic diagram with a title of your choice. It doesn't show any messages being "received," but sequence diagrams don't really show messages being "received" so I left that out. Also, I just used brute force and no finesse in the coding because I was mostly just figuring out how difficult it would be. I plan on working more on this in the near future but it seemed useful enough in its infancy to warrant an upload.

4. Change font size. When I opened this on a new computer, the font was off and caused the arrows to not line up nicely. I added the ability to change the font size so that it can be optimized on a given computer so that things line up correctly.

-Carl Wecker

Comments
Sleepy_Engineer
Member
Member
on

FWIW, I have my code in a repository on bitbucket if anyone is interested in seeing the latest versions. I have added some additional color options (table and header backgrounds and ability to change default message colors) and I did add some arrows between the message sender and recipient:

AF SD Measurement System Screenshot.PNG

trustautomation
Member
Member
on

In the current repository, there is a problem in the lvlib with the Set Event Color Msg.lvclass. It is missing the Select Color Dialog.vi

Missing member of library.png

Sleepy_Engineer
Member
Member
on

Hmm, I couldn't tell that it was missing, so I moved the button a hair, re-saved it, and then committed it with a couple of changes I had made earlier. Please let me know if it still isn't there, and thanks for checking the program out (:

-Carl

Patur
Member
Member
on

Hi Carl

Great tool you've created. This is exactly what can make life so much easier debugging/documenting AF-designs.

I don't know if I'm missing something, but the columns aren't generated when I try to run the AF Sequence Diagram Logger against the Measurement System.

Steps to reproduce:

  1. Modify the Debug Actor path to ...\AF Sequence Diagram Logger\AF Debug Logger - Sequence Diagram\AF Sequence Diagram Logger.lvclass
  2. Run Debug Actor
  3. Run Test Step Controller:main.vi


AF_Sequence_Diagram_Logger.png

Any ideas what I'm missing here?

--
Patur Sivertsen Vase
www.hfjensen.dk
Sleepy_Engineer
Member
Member
on

Hi Patur,

Apparently, when I was putting together the instructions above I forgot the step where you need to give all of your actors names when you call the "Launch Actor.vi". The way I did this was to take the "Launch Actor.vi" from the Actor class in vi.lib and make the "Actor Name" input required. I wanted the names that appear in the sequence diagram logger to be easily customizable, and this was the idea i had come up with. I will update the documentation above.

Hope it works well. I just fixed a few bugs and will push the updated version to my repository hopefully later today, which I will also reference in the documentation above (https://bitbucket.org/crwecker/af-sequence-diagram-logger). Any feedback would be wonderful!

-Carl

MattP
NI Employee (retired)
on

Carl, I'm using this to document the Starbuzz AF coffe shop example.  It works like a champ!  Thank you for building this!!

Also, the 'abort all actors' button is my new best friend.

Cheers,

Matt Pollock
National Instruments
Sleepy_Engineer
Member
Member
on

Carl, I'm using this to document the Starbuzz AF coffe shop example.  It works like a champ!  Thank you for building this!!

Awesome. Glad it is working!

Though it is based off of the idea of sequence diagrams I haven't put a lot of thought into using it for documentation of a project, and have just been using it personally as an update to the default debugger logger that is much easier to follow and see who is launching who and to see how different messages are being tossed around. So, if you have any suggestions for what functionality would help out more with documentation, or if anybody wants to help improve this tool, please feel free!

For instance, as LVB mentioned, it would be awesome to output the data to a text file in a format that PlantUML could convert into a UML diagram for documentation. This is something that I want to look into, but haven't had a chance yet.

Also, the 'abort all actors' button is my new best friend.

I am amazed myself at how often I end up using the 'abort all actors.' Thanks AQ!

-Carl

MattP
NI Employee (retired)
on

Comments:

  • Can you change the title bar of the sequence diagram window to something other than 'Actor Core'
  • Providing some way to save the file would make this much more usable.  Taking screenshots works for small sequence diagrams, but larger ones will need an export feature.  A portable format that works with UML tools is much preferred.  If a non-portable format is used, a viewer utility to display the saved sequence so it can be shared with colleagues is useful.
  • The arrow-drawing functionality you mention above is very useful
  • I'd love to have the ability to store a sequence diagram from a 'golden run' and compare subsequent runs against it as a form of regression testing.
Cheers,

Matt Pollock
National Instruments
Sleepy_Engineer
Member
Member
on

Thanks for the feedback!

I've changed the title bar from 'Actor Core' to 'Sequence Diagram Builder' and added the rough ability to output to PlantUML. I plan on working on this more in the next few days, but in case I can't get back around to it right away I thought I'd publish what I had in case it helps anyone out in the meantime. A sample .png generated from a plantuml text file I generated after opening and then closing a newly created "Measurement System" is also in the .zip file.

-Carl

Patur
Member
Member
on

Now with arrows - great stuff Carl

--
Patur Sivertsen Vase
www.hfjensen.dk
Elijah_K
Active Participant
Active Participant
on

Woah!  Where have I been?  Can't wait to give this a try

Elijah Kerry
NI Director, Software Community
AristosQueue (NI)
NI Employee (retired)
on

Elijah: Doesn't work with LV 2013. Need to update the Debug fork. This is part of why I was so interested in the Monitored Actors. With those, we could build this same tool and not have to rev it every time we change the AF library.

Elijah_K
Active Participant
Active Participant
on

Yes, that would be great!  Is someone already working on that?

Elijah Kerry
NI Director, Software Community
AristosQueue (NI)
NI Employee (retired)
on

Let me check my assignment sheet... no... no one's claimed that job yet. Should I put you down as the interested party? 🙂

Contributors