crelf Posted August 6, 2008 Report Share Posted August 6, 2008 QUOTE (Chris Davis @ Aug 4 2008, 03:48 PM) It sounds like http://forums.lavag.org/-t11380.html&view=findpost&p=48336' target="_blank">VIE has something internally that meets your needs. Chris describes the background process with enough detail to make it feasable with a little work. Our internal CVT example isn't quite what you're looking for (you could do what you want with it, but it'd take some work) - I think Ben's nugget is probably your most viable option to start with, but please post back if you get stuck (there are a few other options that I'm not immediately at liberty to disclose :ninja: ) Quote Link to comment
Mark Balla Posted August 7, 2008 Report Share Posted August 7, 2008 QUOTE (MJE @ Aug 4 2008, 03:41 PM) I'm currently working with LabVIEW 8.5...Let's say I have a cluster with a bunch of controls in it: {Control0, Control1, Control2, ..., ControlN}. Is there any way to set the value of ControlX if the value of X isn't known until run time? That is the bundle nodes won't work because in the development environment, there's no way to actually know which element to wire. I'm looking for an invoke node or similar thing I suppose, though I know a cluster invoke node has no such method. Given my understanding of an LV cluster being similar in functionality to C struct, I don't see how this can be done. Is it even possible to reference the name of a struct element at run time, or is access to values pretty much statically linked to memory offsets as in C? Now I know there are better ways of doing this, like using arrays or hashtables, but...just consider it for a moment, if you will? Incidentally, I wonder if are we ever going to see native hashtables in LV? See if this http://forums.lavag.org/Improving-Code-Programmatically-building-a-cluster-than-can-be-unbundled-by-name-t9978.html' target="_blank">link helps you out. Quote Link to comment
mje Posted August 8, 2008 Report Share Posted August 8, 2008 QUOTE (mballa @ Aug 6 2008, 06:08 PM) See if this http://forums.lavag.org/Improving-Code-Programmatically-building-a-cluster-than-can-be-unbundled-by-name-t9978.html' target="_blank">link helps you out. Wow, thanks, mballa. That does exactly what I want. It's way more involved than I'd have ever imagined it being! Quote Link to comment
giopper Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (MJE @ Aug 4 2008, 10:41 PM) I'm currently working with LabVIEW 8.5...Let's say I have a cluster with a bunch of controls in it: {Control0, Control1, Control2, ..., ControlN}. Is there any way to set the value of ControlX if the value of X isn't known until run time? That is the bundle nodes won't work because in the development environment, there's no way to actually know which element to wire. ... You can change the values of controls embedded in a cluster by using bundles. However, you cannot change the definition of the cluster (i.e. the definition of the type of a control in a cluster and I guess this was actually your question.) As for a structure, a cluster must be declared, e.g. you must define it before you run the VI and there is no way to modify its definition programmatically. In the initialization part of your program, you can define a very general cluster, a cluster with all the types you could need during execution and then use case structures to decide which control to use/modify. Definitely not elegant but it works. Hope this helps. G 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.