LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Line Feed in Enum Item Name? (plus question on Property Node)

Solved!
Go to solution

I am not sure what is the sense of allowing enum item names with line feeds in them (\n):

 

ScreenHunter_004.jpg

 

it's easy to do by directly editing a constant on the BD or a control on the FP, but somehow it is not if you use the contextual menu "Edit Items..." which pops up the Properties Dialog Window.

 

As a subsidiary question, if I try to do this programmatically:

 

ScreenHunter_006.jpg

 

it fails with this error:

 

ScreenHunter_007.jpg which simply means ScreenHunter_008.jpg

 

Is this for scripting purpose only (never used scripting before)? If I turn off the "Show Scripting Methods, etc" option, it is still available though...

0 Kudos
Message 1 of 6
(3,192 Views)

It has nothing to do with scripting.  The item names on an enum are part of the data type and thus can only be changed at edit time, not run time.  If you want to do this programmatically, you need to use a reference to an enum in a different VI from the one which is executing.  I have not tried it, so no guarantees.

 

Lynn

0 Kudos
Message 2 of 6
(3,183 Views)

What is a Property Node that can only used at Edit time good for?

Or to be more specific, can someone show me how the enum PN shown above can actually be used at EDIT time?

🙂

I guess what that is supposed to mean is not that PN is usable only at edit time, but that an ENUM can only be modified during editing (and certainly not using that PN).

Maybe it's worth changing the wording of that error message, so that narrow-minded people like me go into a tail-spin trying to make sense of something that is just poorly worded...

 

0 Kudos
Message 3 of 6
(3,169 Views)
Solution
Accepted by topic author X.

This sort of property node is useful if you are using LabVIEW to write LabVIEW.  The primary example of this is the DAQ Wizard, but things like the JKI Right Click Framework also do it.  You usually run into them when writing development automation tools.  For example, this particular node would be useful in a tool which converts a string-based task handler to an enum-based task handler.

 

You can find the complete properties of each property and method in the LabVIEW help.  This includes whether or not it will work in the run-time or edit-time environments.  The enum is an interesting case which confuses many.  Changing an enum's strings changes the code.  Most people who want to change the enum's strings at run-time should be using a ring or listbox, instead, since you can change their strings at run-time.

Message 4 of 6
(3,159 Views)

So basically, it is used for scripting (writing code programmatically), as I supposed?

Anyhow, any comment on the multiline enum strings? Looks odd to me...

0 Kudos
Message 5 of 6
(3,149 Views)

Back when I used to use enums in GUIs, I sometimes used a two line enum for space reasons.  However, I usually only use them on block diagrams now, where I am more interested in space efficiency, so have not used a multi-line enum in a long time.  They have been that way as long as I can remember (I have been using LabVIEW for 19 years).  I think multiline enums are a valid option, but not one that should or would be used much.

0 Kudos
Message 6 of 6
(3,126 Views)