01-11-2022 05:23 AM
I have 100 sequentially named variable(a0,a1,a2...) and a 1D array storing 100 values. How to put the value of 0th index in a0 and so on using a for loop or something? I don't want to do it manually.
01-11-2022 05:48 AM - edited 01-11-2022 05:52 AM
@Karan1 wrote:
I have 100 sequentially named variable(a0,a1,a2...) and a 1D array storing 100 values. How to put the value of 0th index in a0 and so on using a for loop or something? I don't want to do it manually.
You have to in some way! Either you need to collect a control refnum from each variable indicator and then access the Value property in a loop or put the terminal or local variable into a case structure with 100 cases inside the loop.
The automatically resulting question is: What are you really trying to achieve by such a pretty useless interface?
This is not intentionally made so hard to pester you but because it makes usually very little sense to clutter an user interface with 100 controls. And if it is just variables in the diagram, why even bother about it? Keep it in the array and access the index that you need when you need it.
01-11-2022 06:36 AM
01-11-2022 06:51 AM
01-11-2022 08:08 AM
01-11-2022 11:30 AM
@Karan1 wrote:
I have 100 sequentially named variable(a0,a1,a2...) and a 1D array storing 100 values. How to put the value of 0th index in a0 and so on using a for loop or something? I don't want to do it manually.
Before we all guess what you mean by "variables", it would help if you could show us a small VI that demonstrates the problem.
LabVIEW does not really have "variables" in the classic sense. Are you talking about controls? Indicators? Something else?
Where does the data come from?
01-12-2022 03:20 AM
Thanks, it is working. It is fast for my application.