05-13-2011 01:27 PM
@nyc_(is_out_of_here) wrote:
I am trying to add the <Event Message>: User Event to my event structure, but all I am able to get is <My User Event>: User Event.
What am I missing? I am using LV2010.
My preferred method for initializing my user events is to create a typedefed cluster for my user events. Within this cluster there is a cluster (typedefed) for each user event I would like to use. The elements of the individual clusters are the specific data associated with that event. Wire this cluster into input on the Create User Events VI. Then your event structure will have each user event available. In your code you only have one event (MyEvent) defined.
I attached a copy of a subVI that I use in my applicatons. I did not attach all of the typedefs associated with it but this would give you the general idea.
05-13-2011 01:29 PM
@Richard2950 wrote:
You can use the Property Node with Val(Signaling) property to not only change the value of a control but also to have it trigger an event structure the same as if the control's value was changed on the front panel. Then you can have an Exit button with an event case and execute everything in the case programmatically as well as in response to an actual front panel event. The only caveat is that you can't use the Val (Signaling) property with a Boolean that has latching mechanical action. That is not a big deal, though, and you can reset the button yourself in the event case. See attached simple example that uses the Esc key to mimic a Stop button push.
This certainly is an option. However, user events are more flexible since you can pass data with them. In addition I generally try to decouple of the processing code from the UI as much as possible. In order to do this you need to avoid using property nodes for specific controls/indicators.
05-13-2011 01:35 PM
If you just want two buttons to trigger the same case in the event structure, then add the second button by right-clicking on the event title at the top of the event structure and choosing "Edit events handled by this case", "Add Event" and choose your other button. Then pushing either button will trigger the same case.
05-13-2011 01:38 PM
@Richard2950 wrote:
If you just want two buttons to trigger the same case in the event structure, then add the second button by right-clicking on the event title at the top of the event structure and choosing "Edit events handled by this case", "Add Event" and choose your other button. Then pushing either button will trigger the same case.
Right. I figured it out after I replied to your first post.
I edited that post.
Thanks again.
05-13-2011 01:40 PM
@Mark Yedinak wrote:
@nyc_(is_out_of_here) wrote:
I am trying to add the <Event Message>: User Event to my event structure, but all I am able to get is <My User Event>: User Event.
What am I missing? I am using LV2010.
My preferred method for initializing my user events is to create a typedefed cluster for my user events. Within this cluster there is a cluster (typedefed) for each user event I would like to use. The elements of the individual clusters are the specific data associated with that event. Wire this cluster into input on the Create User Events VI. Then your event structure will have each user event available. In your code you only have one event (MyEvent) defined.
I attached a copy of a subVI that I use in my applicatons. I did not attach all of the typedefs associated with it but this would give you the general idea.
I've attached a very simple VI that I created trying to duplicate your VI. I am using LV2010 but saved it to LV8.0
I am unable to create <Event Message>: User Event in the Event Structure.
05-13-2011 01:52 PM
@nyc_(is_out_of_here) wrote:
@Mark Yedinak wrote:
@nyc_(is_out_of_here) wrote:
I am trying to add the <Event Message>: User Event to my event structure, but all I am able to get is <My User Event>: User Event.
What am I missing? I am using LV2010.
My preferred method for initializing my user events is to create a typedefed cluster for my user events. Within this cluster there is a cluster (typedefed) for each user event I would like to use. The elements of the individual clusters are the specific data associated with that event. Wire this cluster into input on the Create User Events VI. Then your event structure will have each user event available. In your code you only have one event (MyEvent) defined.
I attached a copy of a subVI that I use in my applicatons. I did not attach all of the typedefs associated with it but this would give you the general idea.
I've attached a very simple VI that I created trying to duplicate your VI. I am using LV2010 but saved it to LV8.0
I am unable to create <Event Message>: User Event in the Event Structure.
Got it working.
Thanks, Mark.
Something to add to my LabVIEW toolbox.
In case anyone is interested, attached is a very simple example I wrote based on your more elaborate VIs.
05-13-2011 03:31 PM
Try this.