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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean grouping

Hello all,

 

 

I'm a student and still finding a lot of stuff to practice.

When I read a thread an hour ago, I found something new to research Smiley Happy.

Anyway, some people use very many Boolean indicators and connect them together, so they all have the same value.

 

In text written code you'll get something like this

 

#define True=1;
#define False=0;

for ( x = 0; x < 10; x++ ) {
"Tube_"<<i=True;
}

I don't know if the syntax works, but you'll get the idea.

 

 

That's pretty short code right.

Implementing it in Labview is a little harder using a for loop.

I made two different solutions. My question is: Is there a better solution to this problem and why?

 

Koen

 

Btw, just found out that Labview forum doesn't recognize it's own brandSmiley Very Happy

labview.PNG

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 1 of 7
(3,007 Views)

It does if you spell it right: LabVIEW (notice the capitalization)

 

Cameron

 


@KoenR94 wrote:

Hello all,

 

Btw, just found out that Labview forum doesn't recognize it's own brandSmiley Very Happy

labview.PNG




To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 2 of 7
(2,972 Views)

No comment

 


It does if you spell it right: LabVIEW (notice the capitalization)


 

labview.PNG

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 3 of 7
(2,966 Views)

I altered your second option to make it a little more efficient.

 

In general, I go with your first option, but have done things similar to your second.  But I don't like doing this just for the sake of setting values.  I do this type of setup when dealing with many other properties (like Disable, Visible).

 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 7
(2,953 Views)

Hello crossrulz,

 

Thank you for the reply.

Pretty neat idea of that conditional for-loop, didn't knew it existedSmiley Embarassed

Your way is a lot faster probably. Just one problem to it, the "To More Specific Class" won't work in the first for loop.

This is most likely due to the other controls?? Anyway changed it to this and now it does function:

group.png

 

What is your reason that you won't do it for values?

Thanks in advance

 

Koen

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 5 of 7
(2,943 Views)

Crossrulz didn't say he "Would not" he said he would avoid it.  and so would I

 

Really, think about why you are doing something..... the boolean terminal already exists so the info is already presented to the user.  what do you gain by presenting it ten more times?


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 7
(2,934 Views)

Maybe when you use it in a bigger program.

It could be possible that you aren't able to reach those ternimals, without the use of local ofcourse.

I think when you use it multiple times in a program it will use less space and keeps things clear.

Any other suggestions are welcome ofcourse Smiley Happy

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 7 of 7
(2,888 Views)