DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is "Broadcast Events--cluster.ctl" private in the templates?

Solved!
Go to solution

Why is "Broadcast Events--cluster.ctl" private in the DQMH templates? I know there are public VIs that return this cluster: "Start Module.vi," "Obtain Broadcast Events for Registration.vi," "Null Broadcast Events--constant.vi." And it's LabVIEW so no type is truly private: I can drop the typedef in a diagram disable structure and use it that way. I am not asking about workarounds, I'm asking why the typdef is private if external callers clearly need access to the datatype?

 

There are consequences the workarounds don't fix: you can't pass the cluster into or out of a subVI without scope causing broken arrow, and passing it into a malleable VI works in development but breaks when building apps.

0 Kudos
Message 1 of 4
(211 Views)

If you need the data type anywhere, you can use the Null Broadcast Events constant VI. If you need the actual references, you can use the Obtain Broadcast Events for Registration VI, which is a functional global VI. The type is private because there should be no use case for passing the value around outside the control of the functional global VI. Why do you need to pass the cluster through a subVI boundary?

0 Kudos
Message 2 of 4
(191 Views)

@Darren wrote:

If you need the data type anywhere, you can use the Null Broadcast Events constant VI. If you need the actual references, you can use the Obtain Broadcast Events for Registration VI, which is a functional global VI. The type is private because there should be no use case for passing the value around outside the control of the functional global VI. Why do you need to pass the cluster through a subVI boundary?


Here's one https://forums.ni.com/t5/DQMH-Consortium-Toolkits/Register-for-module-events-inside-a-subVI/td-p/445....Generally, I want to use subVIs and classes to avoid growing the DQMH main into an unmaintainable monolith; the more broken up it can be the less probability of merge conflicts from parallel development and the easier it is to track changes with LVCompare.

 

Specifically, I'm writing a library that should work with any normal DQMH module by registering for the error and stopped broadcasts, and I wanted to unbundle those inside a malleable VI to save some nodes in the callers, but because that cluster TD is private its presence on the VIM instance front panel causes an app builder error.

 

All that said, I'm simply asking why it's private and why a workaround VI (nulls constant) was created instead of just making it public?

0 Kudos
Message 3 of 4
(182 Views)
Solution
Accepted by topic author avogadro5

@avogadro5 wrote:
I'm writing a library that should work with any normal DQMH module

If it should be generic, it must not use any specific module's typedefs anyhow. Instead, you can just recreate an event ref of the same type and use that instead (see this as an example).

 


@avogadro5 wrote:
All that said, I'm simply asking why it's private and why a workaround VI (nulls constant) was created instead of just making it public?

I think Darren already said it: The design decision made in the early days of DQMH was that you should not have to use the references themselves in any place. Instead, just drop one of the two VIs mentioned previously.




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 )


0 Kudos
Message 4 of 4
(134 Views)