DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

DQMH multiple helper loop(s) + code review?

Hi,

 

I keep experimenting with the DQMH design pattern to do a system concept demo and I'd like to get some inputs about the followings:

  1. In my case my modules can do multiple fairly different things (although they are certainly related to the given module).These activities can't be executed in parallel so theoretically one helper loop could be enough. What I have found though is that using one helper loop keeps my BD compact but makes my code hard to read as there will be lots of code crunched into the timeout case of my event structure, so I have ended up using serveral loops which improved the readibility (at least for me) but made my BD pretty big. The question here: is there a best practice related to this problem?
  2. In the CML example the user calls a start acq. event and stops the acquisition by calling a stop acq. event. But what if the activity the user starts finishes on its own? For example the if we say that the acquisition always takes 5 seconds and then finishes without the user calling an event. Whats the right mechanic here?
  3. I made good progress and fairly happy with my modules but then came the part when had to start writing the part in which my modules start to interact, or in other words I had to start coding the process for which I wrote the modules for and here I feel I have failed miserably as I ended up with a VI which is absolutely not DQMH, but practically a VI seqeuentally using the events of the modules. One thing was particularly challenging for me is that I have lets say 5 different actions my system can do and the actions can happen in parallel but a given module can't be used by two actions simultaneously (so the modules have to be reserved as a resource). At the end my VI works and my system does what it has to do but I have the feeling that its poor quality code. Something tells me that maybe these processes should be organized into DQMH modules as well (in which the helper loop would do the given action), but I'm unsure if thats the right approach. Any advices here? 

 

All in all my concept works and I'm sure my customer would be happy to see how things are moving on the screen, but I'm unconfortable with my code and concerned that my code works for the demo, but mignt not be able to form a proper working system.

 

I know these questions are broad, but I couldn't be more specific. Let me know if you have any advices. If you know DQMH and volunteer for a quick code review session then PM me so we can set up a teams meeting or so.

 

Thx!

0 Kudos
Message 1 of 2
(759 Views)

  1. In my case my modules can do multiple fairly different things (although they are certainly related to the given module).These activities can't be executed in parallel so theoretically one helper loop could be enough. What I have found though is that using one helper loop keeps my BD compact but makes my code hard to read as there will be lots of code crunched into the timeout case of my event structure, so I have ended up using serveral loops which improved the readibility (at least for me) but made my BD pretty big. The question here: is there a best practice related to this problem?

Your issue above is a challenge to get right sometimes.  I recommend using more sub-VIs to keep your code in the timeout case neater.  To take a leaf out of Sam Taggart's book, keep iterating your code - slowly tidying it up, refactoring it, to keep it manageable.

 

3. I made good progress and fairly happy with my modules but then came the part when had to start writing the part in which my modules start to interact, or in other words I had to start coding the process for which I wrote the modules for and here I feel I have failed miserably as I ended up with a VI which is absolutely not DQMH, but practically a VI seqeuentally using the events of the modules. One thing was particularly challenging for me is that I have lets say 5 different actions my system can do and the actions can happen in parallel but a given module can't be used by two actions simultaneously (so the modules have to be reserved as a resource). At the end my VI works and my system does what it has to do but I have the feeling that its poor quality code. Something tells me that maybe these processes should be organized into DQMH modules as well (in which the helper loop would do the given action), but I'm unsure if thats the right approach. Any advices here? 

Regarding above, quite often the "application" or "top level" module does not need to be a DQMH module.  We still make the top level code a DQMH module in our applications, largely out of convenience. But they don't strictly have to be.  Look no further than your module's tester.  This is an "application" layer in a pretty simple form.  The tester is not a DQMH module, but it works quite nicely as an application reference architecture.

 


I know these questions are broad, but I couldn't be more specific. Let me know if you have any advices. If you know DQMH and volunteer for a quick code review session then PM me so we can set up a teams meeting or so.

 

Thx!


My recommendation here is to reach out to the DQMH consortium to book some time with a DQMH Trusted Advisor.  There will be a price, but it will be very valuable to your development and your project.  We did exactly this - booking time with Fabiola 5 years ago when we first started on our DQMH journey, and that helped set us up for the future.

Christopher Farmer

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

Message 2 of 2
(721 Views)