LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add boolean command

Hi Knight of NI,

 

I tried array before, but I don't know how to change the array pattern, i.e. reverse boolean flashing direction, change from vertical to horizontal, change the quantity of boolean (8, 16, 32, 64...), because this vi is copy from example site, I try to use this template apply to my mini project.

I considered one by one LED put on front panel are more flexible than array, as I known it's simple than array function but so stupid.

Pl kindly give me comment for my thinking is feasible or not.

 

Thanks for your time to help.

0 Kudos
Message 11 of 20
(2,611 Views)

Hi Jeff,

 

Thanks for your help,

I can't found function of your template from function windows, because I'm new in LabVIEWSmiley Sad, could you send your vi for my follow to put it in my block diagram?

 

Thanks a lot. 

0 Kudos
Message 12 of 20
(2,609 Views)

Hi ikchan,

 

because I'm new in LabVIEW

Then you should take the FREE online courses for beginners as offered by NI…

 

After doing so have a look at the numerics function palette… 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 20
(2,593 Views)

@ikchan wrote:

Hi Jeff,

 

Thanks for your help,

I can't found function of your template from function windows, because I'm new in LabVIEWSmiley Sad, could you send your vi for my follow to put it in my block diagram?

 

Thanks a lot. 


see this link   Smiley Wink {Edit: Corrected Link to Screencast}

and reposted in LabVIEW 2012 as a snippet

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 20
(2,589 Views)

Maybe this can give you some ideas....

 

0 Kudos
Message 15 of 20
(2,565 Views)

Hi altenbach,

 

I attached my idea of mini project which is I mentioned what wanted to do before.

could you please to advise comment on this structure, I known its so lengthy and can be simply by other function.

 

Many thanks.

0 Kudos
Message 16 of 20
(2,515 Views)

You are kidding, right?

0 Kudos
Message 17 of 20
(2,506 Views)

Sorry waste your time!

0 Kudos
Message 18 of 20
(2,501 Views)

No, you wasted your time! How long did it take you to do that? What would the code look like if you want to add a few more LED wires in the future? It is not scalable! How long would it take you to find the problem if one local variable is wired wrong?

 

  • You don't need any local variables (you have almost ~1400!) And you only need a single TRUE diagram constant (not ~1400)
  • Why all that duplicate code? Why do you need 37 instances of the same delay?
  • Instead of the flat sequence, use a FOR loop ccontaining a case structure and line up all the boolean indicators on the right side of the case strucuture.
  • Create 37 cases and place a true diagram constant outside. Now wire from the TRUE constant across all the cases to the LEDs that should be ON, Make all output tunnels to "use default if uwired" so they return a false fron the cases where they are  not wired.
  • Place a delay in the for loop, but outside the case structure. Only one needed!
  • Wire [i] of the FOR loop to the case selector and 37 to N. No need for a sequence structure, local variables, and all that duplicate code.
  • Suddenly, the program is ~2% of the current size! That's significant!

 

Still, this is way too much code and you should strongly conside using arrays as already advised.

0 Kudos
Message 19 of 20
(2,491 Views)

Here's another way, which requires even less code by putting the indicators in a cluster:

 

Example_VI.png

 

Each column in the array is for an indicator and each row is a step in time. The code just iterates over them and so adding more indicators is just a matter of adding columns to the array. It also shows you how things change over time.


___________________
Try to take over the world!
0 Kudos
Message 20 of 20
(2,444 Views)