06-01-2016 07:00 AM
Hey guys,
I have two questions really, first, whats the best way to receive messages in the event structure? I've been looking at user events, and that seems like a good option if I only ever want to send a single message. Ive never found an example where the regester for events has a second event its looking for. I currently use queues from the event structure to my other loops.
My second question is do I even want to send messages to the event structure, my current thinking is that it would make things easier to follow if the event structure dispatched all the messages to individual loops. Is is more appropriate to just have one loop talk directly to another through the queues already in place?
Im thinking ill set up an user event for handlng errors but im not sure about the other messages.
Thanks guys
Solved! Go to Solution.
06-01-2016 07:09 AM
You should take a look into Queued Message Handler design (Create Project Wizard).
You do know that you can expand the Register Event node just like any property node?
Norbert
06-01-2016 07:13 AM
@pathare535 wrote:
whats the best way to receive messages in the event structure? I've been looking at user events, and that seems like a good option if I only ever want to send a single message. Ive never found an example where the regester for events has a second event its looking for. I currently use queues from the event structure to my other loops.
Definately User Events. You can drag the Register For Events to have more inputs (like a property node). Or your can bundle a bunch of registered events together and wire that up to the dynamic event terminal.
@pathare535 wrote:My second question is do I even want to send messages to the event structure, my current thinking is that it would make things easier to follow if the event structure dispatched all the messages to individual loops. Is is more appropriate to just have one loop talk directly to another through the queues already in place?
There is nothing wrong with other loops sending messages to the GUI loop. I do this all the time. Sometimes purely for display purposes. Sometimes to let it know that something encountered a critical error and therefore everything must shut down. There are lots of reasons you would want to get these messages from the other loops.
06-01-2016 07:14 AM
Yeah, from what I've read I really need to work on adopting that, I looked at it for a minute and had a hard time figuring out how to use it. I probably just need to spend more time with it though.
Thanks
06-01-2016 07:18 AM
@crossrulz wrote:
@pathare535 wrote:whats the best way to receive messages in the event structure? I've been looking at user events, and that seems like a good option if I only ever want to send a single message. Ive never found an example where the regester for events has a second event its looking for. I currently use queues from the event structure to my other loops.Definately User Events. You can drag the Register For Events to have more inputs (like a property node). Or your can bundle a bunch of registered events together and wire that up to the dynamic event terminal.
When I do that can I have a new event for each User event or do they all come into the same user event window? Also can the use the same user event reference wire?
06-01-2016 07:25 AM
06-01-2016 07:25 AM
You can get event for individual events. Even better, you can use clusters to group different events together and access them individually (see below).
06-01-2016 07:34 AM
Oh wow! I read your blog all the time actually, thanks! It almost always comes up when I'm googling questions.
06-01-2016 08:08 AM
06-01-2016 08:30 AM
Thanks for pointing out the naming convention! Now I can maintian my usual naming convention with my user events.