Before investing time and effort into DQMH, please check out this much simpler design pattern and its simple supporting library. Also run the examples and examine their BDs.
https://forums.ni.com/t5/Reference-Design-Content/Event-Driven-Queued-State-Machine-EDQSM/ta-p/38419...