04-18-2024 07:39 AM
Is there an easy way to know if a module is initialized? I mean I can register and capture the "did init" event but I'm launching about 20 modules in parallel so this seems tedious. My current solution is to simply wait 750ms, but this is quite poor.
Wouldn't it make sense to have a VI generated automatically for the modules which can be used wait for the "did init" event of the module?
I may miss somehing, though.
04-18-2024 10:32 AM
I'm curious: Why do you need to know exactly when the "Did Init" broadcast was sent? Is it to understand when additional code that you put inside the "Initialize" case of the MHL has finished executing?
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® (Developer Experience that makes you smile )
04-18-2024 11:58 AM
I'm also curious. I've definitely needed this functionality before, but only a handful of times in some corner case scenarios... definitely not enough that I ever wished the framework scripted it for me.
04-18-2024 05:27 PM - edited 04-21-2024 07:47 PM
Our standard approach at Wired-in is that every module has a request and wait for reply called "Initialise settings". Here we send down the parameters/settings that we want the module to run with.
We call this immediately after starting/syncing the module, and basically when the reply comes back, we know it's now setup and initialised.
04-19-2024 01:09 AM
@joerg.hampel wrote:
I'm curious: Why do you need to know exactly when the "Did Init" broadcast was sent? Is it to understand when additional code that you put inside the "Initialize" case of the MHL has finished executing?
From time to time I got into a situation when I assume that a module missed a request right after starting the module. Now I did a test with my logger module and couldnt reproduce so it might be an issue on my end.
04-19-2024 07:44 AM
@1984 wrote:
From time to time I got into a situation when I assume that a module missed a request right after starting the module. Now I did a test with my logger module and couldnt reproduce so it might be an issue on my end.
The design of DQMH should make it impossible for modules to "miss" requests if the sequence of steps is implemented correctly.
As you can see, after (4), both the module and the external caller are both ready to start exchanging data.
If you send requests to your module only after the "Synchronize Module Events.vi" at the caller has returned, then all the event references and the queue reference have been created successfully, and there should not be any scenario where a request can get lost.
Please let me know if you feel like I'm missing something - I think this is a very important topic and I want to make sure we get it all right!!
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® (Developer Experience that makes you smile )
04-22-2024 01:41 AM
Thanks a lot for the very detailed explanation.
Your explanation used the VIs in this order:
While I just found that for couple modules (including the logger) I used something like this:
Is it possible that could cause a missing event? I guess not, but this is the only difference between your implementation and mine.
At this point I'm not sure if what I saw is related to DQMH at all, it might be a programming error on my end. The module works fine, its just that some time in the past I've seen that the first message was not logged.
04-22-2024 03:18 AM
If you don't wait for the event registration to return before executing the "Synchronize Module Events.vi" (i.e. not wiring the error cluster as shown in your snippet), you could miss the first broadcast(s) sent by the module. Seeing as the request events and module queue have been created once the "Start Module.vi" returns, I can't see how requests could get lost.
My recommendation is to invest the energy to make sure the VIs and event registration are executed in the correct order. This usually pays off in being able to spot problems at module start time - similar to a plane taking off, this is usually a critical point in time.
I know that this is sometimes a pain because of where you start modules (MHL?) vs. where you need to register for the broadcasts (EHL?), but there are a few ways to get this done. I might write an article about this sometime soon.
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® (Developer Experience that makes you smile )