LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a blinking buttons in random sequence

Hi, everyone

 

I am very new here and need your suggestion.

I am doing a project on cursor control by using eeg signal. First, I need to develop a stimulus display by creating a blinking buttons in random order. Now, I can create the blinking button at the same time, but I dont know how to make it randomly and notify the random sequences to me. below is my blinking buttons VI.

 

For example, if button1 finished blinking, button 3, 2, and4 will blink respectively randomly. There is only one button blinks in one time, cannot blink two or more buttons at the same time. Moreover, I want the program to notify me what is the sequeces when each button blinks like button1, 3,2,4,3,4,2,1,.... 

 

THank you for your suggestion in advance.

0 Kudos
Message 1 of 10
(4,545 Views)

pardon.. if u make clear enough about your doubt, i think i will do help to my extent to make you clear..

 

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 2 of 10
(4,532 Views)

WARNING:

 

(Reported to moderator)

 

{Edit:} I have not seen any unusual problems but, I have never seen 2011 green primitaves either.  if someone can point to an NI product where that is expected I'll wellcome the opportunity to learn

 


How about that?  I've never seen a "Select" primative icon with terminals visable before.Smiley Surprised

 

(Who would DO that?)  you really need to dig into the BD edit-time Right-click menus to even find that option?  15 years and I've never seen it.

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 10
(4,515 Views)

Hi kuzing,

 

I want the program to notify me what is the sequeces when each button blinks like button1, 3,2,4,3,4,2,1,....

Wrong expectation…

You don't want to get "informed", you want to control the blinking sequence! You are the one who sets the blinking order and you are the one who has to program this!

 

I would suggest to limit your VI to just one loop. A state machine approach could be useful too…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(4,488 Views)
Thank you dhans, what I doubt is that how to make buttons blink randomly. if you open and run an attached file, you will see 4 buttons blinking at the same time. However, I want it to blink in random order and only one button. For example, after clicking on the Boolean text visible button (in the front panel), button 1(or 2,3,4) will blink, then button 3,2,4 respectively, and do it again randomly within 1 minute.
0 Kudos
Message 5 of 10
(4,486 Views)

@kuzing wrote:
Thank you dhans, what I doubt is that how to make buttons blink randomly. if you open and run an attached file, you will see 4 buttons blinking at the same time. However, I want it to blink in random order and only one button. For example, after clicking on the Boolean text visible button (in the front panel), button 1(or 2,3,4) will blink, then button 3,2,4 respectively, and do it again randomly within 1 minute.

You have conflicting requirements here.  Do you really want a random or do you want a set pattern?

 

I would use an array to show the buttons and then it is a simple Replace Array Subset to choose when one should light up.


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
0 Kudos
Message 6 of 10
(4,449 Views)

Many thanks, GerdW and crossrulz,

 

I had a confliction of random order that I shoud create it first, now I can create it. thanks to all of your suggestions and youtube!!

0 Kudos
Message 7 of 10
(4,396 Views)

state machine type program or randomm number creator  type program will be helpful for you. if u chose state machine you would get continuous order of light blinking like 3,4,2,1,3,4,2,1........ But if you want random blinking without sequentially you may go for random number creator. Just try these types and you will surely get a result as you asked in this forum.

 

Note: you cannot predict which light is going to be blinking if you choose random number creator.

 

  All the best. May be this answer is deserved kudos!!!!Smiley Happy

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 8 of 10
(4,378 Views)

Hi dhans,

 

why should a state machine only generate a fixed sequence of blinking lights? You can go in a random order - it all depends on your programming of the state switches!

But you can easily add states for user input checks, file storage, etc.!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(4,361 Views)

Hi buddy, there should be some end in the state machine. After that it will start from initial. That is what i said. Between that span you can get random sequences.

I think so. Did i say wrongly?

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 10 of 10
(4,350 Views)