LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting a DVR

Solved!
Go to solution

Is it possible to use scripting to create a control that's a Data Value Reference to a specific data type?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 4
(1,353 Views)

It would have been as easy as replacing an array element (delete element, move new), except delete is not allowed in a DVR.

 

A way (only way I can think of) is to script a "New Data Value Reference", script a wired data type, script an indicator, then use that (or a constant created from it) to replace the original constant\control... Very inconvenient, as you'll loose descriptions, labels and such attached to the original, so you'll have even more stuff to worry about. 

 

 

0 Kudos
Message 2 of 4
(1,302 Views)
Solution
Accepted by topic author paul_cardinale

wiebe@CARYA wrote:

It would have been as easy as replacing an array element (delete element, move new), except delete is not allowed in a DVR.


It is just as easy (even easier) as replacing an array element:

 

Replace DVR Type.png

 

Simply get a reference to the DVR, get a reference to a control, and move it into the DVR.

 

Guess this works the same for constants:

Replace DVR Constant Type.png

 

BTW: The casts are useless.

 

BTW2: The VI reference constant should be replaced with Static VI Reference with a DVR and a control or constant. Think this is obvious to you, but who know who will be reading this.

Message 3 of 4
(1,299 Views)

Here's how to create a DVR constant from scratch, with a given variant data type:

 

DVR Constant With Type.png

 

A control is pretty much the same:\

DVR Control With Type.png

Message 4 of 4
(1,297 Views)