11-27-2016 11:48 PM
Hello! I am working with a Camera SDK (Point Grey FlyCapture2), and would like to interface it with LabVIEW. I am currently using the C# (.NET) version of the SDK, and have written the following code.
public void ConnectCamera(uint cameraId) { if (cameraMap.ContainsKey(cameraId)) { string errorMessage = "The camera at index " + cameraId + " is already connected."; throw new ApplicationException(errorMessage); } ManagedBusManager busManager = new ManagedBusManager(); ManagedCamera camera = new ManagedCamera(); uint numCameras = busManager.GetNumOfCameras(); if (cameraId < numCameras) { ManagedPGRGuid cameraGuid = busManager.GetCameraFromIndex(cameraId); camera.Connect(cameraGuid); //cameraMap.Add(cameraId, camera); } else { string errorMessage = "No camera was found for index " + cameraId + "."; throw new ApplicationException(errorMessage); } }
When I run this function using a console function, it works perfectly fine. However, when I create a VI wrapper around this function (see below), I get a Run-Time Check Error.
Specifically, I am getting the following message each time I open or run my VI.
I have debugged this a bit, and have narrowed it down to when to I call the function below. In other words, if I comment this line out, along with any other line after it, the VI runs fine. However, if I attempt to execute camera.Connect(), it gives me this error.
camera.Connect(cameraGuid);
Is there any way to fix this issue from LabVIEW's perspective? I don't have the ability to modify FlyCapture2d_v140.dll as that is closed-source.
11-28-2016 12:06 AM
Nevermind, apparently switching from the debug version of the library to the release version of the library fixed it. This StackOverflow question was helpful.
http://stackoverflow.com/questions/9308858/dll-error-flycapture
I'm still curious to why that might have happened. Thanks!