11-24-2022 05:05 AM
Great to read your message @_Ian_
I hope the DQMH framework will help you be successful in your project!
Shameless plug: don't forget to generate your code documentation with Antidoc 😉
11-30-2022 11:22 AM
@Olivier-JOURDAN wrote:
Shameless plug: don't forget to generate your code documentation with Antidoc 😉
Indeed - I found myself watching your GDevCon presentation last week!
(Which can be found here along with several other great presentations, if anyone else is interested https://www.youtube.com/watch?v=r0HKScV6Fwg )
10-13-2023 12:26 AM
@Ludwig72 wrote:
You have to add the helper loop manually. But there is already an accepted feature request for this. So you have that to look forward to.
What is the most definitive guide to date on creating my own helper loop ?
I feel a bit uneasy about copying the CML example given it doesn't look to be trivial coding as there is more than just the timeout frame in the ES which seem mandatory [1]. sure I could fumble about and get something working but as a nebiw to DQMH I am not confident - I like to take the easiest lowest risk method available.
Alternatively is there another method already supported in DQMH if I want to poll some switches at say 100ms rate and broadcast any switch state changes ?
[1]
10-13-2023 01:54 AM
10-13-2023 03:37 AM
Thankyou Christopher. The article is definitive enough for me and it helped me realise I can solve my need without using a separate helper loop, and keep the overhead to a minimum. In fact I see no advantage of a helper loop if I address reach caveat as follows:
In short, I can dedicate the module solely to be polling my switches and I need no helper loop ! Simple works best for me. Thanks again
10-13-2023 05:16 AM
Peter, I will check back with the rest of the Consortium later today, but I _think_ that our official recommendation is to *not* self-enqueue messages for periodic actions.
Here at HSE, we definitely do not allow that design for repetitive, periodic actions. We will always go with a helper loop for those scenarios. It gives us more control over when to start, when to run, when to stop, true parallel execution, protection from external influence (another request being executed in between polling), protection from flooding the queue, better readability, and probably other advantages I'm forgetting right now.
Since writing the article on helper loops in 2018, I gained five more years of experience with DQMH, and I have a much stronger feeling against self-messaging now than I had back then. Also, I cannot see where Fab would make a recommendation in her comment - can you please point me to it so I can update the article accordingly?
Furthermore, Sam's great article on the Simple Do's and Dont's says "Don’t Enqueue inside of MHL".
With all of that being said, whatever works best for you is a good solution for you. I just want to make sure that you understand the implications, and that others finding this page later have the complete picture and all the pros/cons.
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 )
10-13-2023 06:53 PM
Hi Joerg,
thank you for noting all those points. If a helper loop was available out of the box right now I would use it. I think I can mitigate the potential problems with self messaging per my reply above. I don't need to stop and start it, it will always be running and in true parallel execution because the entire module will be devoted to that one task plus no other cases will interrupt it. It won't be as flexible and convenient as a helper loop and if it gets too unweildy I can switch to a helper loop.
>Also, I cannot see where Fab would make a recommendation in her comment - can you please point me to it so I can update the article accordingly?
The first comment on this page is where she wrote "One thing I want to clarify is that DQMH modules are already Actors, they don’t need to have a helper loop to be considered an actor."
Her initial comment was basically saying a helper loop is not needed for a DQMH module to behave like an actor. She was open to helper loops and obviously has now adopted them but her initial comments were insightful for folks like me understanding what is possible.
10-24-2023 06:55 PM
Hi Peter,
MHL = Message Handling Loop
EHL = Event Handling Loop
CML = Continuous Measuring and Logging
We adopted helper loops for repetitive tasks early on. One of the earliest discussions I remember was the Message Pumps. We added the CML sample project as a way to show their use in October of 20018 for DQMH 4.1). In fact, they are so much a needed component of DQMH that DQMH 7.0 will have a way to script them. The Beta will come out anytime now.
I believe you are making an informed decision but you will have to keep an eye open for all the caveats that everyone has highlighted.
I will add my own take on the different ways to handle repetitive tasks and why I prefer helper loops to handle them.
There are different ways to get repetitive tasks working:
In summary, the Helper Loop is more flexible and easier to extend than doing self-enqueuing for repetitive tasks.
Now, to really blow up your mind. We have come to the realization that we should have named DQMH the DEHM because a DQMH module can exist without the MHL but it could never exist without an EHL.
I hope this helps.
Best regards and thanks again for your trust in DQMH and in us.
Fab
10-29-2023 09:29 PM
Hi Fab,
Wow. Thank you so much for chiming in and taking the time to write such a thorough reply !
The caveats are understood and I am willing to take any risks I have failed to mitigate. One thing in my favour in this instance is that I am polling some push button switches at about a 50-100ms loop rate, so I will not have to worry about any errors from not reading a DAQ buffer fast enough. The app is also runnning on a RPi so the executable never needs to exit except for an error condition and in such a case I will resort to debugging such an error manually using the LV IDE or perhaps an error log file.
I welcome the advent of helper loops and once they are debugged I anticipate utilising them as needed. I really appreciate your efforts to the LabVIEW community, esp. through DQMH.
Now, to really blow up your mind. We have come to the realization that we should have named DQMH the DEHM because a DQMH module can exist without the MHL but it could never exist without an EHL.
😲