Tomi Posted March 1, 2006 Report Share Posted March 1, 2006 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. Quote Link to comment
i2dx Posted March 1, 2006 Report Share Posted March 1, 2006 yes, there is a way: Quote Link to comment
Grampa_of_Oliva_n_Eden Posted March 1, 2006 Report Share Posted March 1, 2006 yes, there is a way: Nicely done i2dx! What is the "rep" property you are setting in that example? I can't say I've seen it before. Ben Quote Link to comment
Yair Posted March 1, 2006 Report Share Posted March 1, 2006 What is the "rep" property you are setting in that example?Ben Representation? Probably scripting only or it would have a more meaningful name. Quote Link to comment
PJM_labview Posted March 2, 2006 Report Share Posted March 2, 2006 Nicely done i2dx!What is the "rep" property you are setting in that example? I can't say I've seen it before. Ben 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 Quote Link to comment
i2dx Posted March 2, 2006 Report Share Posted March 2, 2006 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 ... Quote Link to comment
Wire Warrior Posted May 14, 2008 Report Share Posted May 14, 2008 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? Quote Link to comment
Ton Plomp Posted May 14, 2008 Report Share Posted May 14, 2008 QUOTE (jasonw @ May 13 2008, 03:40 PM) 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? A better solution is offered in the 'http://forums.lavag.org/Variant-To-Control-file89.html' target="_blank">Variant to Control' code repository part. The downloaded code contains an example to change an array of strings into a type-def. Ton Quote Link to comment
LAVA 1.0 Content Posted May 14, 2008 Report Share Posted May 14, 2008 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 Quote Link to comment
Wire Warrior Posted May 14, 2008 Report Share Posted May 14, 2008 QUOTE (tcplomp @ May 13 2008, 08:55 AM) A better solution is offered in the 'Variant to Control' code repository part.The downloaded code contains an example to change an array of strings into a type-def. Ton 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. Quote Link to comment
TobyD Posted May 14, 2008 Report Share Posted May 14, 2008 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. Quote Link to comment
Aristos Queue Posted May 15, 2008 Report Share Posted May 15, 2008 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. Quote Link to comment
Thang Nguyen Posted March 5, 2009 Report Share Posted March 5, 2009 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.