From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

DQMH modules listening to each other's broadcasts

Solved!
Go to solution

Can one DQMH module register for other module's broadcast event if the module registering did not launch this other module. In other words if I have 2 DQMH modules, let's say launched by some other means... even manually... let's say... can these 2 modules register for and receive each other's broadcasts, by simply instantiating each other's "Obtain Broadcast Events for Registration.vi". Something tells me the answer is no, and does it have anything to do with whatever the "Synchronize Module Events.vi" does? Thank you.

0 Kudos
Message 1 of 3
(3,369 Views)
Solution
Accepted by topic author Rafal_Kor

Hi Rafal_Kor,

Short answer:

Unlike Actor Framework, any VI with an event structure can register to the broadcasts of any DQMH module regardless if they were involved in the launching of those modules or not. 

 

Long answer:

Obtain Broadcast Events for Registration.vi wraps a functional global variable with the broadcast event references. These references are only created by the DQMH module when it starts. If the module has not started yet, the output of this VI is null references. So in order for an event structure to be able to register for the events of a DQMH module, the DQMH module needs to be already running.

 

Alternatively, the Start Module.vi does return the broadcast events for registration and, in the case of singletons, can be called from as many places as you wish and it will always connect to the same singleton instance.

 

The Synchronize Module Events.vi is there to ensure that the Module has completed initialization before we send it requests and that the calling code has registered for broadcasts before the module starts broadcasting events. I suggest you open the Start Module.vi, the Obtain Broadcast Events for Registration.vi and the Synchronize Module Events.vi. We have placed several free labels describing what the code is doing, also check the VI documentation. Please let us know if we can improve this documentation in any way.

 

Regards,

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
Message 2 of 3
(3,364 Views)

DQMH works like a charm. Thanks for your quick response, and of course now, on second thought, I think I remember thinking to myself, not to forget to launch the one module first before any other module trying to listen in to the first module's broadcasts, but then the long weekend happened, and I forgot. Thank for helping so quickly. Delacor is awesome!

Message 3 of 3
(3,359 Views)