LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure

thank you for the prompt response.  I think I understand your instructions (or maybe not)......when i choose, say, Node 2 (in Item#) and 2 (in Value), it works fine... but when I change to Node 3(in Item #) and leave the value as 2, the data does not update..  I have attached the Vi.  I'd appreciate your feedback.
 
thanks
0 Kudos
Message 11 of 19
(1,451 Views)
Well, if you want it to update on both triggers, you need to have the event for both terminal. But in this case it makes little sense to use the "newval" terminal, because it will either have the new "values" or "item#" value, depending on which control triggered the event.
 
I think you want to have an output if both selectors are not zero, so add a case structure that does nothing if the product is zero and else proceeds normally with your code.
 
I made some quick modification and added some additional comments, see if this is what you want.

Message Edited by altenbach on 10-18-2006 08:50 AM

Message 12 of 19
(1,445 Views)
That is exactly what I want.  Thank you so much..
km
0 Kudos
Message 13 of 19
(1,435 Views)

Sorry, I made one small oversight.

Your values output must be U8, which you "solved" by indexing into an array. 🙂 Easier would be to use my method and just set the representation of the control to U8 (right-click...representation). 😄

Message Edited by altenbach on 10-18-2006 09:18 AM

Message 14 of 19
(1,428 Views)
got it... thanks
0 Kudos
Message 15 of 19
(1,416 Views)

Hi altenbach,

I apologize for bothering you again. I was hoping that I could move forward with a part of the solution that you provided, but I am stuck.  I have modified your code a little bit to meet my requirements.  here is my scenario:

Based on the Node # selection, I'd like to be able to pick the Gain, Threshold or Transmission Intervals and feed the Output into the TCP write VI.  For instance, if I select Node 2 and Gain of 5, I'd like to write Output 1 to TCP Write VI. 

I tried using the Build Array to build the array of all the Outputs and then indexing the array based on the Label.Text property for each Menu Ring.  That didn't work out as I intended. I am sure there is a better way of doing it. I have to use Events since this VI is part of a larger VI and will be event driven.  Also, I have several other Menu Rings that I will be adding in addition to Gain, Threshold and Transmission Intervals.

I'd appreciate if you could please suggest any ideas.  Thanks and sorry again.  The VI is attached.

km

0 Kudos
Message 16 of 19
(1,394 Views)
There is no reason at all to duplicate virtually the same code 3x. If the only difference is a single string, then only that string belongs in the case structure. You need only one instance of the rest of the string manipulations. 🙂
 
Attached is a quick attempt at one possible implementation (There are probably bugs...). Maybe it can give you some ideas. Let me know if you have questions.
Message 17 of 19
(1,387 Views)

Thank you for the code.  It works great with some modifications.  I had a quick question.. how did you create the NewVal as U8?  When I tried to recreate your VI, and add more events, my NewVal turns to a Variant type.

Thanks

KM

0 Kudos
Message 18 of 19
(1,368 Views)

Never mind.. i figured it out.  Thank you again.

km

0 Kudos
Message 19 of 19
(1,365 Views)