Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

PixelValue2D constructor won't work (labview)

I am trying to use a constructor for the pixelvalue2d union class. If I select the constructor and wire the reference to a property or invoke node, I get the following:

 

"Error 1172 occurred at Property Node (Arg :1) Error accessing property NationalInstruments.Vision.PixelValue2D.I16, (System.NullReferenceException: Object reference not set to an instance of an object.)"

 

Other Vision classes, such as PixelValue, work perfectly but PixelValue2D (and 1D) does not.

0 Kudos
Message 1 of 8
(5,453 Views)

Out of curiosity, is there a particular reason that you're trying to call the Vision .NET Assembly in LabVIEW instead of just using the LabVIEW vision functions themselves? The .NET Assembly hasn't been updated in several years whereas the LabVIEW Vision functions are maintained regularly, so the LabVIEW functions are going to be your best and most reliable tools for Vision programming in LabVIEW. If possible, I'd recommend switching from calling the .NET assembly to working with the Vision functions themselves.

 

I was able to see similar behavior on my own machine, so this may just be a bug. Can you provide a little more information about your system? Specifically:
- What version of LabVIEW are you using, and what version of the Vision Development Module and the Vision drivers do you have installed?
- What OS are your running?
- Can you confirm that you're just using a .NET constructor node to call the PixelValue2D class and then wiring the reference out of that constructor directly to the property node? You're not doing anything else in the VI that interacts with the constructor or property nodes?

Regards,

Ryan K.
Product Manager, ATCA and BEEcube
National Instruments
0 Kudos
Message 2 of 8
(5,412 Views)

I'm calling the .NET assembly because I need to use a third party assembly that has parameters of type PixelValue2D. As far as I know there are no LabVIEW functions that will work for this.

 

I'm running 2013 SP1 (32 bit) with the latest version of Vision, on Windows 7. I've isolated the issue to simply a constructor node with reference wired to either a property or invoke node, nothing else.

0 Kudos
Message 3 of 8
(5,399 Views)

Sorry for the delay getting back to you. I've been playing around with the class in a C# application and eveything appears to work fine there, so it seems this issue is limited to the way the constructor is called in LabVIEW. Unfortunately, I'm out of ideas at the moment, but I've passed along this question to some contacts in NI R&D. I'll let you know what information they provide.

Ryan K.
Product Manager, ATCA and BEEcube
National Instruments
0 Kudos
Message 4 of 8
(5,350 Views)

Hello,

 

I take back this old topic to see if you have a solution for it. I am also calling a .NET DLL with the invoke note and property node, and only one construct is not working and I get exactly the same error (1172 - SystemNullReference). I think it is a bug in the DLL function, or maybe the function is wrongly called by LavVIEW.... thanks for the help

0 Kudos
Message 5 of 8
(2,826 Views)

Hi fabbro12,

Could you please indicate which DLL are you calling specifically? It might also help if you could attach a simple VI reproducing the issue.

 

Andres G

AE

NI

0 Kudos
Message 6 of 8
(2,815 Views)

Dear Andres , thanks a lot for your message and your support.

 

I want to control a spectrometer, called Sekonic C7000. The .NET DLL is provided by the vendor , written in visual basic. It is beta version as I am the first one who they sent the DLL to test it.

 

Perhaps the DLL is not working or has some problems?

Attached there is the VI I developed, if you want I can attach the DLL and the documentation I have received.

 

Thanks,

 

Fabrizio

0 Kudos
Message 7 of 8
(2,806 Views)

Hi Fabrizio,

 

Since it's a beta version, it's possible that there is a problem with the DLL. A worthwhile test would be to try calling that constructor from another development environment, like Visual Studio. If you get unexpected behavior there as well then we can confirm that the problem is with the DLL itself.

0 Kudos
Message 8 of 8
(2,798 Views)