DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Module registrations / start up sequence

Solved!
Go to solution

Trying to to implement a logger module to assist in debugging an issue, I broke my code by merely reordering the module registration order.
No compile time nor run time error.  Just that no data is being received but I'm not sure why.  


My application has:

DisplayUI module, this is the main one that kicks everything off and presents the UI.

ADSSClient module, responsible for configuring and setting up the dataserver.

Policy module, once setup, polls the dataserver on fixed cycle and broadcasts the data to the DisplayUI to be displayed.

 

so what's confusing is when I step into the the DISPLAYUI module, the very first step (even before the DisplayUI INIT)  is POLMOD and the bottom one.  Then it goes to the DisplayUI INIT.  

This is different than waht I assumed the start sequence is as shown in the DisplayUI module and in depth first order.

 

So how do I know which is the order being processed?

 

shuttlefan_0-1736798581759.jpeg

The policy is started once server communications has finished and is initiated by ADSSClient module
shuttlefan_0-1736800691158.jpeg

 

Once it starts, I update the other modules by calling.

shuttlefan_1-1736800739109.jpeg

shuttlefan_2-1736800753392.jpeg

 



 

 

 

0 Kudos
Message 1 of 19
(488 Views)

I would try running an error wire between each start module and broadcast reg vi to control the order of execution.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

Message 2 of 19
(459 Views)

@ChrisFarmerWIS wrote:

I would try running an error wire between each start module and broadcast reg vi to control the order of execution.


OK, I can try that.  So should all the registration happen before the module's INIT call? or should the first reg be AFTER the INIT call as well?

 

0 Kudos
Message 3 of 19
(449 Views)

In the top level module, I typically register for broadcasts for all modules to the left of the block diagram as the first thing done.

 

Then I create a "Launch children modules" internal event that is called by the Initialize case.  In here it goes and starts all modules.

 

If there are other modules launched separately by the children modules, then I wait for them to be ready and then call another internal event "Refresh registrations" to then register for any other modules that the top level module didn't launch itself.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

Message 4 of 19
(445 Views)

Hmm....doing error lines I end up with only DisplayUI module running. 
Without it, I could get DisplayUI and ADSSClient modules. 

shuttlefan_0-1736825846291.png

shuttlefan_1-1736825906996.png

 

0 Kudos
Message 5 of 19
(429 Views)

I recommend that you actually track what's coming out of those errors - maybe you've got an actual error and hence the flow on VIs are not executing.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 6 of 19
(425 Views)

yeah, that's just the issue.... All the errors output show none.
I tried stepping through but that in itself introduced errors that I don't see when I just run it.  

 

 

I've isolated to that from my top level DisplayUI module, if I connect the StatLog to ADSSClient by error line, then ADSSClient does not fully initialize.  If I don't connect that error line, then both ADSS and StatLog both run.

 

shuttlefan_0-1736827286004.png

 

0 Kudos
Message 7 of 19
(422 Views)

I want to add that in our "launch children modules" case, we have a for loop where we launch each module one at a time in turn.  That way we dictate the order in which they're launched.  For instance we have a configuration module in our applications, and we launch that first so that we can get access to the config data and pass that on to the subsequent modules.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

Message 8 of 19
(419 Views)
Solution
Accepted by topic author shuttlefan

Found the issue.  It wasn't the order but the fact that I forgot that actual module start needed the error wire to go back in the registration.  The broadcast for reg does not.


shuttlefan_0-1736840096928.png

 

Message 9 of 19
(401 Views)