11-25-2010 07:25 AM
Hi,
I would like to triger specific event from a event structure with the output of comparison function. I tried several time but the output of the comparison function is not triggering. Please propose some solutions.
Regards,
Mlad
Solved! Go to Solution.
11-25-2010 07:32 AM
Currently how you are triggering the event... Can you post the VI you made?.... Please save in 8.6 Version and post...
11-25-2010 07:51 AM
Sounds like you need to write to the Value(Signaling) property. Writing to a local or Value property will not fire an event.
11-25-2010 09:32 AM
Here is one example. I would like to trigger the event case by having x=0? TRUE instead of the boolean.
11-25-2010 09:32 AM
Here is one example. I would like to trigger the event case by having x=0? TRUE instead of the boolean.
11-25-2010 11:28 AM - edited 11-25-2010 11:29 AM
You haven't done what I said with the property node. Add that, add a timeout rvent, and move the stop button into an event. The stop button does nothing the way you have wired it. You can also place the numerics and the calculaions inside an event and not need a timeout.
11-25-2010 01:11 PM - edited 11-25-2010 01:15 PM
As otheres have already mentioned, you first need to learn some LabVIEW basics. Dataflow!
The event structure is primarily to handle user interactions. What you need is a simple case structure.
The way you use the event structure, it will prevent the loop from spinning, thus the boolean will never change, because the numeric terminals never get read while the event is stalling. Similarly, as Dennis already said, your stop button is outside the loop, thus will only get read once at the start of the program and then ever again. Since you need to read it with each iteration, it needs to go inside the loop.
Why don't you run your VI in execution highlighting mode to get a better feeling about dataflow? 😉
You should also be aware that "equal" function should never be used on orange wires, because the limitations of floating point representation. In your case it is marginally OK because you enter the vaalues manually, but if you compare the results of computations, the results will be often unexpected. Change your demo to blue numerics (e.g I32 integers) for better determinism.
Anyway, here's a quick draft:
11-25-2010 01:21 PM - edited 11-25-2010 01:23 PM
If you want to use an event structure, you need to react on the numeric inputs, e.g. as follows:
Note that the VI is idle unless one of the controls (x, y, stop) changes, at which time the booleans are updated, comparison made, sound played if needed, and VI stopped if stop is pressed.
11-30-2010 04:08 AM
I haven't done what you said with the property node because I still dont know how to work with it. A simple example will be great help.
Here I should say something more about what I want to do. I want to control a motor by those comparison functions. Let's say for x>0 move backwards, for x<0 move forewards and for x=0 stop. I know that event structure is usually the right choice for this but not for the VI I am using. So it would be great if I can make it work with 3 cases of event structure.
Thank you ALL !
Best Regards,
Mlad
12-02-2010 02:40 AM
"If you want to use an event structure, you need to react on the numeric inputs, e.g. as follows:"
Thank you! I tried it and it works.