From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using thorlabs CS165CU camera to continuously take pictures in labview

Solved!
Go to solution

Hi,

I want to add an image part to my spectra gaining VI. I can control the camera and take pictures using Thorcam. I downloaded the VIs provided by thorlabs and tried some demos. They all showed error 3 below:

Error 1386 occurred at Invoke Node in Open TLCameraSDK.vi->Software triggered acquisition - polling.vi

Possible reason(s): LabVIEW: (Hex 0x56A) The specified .NET class is not available in LabVIEW.

Error 1172 occurred at Invoke Node Error calling method Thorlabs.TSI.TLCameraInterfaces.ITLCameraSDK.Dispose, (System.ArgumentNullException: Key cannot be null.
Parameter name: key)

Possible reason(s):

LabVIEW: (Hex 0x494) A .NET exception occurred in an external assembly. For information about correcting this error, copy the following exception (in bold), and search the Microsoft Developer Network (MSDN) Web site or the Web for a possible explanation.
System.ArgumentNullException in Close TLCameraSDK.vi->Software triggered acquisition - polling.vi

 

I have added the LabVIEW.exe.config file as here said, but it didn't work.

 

0 Kudos
Message 1 of 6
(2,059 Views)
Solution
Accepted by topic author Peiyi1919

Did you read all the instructions for the Thorslabs VIs?

 

Specifically from the Readme File

 

LabVIEW README

For LabVIEW support for Thorlabs camera series DCC and DCU, please see the DCx Camera Support folder typically installed at C:\Program Files\Thorlabs\Scientific Imaging\DCx Camera Support.

For LabVIEW support for Thorlabs camera series 340, 1500, 1501, 4070, 8050, 8051, CC215, CS126, CS135, CS165, CS2100, CS235, CS505, and CS895, please use the .NET camera interface by following these directions:

1. Install ThorCam and the appropriate drivers. The installer can be found at Thorlabs.com on any of the camera pages. Click on the Software tab, then on the Software button.

2. Copy the managed DLLs from

Scientific Camera Interfaces\SDK\DotNet Toolkit\dlls\Managed_32_lib\*.dll (for 32-bit LabVIEW)
or
Scientific Camera Interfaces\SDK\DotNet Toolkit\dlls\Managed_64_lib\*.dll (for 64-bit LabVIEW)

to the a folder with your VIs in a subfolder called Library_X86 (for 32-bit LabVIEW) or Library_X64 (for 64-bit LabVIEW).

3. See the following guides found in the Documentation folder (usually C:\Program Files\Thorlabs\Scientific Imaging\Documentation\Scientific Camera Documents):

TSI_Camera_LabVIEW_Interface_Guide.pdf
TSI_Camera_DotNET-LabVIEW-MATLAB_Programming_Guide.chm

 

You also need to specify the directory of these dlls, before calling them, ie

 

mcduff_0-1658883708300.png

 

Otherwise, things won't work.

 

If you make an exe, there are some other dlls that need to be added. They can be found in the Thorlabs program. Not sure why Thorslabs doesn't include them also.

 

Message 2 of 6
(2,039 Views)

I think I exactly followed the instructions in step 1 and 2. The provided VIs also have specified the directory of these dlls. However, they didn't work.

 

I am now looking through the TSI_Camera_LabVIEW_Interface_Guide, but I don't expect any solution there because the examples are in accord with the guide.

 

I also tested the VIs on two different computers. They both didn't work. Do you have any suggestion then? Thank you so much.

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

Your errors indicate it’s not finding the DLLs. You need to post something for help.

0 Kudos
Message 4 of 6
(1,981 Views)

Thank you so much. I think I find the problem. I have to change the file path in Set Current Directory To Library Folder.vi. The default one is wrong. Everything works well now.

0 Kudos
Message 5 of 6
(1,954 Views)

Hi! I'm having the same exact problem. Can you elaborate on how you solved it? It is driving me crazy.

0 Kudos
Message 6 of 6
(1,193 Views)