Jump to content

How to place a non running vi in the hierarchy


viSci

Recommended Posts

I'm upgrading a bunch of 7.0 code to 8.6. When I load a 7.0 VI that uses a case structure with a constant on the block diagram to disable code, LabVIEW converts the constant to a hidden control and reports a warning while opening.

I think a constant causes the contents of the unused case to be optimized "out". If you're creating a new VI in 8.6 and have used a constant, maybe converting it to a hidden control will help...

Link to comment

QUOTE (asbo @ Dec 19 2008, 04:37 PM)

Disable structures work great for this.

With LV 8.0 I remember having some troubles with the disable diagram structure.

Code was executing quite slower and I had some issues when building applications, maybe these issues have been fixed since then though.. Have you ever had these problems ?

Link to comment

QUOTE (asbo @ Dec 19 2008, 10:37 AM)

Right - but code in the disable structures is discarded at compile time.

QUOTE (Antoine Châlons @ Dec 19 2008, 10:47 AM)

Code was executing quite slower and I had some issues when building applications, maybe these issues have been fixed since then though.. Have you ever had these problems ?

Nope - I have no issues when using the diagram or conditional diagram disable structures.

Link to comment

QUOTE (Antoine Châlons @ Dec 19 2008, 07:47 AM)

With LV 8.0 I remember having some troubles with the disable diagram structure.

Code was executing quite slower and I had some issues when building applications, maybe these issues have been fixed since then though.. Have you ever had these problems ?

Code runs fine in LV 8.5.1 and 8.6 and under RT as well for both versions with diagram disable.

I have a strange bug where one of the IMAQ VI's causes an RT build to fail, so I have diagram disabled that VI (since it is not used currently in the code). Bug has been reported to NI.

N.

Link to comment

QUOTE (sachsm @ Dec 19 2008, 09:50 AM)

I recall that we used to just place such a vi in a the non-executing state of a True/False case structure, but LV seems bent on optimizing

out this 'non-running' code. I had to be creative to fool it. Just curious what others have found.

You can also put the VI in a static VI Refnum.

Link to comment

QUOTE (sachsm @ Dec 19 2008, 07:50 AM)

I recall that we used to just place such a vi in a the non-executing state of a True/False case structure, but LV seems bent on optimizing

out this 'non-running' code. I had to be creative to fool it. Just curious what others have found.

The canonical solution is the static VI reference, introduced in the same version that the case structure optimizations went in.

And, for the record, if you change the constant to a control then LV won't optimize it out -- at least, not in any version of LV that has shipped yet. It is entirely possible that LV could decide in a built application, where the Front Panel has been stripped out, if the bool is not on the conpane, then the case structure could be optimized. Not that I'm saying that change is coming... I'm just saying that you probably want to use a static VI reference.

Link to comment

QUOTE (Aristos Queue @ Dec 20 2008, 03:38 PM)

The canonical solution is the static VI reference, introduced in the same version that the case structure optimizations went in.

And, for the record, if you change the constant to a control then LV won't optimize it out -- at least, not in any version of LV that has shipped yet. It is entirely possible that LV could decide in a built application, where the Front Panel has been stripped out, if the bool is not on the conpane, then the case structure could be optimized. Not that I'm saying that change is coming... I'm just saying that you probably want to use a static VI reference.

I don't know how to tag your post, but I feel compelled to do so...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.