LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

user events vs notify event

I've read a number of whitepapers on User Events and Notify/Wait on Notification.  They seem quite similar to me, and I'm not sure which to use.  I have (well, when I write it) a transmit/receive VI that I think will be running in a separate thread.  It's supposed to listen for TCP/IP (rx) messages and "notify" (I use that generically here) a test that's waiting for this message.  That test would access some Shared Variable, or user-defined data to extract/process the message.  I will (possibly) then build a message (in another shared variable) response, and "notify" the tx routine that it has something to send.  I (obviously) don't have all of this worked out, but I'm assuming right now that I need to open and keep open the TCP/IP socket because it' going to be a secure (https/ssl) channel.  That's why I thought I would make this a separate thread.  With this in mind, is User Event or notifier more suitable or even the right approach?
0 Kudos
Message 1 of 4
(3,333 Views)
Based on your description I would recommend that you use queues to pass your messages through the system. Queues are similar to notifies with one major difference. With queues you can stack up multiple messages to be processed. With a notifier you only get a single message. The event structure works best for UI types events. Though you can define your own events I don't think the event structure would be the best option for your situation. However you could still use an event structure for processing your UI events.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 4
(3,325 Views)

While reading about Obtain Queue Function, I saw this statement in a note:  "If you obtain queue reference in one application instance, you cannot use that queue reference in another instance"

 

If TestStand starts a subsequence (containing my Rx/Tx VI) in a separate thread, is this considered the same/different application instance?

0 Kudos
Message 3 of 4
(3,310 Views)
If both LabVIEW and TestStand are started from within the same application they can share a queue. The statement you read was referring to two separate and disticnt exe applications. They cannot share a native queue. However in that instance they can use a network queue. See this discussion over on LAVA regarding network queues.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 4
(3,301 Views)