Thorlabs CMOS camera hardware trigger
Show older comments
Hi everybody
I need to use hardware trigger for a DCC3260 thorlabs camera but commands in camera's .NET library manual do not work in MATLAB.
For exampleI I get this error: "The class uc480.TriggerBurst has no Constant property or Static method named 'Set' " for this command:
uc480.TriggerBurst.Set
But when I type:
methods('uc480.TriggerBurst')
'Set' is listed among this class' methods.
Whould you please guide me how to use such commands?
Thank you
Shabnam
Answers (2)
Birk Andreas
on 7 Jun 2019
0 votes
I have a very similar problem when I try to set the exposure time for a DCC1545M. Have you already found a solution?
Best Regards,
Birk
Cory Cress
on 15 Nov 2021
Edited: Cory Cress
on 15 Nov 2021
Here's an example script from Thorlabs documentation on DCX480 cameras.
It often returns an invalid response and when it does, I find that the ThorCams software also doesn't connect. The only work around for me has been to restart matlab and unplug the camera.
% Add NET assembly
% May need to change specific location of library
NET.addAssembly(['C:\Program Files\Thorlabs\Scientific Imaging\DCx Camera ...' ...
'Support\Develop\DotNet\uc480DotNet.dll']);
% Create camera object handle
cam = uc480.Camera;
% Open the 1st available camera
cam.Init(0);
% Set display mode to bitmap (DiB)
cam.Display.Mode.Set(uc480.Defines.DisplayMode.DiB);
% Set color mode to 8-bit RGB
cam.PixelFormat.Set(uc480.Defines.ColorMode.RGBA8Packed);
% Set trigger mode to software (single image acquisition)
cam.Trigger.Set(uc480.Defines.TriggerMode.Software);
% Allocate image memory
[~, MemId] = cam.Memory.Allocate(true);
% Obtain image information
[~, Width, Height, Bits, ~] = cam.Memory.Inquire(MemId);
% Acquire image
cam.Acquisition.Freeze(uc480.Defines.DeviceParameter.Wait);
% Copy image from memory
[~, tmp] = cam.Memory.CopyToArray(MemId);
% Reshape image
Data = reshape(uint8(tmp), [Bits/8, Width, Height]);
Data = Data(1:3, 1:Width, 1:Height);
Data = permute(Data, [3,2,1]);
% Display Image
himg = imshow(Data);
% Close camera
cam.Exit;
1 Comment
Jonah Padawer-Curry
on 11 May 2023
How would I change the gain and the gamma here?
I've tried "cam.Gain.Hardware.Boost = 1;" and get the error "Error setting property 'Boost' of class 'GainHardware':
Value must be 'uc480.GainBoost'."
Categories
Find more on Device Connection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!