キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Scripting a DVR

解決済み
解決策を見る

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 件の賞賛
メッセージ1/4
2,008件の閲覧回数

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 件の賞賛
メッセージ2/4
1,957件の閲覧回数
解決策
受理者 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.

メッセージ3/4
1,954件の閲覧回数

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

メッセージ4/4
1,952件の閲覧回数