Jump to content

Programamtically editing typedef enum or ring strings and values


Tomi

Recommended Posts

Is it possible to programmatically edit typedef or strict typedef enum strings or ring strings and values? Or even for a custom control? It it possible for a VI but that won't help me. I want to write enum/ring string / values by calling a C-function and then writing the result to the enum. This enum will then define the interface to the current version of a specific library, the interface of which cannot grammatically change but the values of the enums may change from library version to another.

Link to comment
Yes I believe this is for representation.

As a side note, the enum ctl has to be idle (not running and not in the call chain) for the string property to work.

PJM

that' correct. i think 8 is for U8, please try it out.

and Ben, the fame does not belong to me! i just remembered, that i asked this question in Q4/2005, too, here in the forum. it was answered by one of the "big old ones" in this forum. unfortunately I could not find the old thread any more and could not remember the name of my saviour, so I posted this example ...

Link to comment
  • 2 years later...

QUOTE (i2dx @ Mar 2 2006, 01:39 PM)

that' correct. i think 8 is for U8, please try it out.

and Ben, the fame does not belong to me! i just remembered, that i asked this question in Q4/2005, too, here in the forum. it was answered by one of the "big old ones" in this forum. unfortunately I could not find the old thread any more and could not remember the name of my saviour, so I posted this example ...

Now how does one summon the great old ones?.... I am trying to programmatically define an enum to use in a type def (the electrical guy keeps adding commands) and I was trying to implement the script show in this thread. The problem I am having is that I cannot find the "Rep" property of the enum class. Does it still exist? Do I actually need it?

Link to comment

QUOTE (tcplomp @ May 13 2008, 09:55 AM)

... an example to change an array of strings into a type-def.

Ton

Good point Ton!

Provided you don't have to change the enums at run time (which you can't in an active VI) you can define values of a ring and then replace the ring with an enum. Provided the enum does not end up being sparse (not all values defined) this makes it much easier to define all of the enum values.

Ben

Link to comment

QUOTE (tcplomp @ May 13 2008, 08:55 AM)

Excellent! Thanks Ton. I'll use that. :worship:

QUOTE (neB @ May 13 2008, 09:01 AM)

Good point Ton!

Provided you don't have to change the enums at run time (which you can't in an active VI) you can define values of a ring and then replace the ring with an enum. Provided the enum does not end up being sparse (not all values defined) this makes it much easier to define all of the enum values.

Ben

I don't have to change them at run time. They just keep adding commands and I was using a ring control since the values related to the numbers are literal scattered about an 8-bit number space. Unfortunately, that required me to update every constant instance by hand everytime I got a change request. Need to use a more scalable type.

Thanks guys.

Link to comment

QUOTE (jasonw @ May 13 2008, 07:16 AM)

I don't have to change them at run time. They just keep adding commands and I was using a ring control since the values related to the numbers are literal scattered about an 8-bit number space. Unfortunately, that required me to update every constant instance by hand everytime I got a change request. Need to use a more scalable type.

If you want to stick with the ring control, why not use a strict type def? Then you make the change once and it auto propogates to all instances of the control/constant.

Link to comment
QUOTE (jasonw @ May 13 2008, 08:40 AM)
The problem I am having is that I cannot find the "Rep" property of the enum class. Does it still exist?
This is a scripting property. It is unavailable in LV8.0 or later unless you have a scripting license, which is not for sale. It is available in earlier LV versions only with undocumented config tokens.
Link to comment
  • 9 months later...

Hi,

I would like to replace an enum control in a cluster programmatically. This cluster is on the GUI and is also controlled though reference. I would like to know if I can do that by this solution? What I worry about is the ref is pass to sub VI. When I modify anything in the cluster, the reference contant also change and need to be replaced. I still not try this but is this true I can change the control at the path and it will update immediately in the program? How it happen with excutable and install version?

Thang Nguyen

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.