04-03-2009 02:06 PM
I do a lot of work with 2 D arrays. Sometimes it would be helpful when stepping through arrays to have one of the indexes named i and the other named j. Is there a way to change the name of the increment variable other than making it into another variable?
Thnaks.
Solved! Go to Solution.
04-03-2009 02:44 PM - edited 04-03-2009 02:44 PM
This is how I work with 2D arrays. Could you point to the variables you want to name?
04-03-2009 03:04 PM
While that is great for reading every element of a 2D array, I personally find the iteration count useful for several reasons. This could be a lack of programming, but if I wanted to programmatically vary an interval to read in the array, I wouldn't know how to do that without the iteration terminal.
For example: read every 5th element for 20 elements, then every 7th for 30, then allow the user to decide through a control.
Again, I just may be overlooking something (as is the general barrier with coding) but when I find the iteration terminal useful is with very "customized" indexing.
As far as the solution, creating a variable or hidden indicator with a different name would be a fairly simple fix.
04-03-2009 03:18 PM
Chris,
I don't disagree but I thought the request of the op was just a little bit silly since it is the wire that is the variable and you can place any label you want on the wire and if using controls for indexing, they canbe named anything at all.
04-03-2009 04:11 PM
Is there a way to change the name of the increment variable other than making it into another variable?
Sure. You have to remember that in LabVIEW, a variable is a wire. The little boxes on the ends of wires are not variables, but terminals.
Think of a WIRE as a variable, and you'll have no problem.
Then you can name it "i" or "j' or "Schwarzenegger" and do whatever you like with it.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-03-2009 04:32 PM
CoastalMaineBird wrote:Then you can name it "i" or "j' or "Schwarzenegger" and do whatever you like with it.
I personally make it a point to name all my wires "Schwarzenegger".
04-03-2009 04:33 PM
If you put a label by the wire, and then use ctl"u", the label moves to a different part of the screen and is no longer associated with the wire. I need some way to keep track of row col when I am managing arrays ... I don't know how to "name" the wire a "name" and keep that available to me when I need to figure out what the "wire" is, if it is coming from an iteration counter. I didn't want to create a variable with an indicator from the iteration counter...I could name that and keep track that way but it would slow things down.
Isn't there some way to name the i a j or an m or an n or something like that so the iteration count can be like other "languages"...(Please don't start on the vision thing...when you get old, and the icons will not change size unless you zoom your entire screen, sometimes it is nice to have the name of the variable (like after a multiplication that you name something)).
Just asking.
Thanks.
04-03-2009 04:41 PM
Isn't there some way to name the i a j or an m or an n or something like that so the iteration count can be like other "languages
No.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-03-2009 04:49 PM
Hummer1,
As stated before, there is no way to change the image of the iteration terminal. However, you can add a description to the wire. Right click the wire, and select "Description and Tip", then type the name/description you want in the box. Now you can move your mouse over the wire, and the description will appear in the Context Help window. Hopefully, this helps.
Chris M