Jump to content

Local variables without Front Panel item


JPrevost

Recommended Posts

I'd like it if there were local's that didn't have a front panel item to hide. I use them infrequently but in large applications they seem to be the best way to sync parallel loops.

I also think there should be a way to label an indexed array item. There is no way to do this right now in 7.0, maybe in 7.1?

Link to post
I'd like it if there were local's that didn't have a front panel item to hide. I use them infrequently but in large applications they seem to be the best way to sync parallel loops.

Isn't what you're after just a functional global? The whole idea of having a local is to access FP objects...

Link to post
I'd like it if there were local's that didn't have a front panel item to hide. I use them infrequently but in large applications they seem to be the best way to sync parallel loops.

I also think there should be a way to label an indexed array item. There is no way to do this right now in 7.0, maybe in 7.1?

Just to be clear, what do you mean exactly by "label an indexed array item"? It seems to me that arrays are indexed elements, and clusters are labeled controls. If you label 5 items in an indexed array and add a new element, what do you label the new one? What you may be after is an enum, or a ring?

Thanks for clarifying,

Joe (orko)

Link to post
Isn't what you're after just a functional global? The whole idea of having a local is to access FP objects...

I thought FG were used to talk between vi's where as locals are used to talk within a single vi but multiple loops. I have no need to call the locals globally. Right now I'm using a local as a place holder. While data is being played back a slider is indicating the seek location of the file. When a user clicks on the slide I have it setup so it writes the new value to a local which is then called by a queue in the loop that does the file seeking. If that isn't clear I'll post images of the code.

As for naming a indexed array item I'm talking about giving that single element a name without wiring it to an indicator so that it can be clustered with a name. Again, if that isn't clear I'm sure it's my fault and I'll be more than happy to post an example.

Thanks for the replies so far and yes, I could use a FG but I thought they should be used when calling by seperate vi's... if it's more efficient than using a hidden FP object and queue then I'll do it :) . It would clear up the wiring diaghram.

Link to post
Labeling an indexed array item... notice how it has no name is defaulted to "numeric" for every item. Only if I wire it to an indicator does it get a name :( .

I think I understan what you are asking, see attached VI. Create a constant on the middle node of the bundle by name, add what ever data tpes you want to the constant and lable them. Than wire what ever data you want into the cluster elements. I think maybe the problem is you are used to defining the name of your cluster elements by wireing a control to the elements and letting the cluster element name take on that of the control lable.

Download File:post-3882-1140044855.vi

Link to post
I think I understan what you are asking, see attached VI. Create a constant on the middle node of the bundle by name, add what ever data tpes you want to the constant and lable them. Than wire what ever data you want into the cluster elements. I think maybe the problem is you are used to defining the name of your cluster elements by wireing a control to the elements and letting the cluster element name take on that of the control lable.

<-- version 7.0, not 8 ;) but yes, I follow what you're saying. Last week was the first time I did what you just said with the cluster constant labeling. I'm thinking about using that for the configure part of of my program only I don't like the idea of having a configure.vi that requires passing a huge cluster to write but then when reading, having to read the WHOLE cluster (over 40 elements) just to read 1. This is why I'm still using local variables and sequence structuring to initially read the cfg file in, update the controls, then read them all over the program using local variables. Do you think I should use a seperate configure vi with a functional/LV2 global? These user configurables are read relatively often and relatively fast ~10 get read in different locations of the program >17Hz. It would really clean up the main vi if I did go to clustering and a seperate config vi but I don't want to do it if it'll hurt performance any (suporting slow ~400Mhz machines).

Thanks again for that reminder about labeling... I still wish it was easier to label wires. Like a right-click shortcut label feature :2cents: .

Link to post
<-- version 7.0, not 8 ;) but yes, I follow what you're saying. Last week was the first time I did what you just said with the cluster constant labeling. I'm thinking about using that for the configure part of of my program only I don't like the idea of having a configure.vi that requires passing a huge cluster to write but then when reading, having to read the WHOLE cluster (over 40 elements) just to read 1. This is why I'm still using local variables and sequence structuring to initially read the cfg file in, update the controls, then read them all over the program using local variables. Do you think I should use a seperate configure vi with a functional/LV2 global? These user configurables are read relatively often and relatively fast ~10 get read in different locations of the program >17Hz. It would really clean up the main vi if I did go to clustering and a seperate config vi but I don't want to do it if it'll hurt performance any (suporting slow ~400Mhz machines).

Thanks again for that reminder about labeling... I still wish it was easier to label wires. Like a right-click shortcut label feature :2cents: .

Sorry about that, here it is in 7.1. In my opinion there is nothing wrong with a subVI that reads in a config file and parses it to build a big bundle by name cluster to pass out. 40 elements in a cluster is not bad, you start taking performance hits with an array of clusters or even worse, an array of clusters with an array as one of the elements of the cluster.

Download File:post-3882-1140048702.vi

Link to post
Sorry about that, here it is in 7.1. In my opinion there is nothing wrong with a subVI that reads in a config file and parses it to build a big bundle by name cluster to pass out. 40 elements in a cluster is not bad, you start taking performance hits with an array of clusters or even worse, an array of clusters with an array as one of the elements of the cluster.

Okay. I'll try it out. BTW, version 7.1 > 7.0 ... still can't open :wacko:

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.