10-22-2024 09:09 AM - edited 10-22-2024 09:10 AM
10-22-2024 09:38 AM
@billko wrote:
I hate autogrow so much I call it "auto-groan".
I also hate auto tool selection. It's like I'm trying to work on a car and a monkey keeps changing the tool in my hand.
10-22-2024 10:57 AM - edited 10-22-2024 11:02 AM
That looks like you actually have a group of boolean constants and a group of local variables. You could post the VI so we could tell if they are grouped or nor... Can't tell from a picture.
Generally, you could get away with 1 boolean constant and a Negate. I honestly don't recall the last time I used a local (I have used them but it isn't often.) This suggests that you have bad habits that you hide to make the bd prettier without really "getting" best practices.
10-22-2024 01:26 PM
Yeah, I'm sure I have plenty of bad habits! One of them is not explaining myself well enough! That image was simply an example to show how the local variables moved relative to the boolean constants. For the record, it looks like other components also move (as they should). The following is another example. I put together an illustrative circuit with some constantsm controls, indicators, property nodes and a few other elements:
By changing case to the false case:
and then doing a control drag (in the other case as shown) as the arrow indicates:
It is clear the constants (crudely circled here) have remained in the same place, while the rest of the components have moved as expected.
Apologies for my poor explanation previously.
Anyway, I'm curious to learn how to avoid using local variables? Do you use references?
Also not sure what you mean by 'negate'.
Any help to improve my programming is much appreciated.
Mark
10-22-2024 04:15 PM - edited 10-22-2024 04:20 PM
@MarkTTHSAS wrote:
Anyway, I'm curious to learn how to avoid using local variables? Do you use references?
I typically just use a wire. 😄 (and maybe a shift register or feedback node)
I am not sure if you are just messing with us, but an "=true" is the same as a wire and just returns the control input unchanged.
10-22-2024 04:32 PM
@MarkTTHSAS wrote:
Yeah, I'm sure I have plenty of bad habits! One of them is not explaining myself well enough! That image was simply an example to show how the local variables moved relative to the boolean constants. For the record, it looks like other components also move (as they should). The following is another example. I put together an illustrative circuit with some constantsm controls, indicators, property nodes and a few other elements:
By changing case to the false case:
and then doing a control drag (in the other case as shown) as the arrow indicates:
It is clear the constants (crudely circled here) have remained in the same place, while the rest of the components have moved as expected.
Apologies for my poor explanation previously.
Anyway, I'm curious to learn how to avoid using local variables? Do you use references?
Also not sure what you mean by 'negate'.
Any help to improve my programming is much appreciated.
Mark
This is exactly what I described in my first post.
10-23-2024 04:22 AM
@billko wrote:
This is exactly what I described in my first post.
Though it behaves the same with and without Autogrow enabled on the structure
10-23-2024 06:47 AM
I've had this happen fairly often when expanding code. Effed up some VIs something horrible, but i only noticed it later when i couldn't undo the changes anymore.
10-23-2024 07:18 AM
That's just a thrown together fragment to demonstrate that the constants remain in place and the other circuit elements move during the ctrl-drag we were discussing.
10-23-2024 07:19 AM
Yeah, I just missed the point that it had to be in another case.