LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW VI scripting: finding out "new VI object" parameters

Hi

 

I'm pretty new to LabVIEW, so I hope you'll pardon me if this is a stupid question.

 

Problem background:
I have to interface with a .NET shared library. So far I can manually create VIs making calls in that library, it works, it's stable, I'm happy. But since that library is automatically generated  and contains many .Net classes that need interfacing , coding all matching VIs manually for is not an option. Hence my interest for VI scripting.

 

Problem:
I followed NI's VI scripting tutorial, it's quite fun but it only covers very basic stuff and  there a few a aspects i don't fully understand. How are we supposed to find out which parameter to feed to  "new VI object " ?  here is a example, if I want to create a "invoke node(.NET)" (from  Connectivity/.NET palette), what am I supposed to choose for "VI object class" and "object style" ?

 

  Finding out "new VI object" parameterFinding out "new VI object" parameter

So far the closest thing to "invoke node (.NET)" I managed to create is  "Invoke node" from programming/application control palette.

help!

0 Kudos
Message 1 of 18
(3,180 Views)

Hi,

 

the create new object function returns a reference to the new invoke node. You can use this reference to edit the invoke node using property and invoke nodes. Note that you will find the properties for invoke nodes only after using "to more specific class" on your new reference.

 

Regards

ʍolɟɐʇɐp ʞuıɥʇ
0 Kudos
Message 2 of 18
(3,163 Views)

Actually, I don't need to create a new object, all my objects are automatically allocated within my shared library: I use a "invoke node (.NET)" VI to call a static method in the library that will return an object reference , then I use more "invoke node (.NET)"  VIs to interact with this object through that reference.

As I said, interfacing with the shared library is not a problem, it's done and it works as long as I create the VIs manually. But  I want to create these VIs programmatically because there are too many of them, so  I need a way to programmatically create a  "invoke node (.NET)" VI through VI  scripting, which I can't figure out.

0 Kudos
Message 3 of 18
(3,158 Views)

@yoctopuce wrote:

Actually, I don't need to create a new object

[..]

I need a way to programmatically create a  "invoke node (.NET)" VI through VI  scripting, which I can't figure out.


Your invoke node is a new object. You are creating it by using the "create new object" VI (the first one after the red circle in your picture). This VI has an output "object refnum". Right now aou are only closing this refnum.

What i suggestes meant: wire this refnum to property nodes or invoke nodes to modify the new object (in your case also an "invoke node")

ʍolɟɐʇɐp ʞuıɥʇ
0 Kudos
Message 4 of 18
(3,155 Views)

Are you implying that  "Invoke node" and  "Invoke node .NET"  are equivalent ?

0 Kudos
Message 5 of 18
(3,149 Views)

I would guess so as you can simply drag an invoke node from the palette into the BD and use right-click -> select class to switch to .NET. So that is what i would try to achieve with scripting: first create the node then change its settings.

ʍolɟɐʇɐp ʞuıɥʇ
0 Kudos
Message 6 of 18
(3,143 Views)

Ok I'll give a try and report there.

0 Kudos
Message 7 of 18
(3,133 Views)

One more detail I missed before: there is a more specific class then the "node" class that you use in your picture.

 

ʍolɟɐʇɐp ʞuıɥʇ
0 Kudos
Message 8 of 18
(3,122 Views)

Here's a sample diagram that will create a new VI, drop an Invoke Node on its diagram, change its class, then change the method. I hope this points you in the right direction.

net.png

Message 9 of 18
(3,112 Views)

Wonderful! Thank you very much!

0 Kudos
Message 10 of 18
(3,108 Views)