LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
raphschru

Create/destroy a DVR with a runtime-defined data type

Status: New

Current state:

 

To create and destroy a DVR, its data type must be statically specified on the diagram:

raphschru_8-1770050580364.png

 

In case we want to abstract the data type for the creation and destruction of the DVR, we have to use workarounds like using a DVR of a variant:

raphschru_5-1770048875197.png

 

The problem is that it sacrifices data access efficiency for the sake of DVR creation/destruction genericity.

 

Idea:

 

Provide a way to create and destroy a DVR with a data type defined at runtime.

 

The "Create" node would take a variant for the its data type and output a U32 representing the reinterpreted strictly-typed reference.

The "Destroy" node would take the U32 and give back a variant containing the last value.

 

We could either have new nodes in the "Memory Control" palette, or just a new right-click option "Generic" on the existing nodes:

 

raphschru_7-1770049507065.png

 

It would allow to manage the creation and destruction of DVRs generically (reducing boilerplate code), while still having DVRs of strict types (improving efficiency compared to a DVR of a variant).

 

Example usage:

 

1. A malleable VI for batch creation of DVRs specified in a cluster of DVRs:

raphschru_9-1770052894033.png

 

 

2. Separation of data type definition and DVR instantiation:

raphschru_0-1770056394515.png

 

Regards,

Raphaël.