LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing .net reference between different vi or sub vi files

Hello

 

I am a bit new to Labview. I am trying to communicate with a hardware using .net assembly. Functions to initialize the hardware driver is written in c#. I am using a constructor node and then Invoke node. There is a reference coming out of ' Invoke' node. I want to use this reference in different vi files; otherwise my Labiew program would become very bulky. I want to save this reference and use it according to my need ( in a same project maybe).

0 Kudos
Message 1 of 6
(3,122 Views)

Right click on the terminal and select "Create Indicator". Then go to the front panel, Right click again and select "Advanced->Customize..". This will open the control in the control editor from there change under the menu bar in the selector the "Control" to either "Type Def" or "Strict Type Def".

 

No you can save it to disk like a VI with "File-Save As.." but with the .ctl suffix and then reuse this contorl elsewhere in your project.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 6
(3,095 Views)

Thanks a lot.

Can you tell me how to use this control ? I men where to open or which pallett to open?

0 Kudos
Message 3 of 6
(3,070 Views)

Putting it in a palette is a bit more work and not something you should probably attempt to do before knowing a bit more of LabVIEW. Just copy/paste it from another VI that already uses it or drag and drop it from the windows explorer onto a front panel.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 6
(3,056 Views)

Thanks

 

 

I have tried the same technique as you told but unfortunately I am getting an error. It says that

 

System.ArgumentNullException:Key cannot be null. Parameter name:Key

 

 

May be the value is destroyed somewhere when passing this reference. I would like you to help me in this regard.

 

Mit freundlichen Grüßen / Best regards

Omer Bashir

Robert Bosch GmbH
Diesel Gasoline Systems, HW Engineering Modules (DGS-EC/EHM)
Postfach 30 02 20
70442 Stuttgart
GERMANY
www.bosch.com

0 Kudos
Message 5 of 6
(3,017 Views)

The error message is pretty useless for helping you. It doesn't help us to see how you use the functions and basically limits our knowledge to what you already know too: that something doesn't work!

 

I can go on and write 5 pages of possible reasons why this error could happen. But this would be a waste of my time, and most likely confuse you with many unfamiliar terms and unrelated possible causes of your problem.

 

Post the VIs with the code and then we can better see what might be the problem.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(3,002 Views)