You May Not Know

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: New Structures in LabVIEW 2016

Jacobson-ni
NI Employee (retired)

Before we get into the specifics of what was added I wanted to go over how this information was found. If you frequent the LAVA forums or attended Hooovaah's NIWeek presentation on Xnodes, you may be aware of the Type Enable Structure. This is one of the structures added in LabVIEW 2016 and was introduced by Jeff K himself on the LAVA forums. Because this structure was not added to any palettes I decided it may be helpful to create a right-click plugin to script one for users who were interested. The snippet below shows one way to create a Type Enable Structure in a specific VI.

 

Create Structure.png

 

The Type Enable Structure does have a style but is missing a class specific to it. What interested me was that while there wasn't a child class of Structure specifically for the Type Enable Structure, there were a few classes that I had not seen before and were not in 2015 SP1. These new classes all had styles which shared the same name so I decided to script them all and see what happened.

 

Type Enable Structure

 

This is the only structure that seems to have any working functionality. I'll probably write a more detailed blog about VI Macros and this structure specifically but Jeff K describes the functionality of this structure by saying (taken from the LAVA post linked above):

 

"When an instance of the macro is inlined and types are propagated to the inputs, each subdiagram attempts to propagate types; the first subdiagram (in subdiagram order) which successfully propagates types without any errors is enabled and all the others are disabled; the enabled subdiagram is the one which is compiled for this instance of the macro."

 

It's a bit hard to describe in simple terms (which is why I was planning to write an entire post about this) but a VI Macro is a tool which lets developers create a subVI which will adapt to any inputs you give it. What is important to know is that just because an input will adapt to any input type does not mean it will run. This structure would give you the ability to write a macro whose functionality changes based on the data types of it's inputs.

 

Type Enable Structure.png

 

Target Structure

Unlike the type enable structure, the target structure has context help which describes the intended functionality. According to the context help, the target structure "contains code deployed to the target described in the subdiagram label". There is a specific class for this structure, TargetStructureNode, but there weren't any properties or methods specific to that inheritance level.

 

Target Structure Snippet.png

 

I only played around with this structure for a few minutes but wasn't able to see any interesting behavior.

 

Closure Structure

I don't have a snippet for this structure because LabVIEW will not save a VI or create a snippet which contains a closure structure without an error. You can make this structure for yourself by taking the first snippet in this post and changing the style to "Closure Structure". If you do want to try this for yourself, I will warn you that trying to resize the created structure will immediately cause LabVIEW to crash.

Closure Structure.png

As you can see in the context help above, the structure claims that it "Contains code for an anonymous VI such that the viref can be called later". As with all the other structures, the ClosureStructureNode class does not have any additional properties or methods which may give more clues to its use.

 

Race Structure

 

You may have noticed that there isn't a VI snippet or even an image of this structure. LabVIEW 2016 did add the RaceStructureNode class and Race Structure style but trying to create a VI object using these parameters will crash LabVIEW before it is able to draw the object.

 

Matt J | National Instruments | CLA
Comments
flarn2006
Member

race.png

Found the context help image for the race structure in labview.rsc

flarn2006
Member

Looks like there's been more work done on these!

Not pictured: the Race Structure now has a description in the context help as well. It says "Contains diagrams that execute in parallel with the first to complete terminating the others." You can't actually add subdiagrams, but there are unimplemented properties/methods for that. The "in" and "out" on the Closure structure were placed via the context menu, "Add Input" and "Add Output".

structures.png

 

target_race.png