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: 

Combobox data question

Solved!
Go to solution

HI everyone, I'm trying to use COMBOBOX to select what lamp ON, but I want to do it just once, if I try to ON again the same LAMP Labview will show an error message, Is it possible? Thanksfocos.PNG

0 Kudos
Message 1 of 22
(4,663 Views)

Keep track of how many times the selection has been made using a shift register.  If it is chosen more than the number of times you desired, then show the error message.

 

You may want to use an Event structure to determine when the button has been pressed.

0 Kudos
Message 2 of 22
(4,641 Views)

Yes, I'm trying to use it, but I'm new in it 😕 For a lamp get ON I need to know the letter that my COMBOBOX send, and push INICIO, I want to use each lamp once.

Capture.PNG

0 Kudos
Message 3 of 22
(4,619 Views)

I'd agree you want to look at the event structure.  That way, you're checking once for each value change rather than continuously polling as you're doing now.

 

That would allow you to carry a three element array, or cluster, on a shift register.  Initialize it all to false.  As each filter gets triggered, set that value to true.  That way, you could see if you've triggered it before rather quickly.  If you only want each to be done once, you could do an AND of the array as a stop condition.

0 Kudos
Message 4 of 22
(4,580 Views)

@cesarjr.1991 wrote:

Yes, I'm trying to use it, but I'm new in it 😕 For a lamp get ON I need to know the letter that my COMBOBOX send, and push INICIO, I want to use each lamp once.

Capture.PNG


  • The shift register belongs in the outermost loop. Keep an array of three booleans.
  • Your FOR loop does not do anything useful, delete it.
  • What determines your while loop rate? Seems to be spinning loke crazy. Use an event structure as suggested.
  • Why is it a combobox? Why not use a ring, enum, or radiobutton control?
  • Keep all controls on the main loop diagram, not inside other structures.
  • ...

 

If you want help, please attach your actual VI. We cannot debug pictures.

0 Kudos
Message 5 of 22
(4,335 Views)

Hi, this is my Vi, where I'm trying to do it, If I try to ON a lamp twice the program will show me a message, but I don't know how to do it 😕

0 Kudos
Message 6 of 22
(4,318 Views)

Here is a version using radio button, event structure, and an array of booleans.  It does not include the Inicio function.

 

Lynn

0 Kudos
Message 7 of 22
(4,294 Views)

Yes, but you're using buttons, Is it possible to do with a Combobox? the same thing, but with Combobox?

0 Kudos
Message 8 of 22
(4,277 Views)
Solution
Accepted by topic author cesarjr.1991

It doesn't appear that you've tried any of the tips given to you.

 

See attached.

0 Kudos
Message 9 of 22
(4,272 Views)

Thanks! 😄 It works for me 

0 Kudos
Message 10 of 22
(4,267 Views)