LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic creation of polymorphic VIs / inputs of a single VI adapting to source

Is there any, even an undocumented way to create VIs with inputs that would adapt to source. I don't mean normal polymorphic VIs for which you need to repeat your code as many times as you want variations to the inputs (which is 176 in my case)?

The thing is I just would like to wrap my DLL as a VI. Since the DLL can use adapt to source inputs, I would like to propage this polymorphism outside the VI. If this is not possible I need to create 4 x 176 VIs with exactly the same code but different type inputs and then create a polymorphic VI from them. If I later want to change something, I need to repeat the copy process.

If the previous is not possible, is there a way to create the polymorphic creation process automatic and by programmatically changing the type of an input? What about programmatically adding the VIs to a polymorphic VI?

I assume that the answer to both of these questions is no (unless I somehow can create xnodes).

EDIT: I suggest that a concept of a polymorphic controls and indicators will be launched. Instead of creating a polymorphic VI the old way, one could create polymorphic VIs by defining the controls polymorphic. A polymorphic control would be like a polymorphic VI. One could add one or more controls to the polymorphic control. A programming time error would occur if any of the polymorhic instances of the controls didn't match inputs of the subVIs on the block diagram or the (polymorphic) indicators. A polymorphic indicator could be adapted to the polymorphic controls on the same VI.

Tomi





Message Edited by Tomi M on 06-05-2006 10:58 PM

--
Tomi Maila
Message 1 of 6
(3,452 Views)

Knowing what a "Xnode" is puts you out of my league. Smiley Wink

I have played games with doing stategic renaming etc.

You probably know the game already.

1) Everything closed.

2) Open a typdef of a control.

3) Edit the control the way you like it.

4) OPen the VI's that use the typedef.

5) Save the typedef as a new name.

6) Save the caller as new name (from the bottom up).

Lather rinse repeat.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(3,447 Views)
Ben. I maybe tired (it's midnight here), but I didn't quite get your solution...

At the moment I'm using a typedef to define the type, let's say SGL. Then I create a VI with a multidimensional array control of the typedef, let's say 10d array of the typedef SGL. Then I go on removing one dimension at a time and saving as a copy and removing and saving until I have VIs with a scalar control and array controls 1-10d. Then I convert all this to a library. Then I  save a copy of the library (which makes a copy of all the files). Then I modify the typedef in the copy of the original (SGL) library to change its type to let's say DBL. Then I again make copy of the library and modify the new typedef. I go on until I have all the numeric types covered. But this is defenitely not fun. Smiley Sad Was your solution easier?

Tomi

Message Edited by Tomi M on 06-05-2006 11:53 PM

--
Tomi Maila
0 Kudos
Message 3 of 6
(3,438 Views)

I'm not quite sure if I'm not distracting you with something that does not work.

This time slowwer with more words.

1) Collect a bunch of typef'd controls in a folder.

2) Create a VI (VIT) that uses a typedef'd input where the said control is just a typical control with name A..ctl.

3) Write code that does the folowing.

4) Get list off ctl in folder from step 1.

5) Open 1st ctl in folder and do a "save as" "A.ctl" over top of where "A.ctl" (from step 2) was.

6) OPen the VI (VIT) (from step 2). It will see the typdef'd control as "A.ctl".

7) Open a ref to the typedef'd control and do a "save as' to a llb as "Version1.ctl"

😎 Do a "save as" on the VI(VIT) into your llb as "Version1.VI". The VI in the LLB is now pointing a "Version1.ctl"

9) Close the VI (VIT) without saving.

10) Repeat 5-9 for all controls found in the folder.

When the VI si done, you should have a complete set a VI's all pointing at their own ".ctl".

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 6
(3,427 Views)

Ben -

step 7, I cannot find a method to do a 'save as' on the control (typedef)

please see the attached jpg

is there a different way to do this? 

 

otherwise this is very cool thanx 

 

lmd2 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 5 of 6
(2,986 Views)

okay, got it

the control class only exposes the typedef method if the scripting API is installed and activated.

see this post:

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=454252&jump=true

 

thanx "tst" 

 

 

Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 6 of 6
(2,953 Views)