Public and Private Requests
When you create a new Request event with the Create New DQMH Event tool, you have the option to specify the Request Scoping of the new event:
By default, new Request events are created with Public scoping, which means the new request will be part of the module’s Public API, and code external to the module can call this request. Public Requests are one of the fundamental building blocks of DQMH, and have been part of the framework since its initial release.
There are times, however, where the module needs to communicate with itself internally, without the possibility of external code performing that communication. If this communication is limited to the MHL of the DQMH Main VI, you can use the DQMH Message Queue and program the MHL to message itself. But if instead you need inter-loop communication within the DQMH Main VI, and that communication needs to be event-based (to fire events in a Helper Loop, for example), then you may need a Private Request for that communication.
Private Requests are not part of the module’s Public API, and are scoped as private to the module .lvlib, meaning no VI outside the module can call the private request. Some common use cases of Private Requests include:
-
Waking up a helper loop
-
Putting a helper loop to sleep
-
Sharing local module data between loops within a module Main VI
When creating a Private Request, you can specify which event loop in a module Main VI will be registered to receive that request. Additionally, you can configure a Private Request for a cloneable module to be Local Instance Only, which means the specific cloneable instance that fires the Private Request will be the only instance to receive that request. This is different from regular request events, where every cloneable instance receives a request when it is fired.