LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure question

The only reason I did that was because in the real program that I am working on, the vi within the event structure requires three inputs that can change on the front panel.
0 Kudos
Message 11 of 18
(1,384 Views)
Here's another problem:
 
What shall I do when I want to input the values into a vi? I am having trouble working with the shift registers in order to get the most current value sent into the vi "add" which will add the three values.
 
I changed the shift registers back to tunnels.
0 Kudos
Message 12 of 18
(1,373 Views)
Message 13 of 18
(1,364 Views)
cool, thanks.
 
That example works, and I use basically the same configuration in the main program that I am writing.
In the main program, those values that are inputed in are used for configuration of an edge detection algorithm.
 
Now to expand a bit, I want to also be able to choose whether to use color or black&white in the resulting image. To use color edge detection will require one vi while to use b&w edge detection will require another vi. Both, of course, requires the same input.
 
To simplify it, let's say that in the slider_sample_mod.vi code that Dennis wrote up that we all add in two radio buttons - one for addition and the other for multiplication. What will I need to do in order to accomplish this? I do not want to complicate things by including a stacked sequence within the while loop. Are radio buttons the best way to do it, or are there other buttons that I can use that will simplify things?
 
Attached, I included a zip file that includes the slider_sample_mod2.vi with radio buttons, add.vi, and multiply.vi.
0 Kudos
Message 14 of 18
(1,355 Views)
Right now, the only solution to this that I can think of is to put a stacked sequence within the while loop and outside the event structure. The stacked sequence will check what the user selected in terms of options. This gets pretty complicated. I hope that there is a better solution. I attached what I have written so far in the vi. It is not working right now. Any suggestions on how to improve the vi?
0 Kudos
Message 15 of 18
(1,330 Views)
Attached is my recent code.
 
Just a brief overview:
 
I have three input controls: a slider, an enum, and numeric. These three values can either be added or multiplied based on the selection of radio buttons. I want to optimize the code and to make the code run efficiently. This is based on the code that Dennis Knutson wrote in Reply Message #13 in this thread. So far the code has not been able to run correctly.
 
The reason I am doing this is that I am writing a vi to run edge detection. Edge detection requires three inputs from a slider, enum, and numeric control. These values can be changed during runtime. The code to run edge detection is on a separate vi.
 
There are also two types of edge detection: one returns a color edge detection and the other returns a black&white edge detection. The decision on whether to display color or b&w edge detection is also make during runtime. For example, if the user selects the radio button to run color edge detection, it will perform color edge detection and display the resulting image. The user can also change the inputs in order to show the resulting images based on the inputs. The user can also change to b&w edge detection during runtime.
 
Attached is a zip file that contains:
slider_sample_mod2: the main vi
add.vi: the vi to add
multiply.vi: the vi to multiply
 
 
Thanks!
 
 
0 Kudos
Message 16 of 18
(1,323 Views)

elliot,

Nested event structures are not a good idea, especially when you have the "Lock front panel until the event case for this event completes" option enabled and the events within the inner event structure are the same as events of the outer event structure. If I understand what you're trying to do here, I think you're very close. You simply need to remove the event structure within the "Radio buttons:value change" event. I'm attaching a modified version of your program to take a look at.

I hope this helps!

Tyler S

Message Edited by TylerS on 08-03-2005 04:17 PM

0 Kudos
Message 17 of 18
(1,279 Views)
Hello,
You could simplify your VIs of add and multiply by using this tool (in attached vi) wich you can find in the toolkit "boolean" (I have a french version of labview so the names are perhaps not exactly the same, sorry)
Better, you could replace the 2 VIs you made by this element.
Just a question, how to see if the button has the "Lock front panel until the event case for this event completes" option enabled ?
 
Thanks a lot
 
Cécile
0 Kudos
Message 18 of 18
(1,263 Views)