DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Registering to broadcast events from many modules

Hello Joerg

 

Good to know. I was thinking the mistake was done by me. Your idea with an additional wrapper is a good solution to go on. In my application I need all broadcasts, so also the special broadcasts per modul, though. Finally I now take the origin Start.vi's. Because I have only 10 moduls to implement it is acceptable.

 

br Markus

 

 

0 Kudos
Message 11 of 15
(1,088 Views)

Hello Fabiola,

I'm doing what are you suggesting on the second option, but I'm not capable of registering broadcast events from other modules. The thing is I implemented this on a logger module and my idea is to record messages from other modules using the broadcast functionality.

If the modules are running and I use the default send MHL or EHL error buttons, I should have be able to record them on the Logger module, right?

Logger.png

Thanks in advance.

 

0 Kudos
Message 12 of 15
(420 Views)

Are you starting your logger module when all the other modules are already running? Or, in other ways, have you made sure that the other modules are already running when you start your logger?

 

Beware: The "Obtain Broadcast Events for Registration.vi" will only return the actual references if the corresponding module is already running. See https://documentation.dqmh.org/DQMHProjectStructureOverview.html for more details.




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (The Future of Team-Based LabVIEW Development)


0 Kudos
Message 13 of 15
(399 Views)

You are right, the other modules have to be running. I tried this and it works. The thing is I want to create the logfile at the same time when I start the UI module, that's why I was sending this message to the Logger module. 

I've managed to get it to work with this workaround (something similar to Fabiola'a 1st option), but I don't know if it's the most elegant solution:

IPach_0-1693465505273.png

 

0 Kudos
Message 14 of 15
(390 Views)

At HSE, we strongly recommend not to place any code (other than preparing event registrations) outside the MHL or EHL. Or, to be more precise, we do not execute any code before the "Initialise" case in the MHL has finished executing. 

 

My suggestion would be to have a single module that takes care of starting modules, then taking care of any event registrations (potentially asking one module for its broadcast references and then forwarding those references to another module for dynamic event registration without any static dependencies between those modules), and only then triggering modules to start doing their actual work like initialising log files, connecting to hardware etc.

 

That way, you have full control over when to execute which part of your code or application.




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (The Future of Team-Based LabVIEW Development)


0 Kudos
Message 15 of 15
(378 Views)