LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

enum to string

Solved!
Go to solution

@jorge Amaral wrote:

But do you think that it's better to use your way instead of our (performance/memory)? Cause, I prefer to use one property node instead of using one enum local variable connected to "format into string"

Why do you need to use a local variable? What's wrong with a wire?

In terms of performance/memory, using the Strings[] property node forces you to
  1. create an array (extra memory)
  2. use a property node, which causes a switch to the user thread (performance hit)
So, yeah, I'd say that's poorer performance.
0 Kudos
Message 11 of 34
(2,759 Views)

find this attachments,

the value i will give on which i specified in items, thats corresponds it should give output string

 

Regards,
Balaji DP
0 Kudos
Message 12 of 34
(2,760 Views)
A ring is not the same as an enum. If you want the string corresponding to a selected item for a ring, then you have to use the Strings[] property has Dennis showed, or use the RingText.Text property.

EDIT: The above instructions assume you're dealing with a control. If you have a constant on the block diagram, then you cannot do this.

I think you may need to spend some time with the LabVIEW tutorials. To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.




Message Edited by smercurio_fc on 07-10-2008 09:23 AM
0 Kudos
Message 13 of 34
(2,751 Views)

OK.

Thanks for the reply.

Local variable - i was mentionig the case where we ADD to use the information in a place where "wire" can't be applied.

property - cause i was thinking that he wanted the entire array of strings. Not only one value.

 

Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 14 of 34
(2,742 Views)
Hi all,
just to put in my two cents, this property "RingText.Text" also exists for Enums in LV 8. But as mentioned earlier, this doesn't work with constants, so the upper method Dennis introduced should be the most elegant way.

Greets, Dave




Message Edited by daveTW on 07-10-2008 04:41 PM
Greets, Dave
0 Kudos
Message 15 of 34
(2,729 Views)

Hi Jorge,

There is one more complication with uisng the property node approch. In LV-RT the FP are stripped from the VI's. With no FP there is no access to the property nodes.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 16 of 34
(2,720 Views)
My comment about this not being possible with constants was that nothing that had been suggested regarding property nodes could be used with constants since you can't create a property node for a constant. This is what the user seems to have, based on the screenshot they eventually posted.

Isn't it amazing how a little piece of information that should have been mentioned at the outset completely changes the question? It never ceases to amaze me how many times this happens on these forums.


0 Kudos
Message 17 of 34
(2,715 Views)
I agree smercurio.  And then the proposed solutions don't make any sense or they don't work.. 😞
0 Kudos
Message 18 of 34
(2,710 Views)
Just to be clear, I wasn't criticizing the people who responded, as I would have responded in the same exact way, based on the original question.

Once we see that the user actually has a constant, that's when we all say "Oh, that's different!". Smiley Very Happy
Message 19 of 34
(2,698 Views)


There is one more complication with uisng the property node approch. In LV-RT the FP are stripped from the VI's. With no FP there is no access to the property nodes.


I doubt that, with RT you can have FP's, remote panels and web pages use these.

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 20 of 34
(2,657 Views)