From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-26-2015 04:11 AM
Hello everyone,
I have 20 arrays named z=1, z=2,... z=20; Now a for roop was created to assign numbers to each array, but how could I get the array with name z=i?
Solved! Go to Solution.
08-26-2015 04:18 AM - edited 08-26-2015 04:18 AM
hi,
your question is not clear, From my poor understanding, I guess you have array of 20 elements and you want particuler array element for that you need to use the 'Index Arrray' function fron Fuction pallette->Array
08-26-2015 04:24 AM
Thanks very much for your concern... but it's not the case.
For example, I have 20 string indicators, named as z1, z2, ... z3.
I want to input something to one of the string indicators, zi, how could I do that?
for i=1:1:20
zi=a
end
08-26-2015 05:26 AM
My immediate thought would be to create an array of references to the indicators, you can then index that array to get the z<i> indicator and then write to the value property node to set its value.
If it does need to be truly dynamic based on name, you can also...
- use the 'Ctrl Val.Set' method of a VI to set a value by name
- find all indicators on the front panel and then look up the reference by name
08-26-2015 05:40 AM
08-26-2015 07:02 AM
Thank you very much
it gets
09-03-2015 10:27 AM
Also the Find Object By Label which is in your vi.lib, exposed with the Hidden Gems, can do this for you to. Provide the name of the control, and it will return a reference to that control that you can then set the value of. Depending on your design one might work better than the other.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord