Skip to content

Connecting to Thorlabs-DCU224C by Thorlabs in Python

Instrument Card

DCU224C - CCD Camera, 1280 x 1024 Resolution, Color, USB 2.0

Thorlabs-DCU224C

Device Specification: here

Manufacturer card: THORLABS

THORLABS

Thorlabs, Inc. is an American privately held optical equipment company headquartered in Newton, New Jersey. The company was founded in 1989 by Alex Cable, who serves as its current president and CEO. As of 2018, Thorlabs has annual sales of approximately $500 million.

  • Headquarters: USA
  • Yearly Revenue (millions, USD): 550
  • Vendor Website: here

Connect to the Thorlabs-DCU224C in Python

PROTOCOLS > SCPI

To connect to a Thorlabs-DCU224C camera using Instrumental, you can use the following Python script:

from instrumental import instrument, list_instruments
# List all available instruments
print(list_instruments())
# Connect to the Thorlabs-DCU224C camera
cam = instrument('Thorlabs-DCU224C')
# Set camera parameters
cam.exposure = 10 # Set exposure time to 10 ms
cam.gain = 1.5 # Set gain to 1.5
# Capture an image
image = cam.grab_image()
# Display the image
import matplotlib.pyplot as plt
plt.imshow(image)
plt.show()
# Disconnect from the camera
cam.close()

This script first lists all available instruments using the list_instruments() function. Then, it connects to the Thorlabs-DCU224C camera using the instrument() function. It captures an image using the grab_image() method and displays it using matplotlib. Finally, it closes the connection to the camera using the close() method.