04-09-2010 11:02 AM
James, I understand the pain of forgetting to change a ring to an enum when dynamically populating the Strings - it's a very easy mistake to make. After making the mistake a few times, I resorted to populating the enum directly: it's much more error-proof. Check out my post here on how to populate the strings of an enum directly: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/convert-String-Array-to-Enum/idc-p/1025936 - (the code is in a For Loop since I have a Launcher VI that edits all the major typedefs).
04-09-2010 11:21 AM
The strings for enum can be written provided the VI owning the enum is not reserved to run or running. So if you write code to find the enum on the FP of a VI you can re-use that code to set the strings for enums and skip the ring completely.
Ben
04-09-2010 11:45 AM
Why not completly auto-generate the creation using scripting...
For example have a look at this tool in the Lava CR, there is a vi inside to create the states for a state machine (based on enum) that already completly does this. There is also some code that is doing search&replace operation enums.
Felix
04-13-2010 04:53 AM
Ben wrote:The strings for enum can be written provided the VI owning the enum is not reserved to run or running. So if you write code to find the enum on the FP of a VI you can re-use that code to set the strings for enums and skip the ring completely.
Ben
- Presumably this is what Jack is using with his block diagram which I have to admit that I really don't understand 1 bit, I might understand it when I am allowed time to experiment with it.
Felix,
The reason why I haven't used scripting is that NI says that for assistance it is neccessary to go to R&D, Tech supportwon't be able to help, and they won't guarantee feature continutity of comapatibility between releases. (It is the second issue which keeps my company away from this, as there are currently only 2 of us doing the programming and if something is not guaranteed to work in the next release, we can't afford to spend the time debugging it.)
Great answers from 3 very good developers I respect alot. Thanks
James
04-13-2010 08:28 AM
Been there, done that.
Off to make a suggestion on the idea exchange.....
Shane