LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting - replace invoke node

Thanks - I looked through the examples and did not see anything on dealing with clusters and the bundlers...

 

I'll take a look at the supplied links and info and maybe add my experiences so others can seearch and find it.

 

Dan

 

0 Kudos
Message 31 of 39
(1,349 Views)

Hi Dan,

 

Have a look at this example.It uses Label.Text property from the Control class to extract the names on the controls from a cluster.

 

 

Sev K.
Senior Systems R&D Engineer | Wireless | CLA
National Instruments
0 Kudos
Message 32 of 39
(1,344 Views)

Alright, I have the bundle by name now displaying the names:

 

This is a code snipit of a new place that I'm having problems....  After I replace the bundler with the named bundler (pretty slick btw) I then try to get the names of the terminals so that I can ensure that the connectors from the method will connect to the bundler correctly. (see the attached VI to see what I'm talking about.  This is one of the VIs that I am so far able to create (to this point).

Bundled connections

 

 

Overall, I think this is going pretty good so far.  I really appreciate all the help and guidance.

 

Dan

 

0 Kudos
Message 33 of 39
(1,340 Views)

Forgot to ask my question.

 

How best to connect the terminals of the method outputs to the inputs of the bundle by name?

 

I was thinking for security that I would want to get the names of each and match them on the corresponding object...  if they match wire them, if they don't then try again.

 

BUT on the code snipit that I posted, the code gets to the property:Bundler:Terms[] and then says "Object Reference is invalid." I tried casting to the named bundle, but it gave the same error.

 

 

0 Kudos
Message 34 of 39
(1,339 Views)

After the replace operation you have to use the output reference (Replace), the reference you wired is no longer valid.

Message 35 of 39
(1,335 Views)

Got it... 

 

I had tried that (pretty much instinct knowing that the ref was now a new one), but then my property node broke... THAT's where I needed the cast to more specific class!!!!

 

I just had not put both steps together.

 

Thanks,

Dan

 

0 Kudos
Message 36 of 39
(1,333 Views)

Good NEWS!!

 

I have succeeded in connecting all versions of the outputs!!!

 

If there are no outputs, the code that wires that is skipped. If there is one output it is connected to the 2nd connector down on the output side of the connector pane (the top is used for the .NETRefOut). If there are 2 outputs, then the 2nd is placed on the connector pane just below where the 1st is placed. If there are 3 or more, they are all collected into a cluster, then wired to the bundle output cluster term, a constant is created and wired to the bundle input cluster term, the outputs of the .NET method are then connected to the named inputs of the bundle function and finally the output cluster is connected to the 2nd down from the top output on the connector pane!!!!

 

Thank you ALL so much for your comments and suggestions.

 

Dan

 

0 Kudos
Message 37 of 39
(1,330 Views)

Got the inputs working....

 

 

This is SO COOL!!!

 

I can now build 100's of labVIEW interop VIs in a matter of minutes that will interface with our released (and proven to work) C# drivers freeing up our LV programmers to focus on the hard stuff rather than recreate the wheel every time!!!!

 

Thanks again for the help.

 

I need to clean things up and then I can post examples.  Where is a good place to post examples of like how to work with clusters etc....  things with limited references (other than you)?

 

Dan

 

0 Kudos
Message 38 of 39
(1,323 Views)

Hi Dan,

 

I'm glad you figured everyting out. You can upload your example code to the NI Developer Community Examples Database

Sev K.
Senior Systems R&D Engineer | Wireless | CLA
National Instruments
0 Kudos
Message 39 of 39
(1,319 Views)