LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview calls .NET DLL

Hi,

 

I have a simple vi interface in which, by choosing the command from a listbox the VI call a DLL method.

Zuc_lab2_0-1779115405181.png

 

The reference obtained by the constructor node is passed by the Shift register through the different loops, but sometimes, especially when the users change command (so he/she double click on the listbox element) the error 1172 of null reference is shown:

 

“Invoke Node System.NullReferenceException: Riferimento a un oggetto non impostato su un'istanza di oggetto. <append><b>System.NullReferenceException</b> in Main.vi”

 

I have tried to debug it inside the code of the DLL and in the VI but I don’t find any reason to that (especially in debug mode it shows morerarely), do you have any idea?

 

Best Regards,

Zuc

0 Kudos
Message 1 of 5
(143 Views)

Hi Zuc,

 


@Zuc_lab2 wrote:

The reference obtained by the constructor node is passed by the Shift register through the different loops, but sometimes, especially when the users change command (so he/she double click on the listbox element) the error 1172 of null reference is shown:

 

do you have any idea?


Did you wire the reference in ALL cases of the inner case structure and in ALL event cases?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(105 Views)

Hi  ,

 

Yes i have just checked and everything seems connected correctly. I havce added my VI in the LV 19 version. 

I'm working with 2026 version.

 

Best Regards,

Zuc

0 Kudos
Message 3 of 5
(77 Views)

I suggest you move the each of the three button terminals into their corresponding event cases and get rid of the delay function in the while loop. It isn't obvious that there is any problem with any of these things but the current arrangement is a bit unorthodox.

 

I'd be inclined to check the reference directly after the constructor node (before the while loop), immediately after the left hand shift register and immediately before the right hand shift register by using a 'not a number/path/refnum function together with a case structure and breakpoint in the true case, or you could use conditional probes if you prefer. 

 

Once you catch a NULL reference you'll have a better feeling of where it's going wrong, just add more debug until you've found which .net call is seeing the NULL refnum.

 

It doesn't appear that any .net calls are made in response to a double click in the listbox, so something weird is going on.

0 Kudos
Message 4 of 5
(52 Views)

Hi Spruce,

 

Thank you for the advices, i will try to debug more.

The double click on the list box will only select the tab page to show, it will not send directly the .NET command sorry if i have explained wrong in the previous post!

 

Best Regards,

Zuc

0 Kudos
Message 5 of 5
(18 Views)