07-19-2022 03:27 AM
Why do I have to change a value in an array of .ctl before the current index gets usable?
If I dont change a value after startup the default values arent used.
Solved! Go to Solution.
07-19-2022 03:38 AM
Hi,
@Quiztus2 wrote:
Why do I have to change a value in an array of .ctl before the current index gets usable?
Because your array is empty. Indexing an element from an empty array just gives you default values…
07-19-2022 03:47 AM
I have overwritten the default values in the ctl's elements. That is why Labview displays these values, but forwards the types(uint,int) default values instead. This makes hardly sense.
07-19-2022 04:27 AM - edited 07-19-2022 04:29 AM
Please downconvert your example for LV2020 (File->Save for previous)…
@Quiztus2 wrote:
I have overwritten the default values in the ctl's elements.
A typedefinition (ctl) only defines the type, but not the value…
07-19-2022 08:07 AM - edited 07-19-2022 08:10 AM
@Quiztus2 wrote:
This makes hardly sense.
Yes it does. I cannot look at your code because the version is newer than what I have, but your diagram picture certainly raises a lot of eyebrows.
07-19-2022 09:07 AM
For me it is a secret how one can initialize an array with a ctl's elements default values programatically.
07-19-2022 09:10 AM - edited 07-19-2022 09:15 AM
Get rid of the local. You don't need it the terminal is right there and unwired.
Get some type of timing in that loop and a stop condition! If you want the vi to respond to user input....use a value change event case.
The control is not behaving strangely, the programmer is!
07-19-2022 09:32 AM
@JÞB wrote:
Get rid of the local. You don't need it the terminal is right there and unwired.
Get some type of timing in that loop and a stop condition! If you want the vi to respond to user input....use a value change event case.
The control is not behaving strangely, the programmer is!
The more experience you have, the more likely that what you want the program to do and what you tell it to do will converge. Hopefully.
07-19-2022 09:33 AM
On a side note, your question does have some validity!
Have a look at my 10 year old idea and its comments here. 😄
07-19-2022 09:56 AM - edited 07-19-2022 10:05 AM
@Quiztus2 wrote:
For me it is a secret how one can initialize an array with a ctl's elements default values programatically.
One possibility: