취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

VI Scripting: get reference of the duplicate element

해결 완료!
솔루션으로 이동

In VI scripting I copy element (any type of indicator, control, constant) with Move method with duplicate property - true. The output top right terminal of the method is the reference to the source object, not the new one.

Is there any straightforward way to get reference to that copy (other copy method, etc)?

 

Not straightforward solutions (they may work on test examples, but not good)

1) move to temporary cluster - easy to find a new element

2) list all objects before, after and compare lists. But the source VI can be of any size and complexity.

3) Create element copy manually - bad, the solution should work on all kinds of elements.

0 포인트
1/5 메시지
2,954 조회수
솔루션
주제 작성자 Alexander_Sobolev이(가) 승인함
I would use the VI method Create From Reference in this situation.
2/5 메시지
2,948 조회수

Good method.

It is almost working!

It can create controls and indicators, but fails with constants (Class conflict, when wiring constant reference to the Source Object Reference terminal)

 

Besides, there is a wrong description of the method (LV 2011):

LabVIEW help

Create from reference method:

Source Object Reference

A reference to the object you want to duplicate on the target VI. If you use this parameter, you do not need to wire the _type descriptor and style fields_.

There are no type descriptor and style fields at all, they are in other methods

 

Who is failing, me or LV? 😃

0 포인트
3/5 메시지
2,933 조회수

Documentation errors in scripting are par for the course I am afraid.  I missed that you were doing constants, Create from Reference works with FP objects, despite what the help may say.  For constants you can use the Create From Datatype method of the BD.  

0 포인트
4/5 메시지
2,919 조회수

Very strange method with incomplete documentation 😃 

And it does not copy an object - it creates absolutely new one. And in my case the constant type is not defined - it can be anything: cluster, typedef, etc.

Copying to the cluster (for constants) is an acceptable workaround, it works =). I'll wait till Create from reference is synchronized from it's help 😃

Darin, thanks for help.

0 포인트
5/5 메시지
2,912 조회수