Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Daemon Creation Tool

Contestant Info:

Jonathan M. Kokott

jmkokott@gmail.com

Milwaukee, WI

User Group Affiliation:

Wisconsin Milwaukee Area Group.  Not listed in all groups, we are coordinated by Chris Nelson and have had only one meeting.

Summary:

This Labview scripting tool takes a standard VI, and creates a wrapper around it to launch it as a daemon. This is useful for creating inline code modules that need a process to run in the background.  Accessible through the tools menu option.

Features:

  • Daemons will abort when the top level VI is aborted.
  • Daemon can be aborted by closing the "Daemon Owner" VI refnum.
  • Daemons obey source VI properties such as open front panel when called.
  • Host process can be reentrant or standard.
  • Tool places created daemon in idential project location.
  • Tool will not alter the source VI in any way.
  • Tool will run only in case "No Error" if an error cluster is provided by source VI

Steps to execute code:

  1. Run Setup.vi and restart labview.
  2. Open a VI that you would like to turn into a daemon VI.
  3. Select tools-> Create Daemon from VI...
  4. A daemon version of the VI will come up.

Screenshots:

Accessing the tool:

StartDaemon[1].JPG

Main Block Diagram:

LaunchDaemonCase.JPG

Run Target VI Case:

StaticCall.JPG

VI Snippets

launchCaseDoucmented.png

Future Round Teaser:

Future Daemon Call.png

In later rounds I'll replace the scripted tool with a block diagram node which will run any static VI reference as a daemon.  It will be identical to programming a call by reference node, but it will not wait for the VI to finish...

Zipped project attached below.

note:  This code was originally submit to the www.lavag.org code repository on 2-25-2011.  I consulted the NI rep governing the rules of this contest and this code has met the submission criteria.

------------------------------------
Jon Kokott
CLA, CLED, CTD, MCP C#
Comments
G-Money
NI Employee (retired)
on

Good code! Could you add some documentation to your block diagrams so it's easier on other programmers to quickly look and read what is going on and why. Thanks!

peter_smith
Member
Member
on

Hi! May I ask where the property nodes regarding the connector pane come from?

Nice functionality by the way!

Jon_Kokott
Member
Member
on

Property nodes regarding connector pane?

The connector pane of the daemon launcher is set from the  connector pane of the source VI, it is scripted.

Open the .lvproj file in the zip and look at the test create.vi (or simmilar, i forget what i called it.)  Follow the comments in the code and things should be a little more clear.

------------------------------------
Jon Kokott
CLA, CLED, CTD, MCP C#
Jon_Kokott
Member
Member
on

replicateConpane.png

These are scripting property/invoke nodes.  You must have scripting enabled in your labview environment to see them.

------------------------------------
Jon Kokott
CLA, CLED, CTD, MCP C#
G-Money
NI Employee (retired)
on

Here are the steps (https://www.ni.com/docs/en-US/bundle/labview/page/enabling-vi-scripting.html) to turn on VI Scripting in LabVIEW 2010. VI Scripting has been an internal tool for many years but with LabVIEW 2009 we made it available as a ni.com/labs download. Starting with LabVIEW 2010, VI Scripting is now shipping with LabVIEW but since it is an advanced topic you add the extra step to turn it on.

peter_smith
Member
Member
on

Thanks, that was the exact piece of code I looked at. In my LV2010 scripting was enabled, but I currently opened your project in 2009. I thought that scripting nodes are blue, as they really are, but these nodes showed up for me as yellow. That's why I did not understand where could you select such elements in prop in invoke nodes. After installing scripting in 2009, now I see them as blue, and of course they are selectable for me too.

Thanks again!

G-Money
NI Employee (retired)
on

For anyone looking for VI Scripting in LabVIEW 8.6 or 2009, here (https://www.ni.com/en/support/downloads/tools-network/download.labview-vi-scripting.html) is the ni.com/labs link for the download. You should be able to download this and then have access to the VI Scripting nodes.

Contributors