11-18-2017 11:50 AM
I am using a camera via .net. References are closed properly on exit, so the VI may be stopped & started again repeatedly.
However, when there is a 3D Surface Plot in the VI, the camera may not be restarted when the VI is run again. It seems that the 3D plots somehow keeps the camera references from being completely deleted. There is no direct link of the plot or the Helper/Setup VIs with the camera section of the code, it's the bare presence of a 3D plot that keeps the .net camera blocked.
I have to close and reopen the VI to be able to restart the camera.
11-19-2017 12:35 PM
That is really strange. See that function call three inches from the left edge of the Block Diagram, inside the second loop? Could that be the problem? [I'm, of course, guessing where the trouble might be, as my ability to deduce how you coded your VI is not perfect ...].
Bob Schor
11-19-2017 02:54 PM
@Bob_Schor wrote:
That is really strange. See that function call three inches from the left edge of the Block Diagram, inside the second loop? Could that be the problem? [I'm, of course, guessing where the trouble might be, as my ability to deduce how you coded your VI is not perfect ...].
Translation: post your code.
11-20-2017 02:45 AM
Well, I was just reporting it to see if others encountered similar problems with other .net objects in conjunction with the 3D plots. But see the basic extract below: without the 3D plot items, I can restart the VI and my camera opens successfully ("success message" here at the Init output, images captured etc. in the real VI). As soon as there is a 3D plot, the camera will not open ("Can't_Open_Device" here, no images,...). If the 3D plot objects are removed, and the VI started, the camera will open again.
11-20-2017 02:58 AM
Why not post that VI? It will save anybody willing to help you a 10 min. advance. Probably result sin more people willing to try to help.
11-20-2017 06:27 AM
Dear wiebe@CARYA, I did not post the VI because it does neither LOAD nor does it RUN properly if you don't have the appropriate .net assembly. There are specific camera .DLLs and the camera itself required. The screenshot will still be OK to illustrate the problem, which seems to be of a more general nature, I guess. Others may have noticed similar behavior in their specific contexts. Can we agree on that ?
11-20-2017 06:50 AM
> The screenshot will still be OK to illustrate the problem, which seems to be of a more general nature, I guess.
Only if you assume it's a general problem. It's possible...
> Others may have noticed similar behavior in their specific contexts. Can we agree on that ?
Sure, it's possible.
My guess would be it's a very specific problem. And without knowing the specifics, it will be hard to help.
AFAIK, the 3D graphs don't use .net at all. So to me they seem to be completely unrelated. However, the camera might use OpenGL or use the video card in some other way. So that might interfere somehow.
Could you make sure it's not a timing issue? You seem to think it's the presence of the code on your diagram, but when you put it on your diagram like you did, both will execute when the VI runs. The graph might consume CPU time, effecting the .net code. Maybe you can use a temporary sequence structure to force execution (all combinations).
11-20-2017 08:02 AM - edited 11-20-2017 08:04 AM
The 3D graphs do however use OpenGL heavily. So I would guess the camera .Net driver somehow hooks into OpenGL too, for whatever reasons and that makes it not work properly. Maybe a resource reference count issue that prevents the.Net camera object that the driver creates to unload when you close it in the application.
Have you checked if your .Net objects implement a specific Dispose() method that may need to be called before closing the .Net reference with the LabVIEW refnum close? And you do close of any and every .Net refnum properly after use, don't you?
It might be a problem with the way LabVIEW loads OpenGL and keeps it in memory once a 3D graph is present, but most likely the issue is in the camera driver itself which assumes a few things:
- That it is the only OpenGL consumer
- That an application doesn't usually unload an object hierarchy dynamically without closing/shutting down completely, where Windows resource management automatically makes sure that everything is closed down forcefully and all allocated handles are released.
01-21-2019 11:08 PM
Good night, I could say how to use my camera Thorlabs 1548 in LabView with .NET as I can not capture an image for processing in a script Matlab.
Thank you for your help.
01-22-2019 03:27 AM
@JesusJesus wrote:
Good night, I could say how to use my camera Thorlabs 1548 in LabView with .NET as I can not capture an image for processing in a script Matlab.
Post new questions in new threads.