Communicating with the Serial Port on a Camera Link Camera

Updated Jul 27, 2023

Reported In

Hardware

  • Frame Grabber Device

Driver

  • NI-IMAQ
  • Vision Acquisition Software

Issue Details

  • What methods can I use to send serial commands to my Camera Link camera?
  • I have a Camera Link camera connected to an NI Frame Grabber. I need to be able to configure my camera using the serial port built-in to the Camera Link connection, but I do not see the serial port enumerated as a COM port. How can I send commands to my camera over serial?
  • Other frame grabber vendors allow you to link the serial port to a COM port. Is this "Pass through visibility" possible to do outside of NI Software?

Solution

NI Camera Link Frame Grabbers give you access to the serial port on a connected Camera Link camera, but this port does not enumerate as a standard COM port. To send a serial command to your camera, you can use one of the following methods:
  • Use the IMAQ Serial VIs in LabVIEW
The NI-IMAQ  driver includes VIs for communicating with your camera over serial. Use IMAQ Serial Write.vi to write commands to the camera and IMAQ Serial Read.vi to read the camera's response. The following example shows how to do this:
  • Use the NI Camera File Generator
The NI Camera File Generator is used to create or edit camera files, which define the interaction between NI software, the frame grabber, and your camera. This tool also allows you to send and receive serial data from your camera. For more information, refer to the the following KnowledgeBase article:

Send Serial Commands via the Camera File Generator to My Camera Link Camera
  • Use the NI-IMAQ Driver's C Library or .NET Library in the Third-Party Software
These text-based language examples are added during the driver's installation . NI provides the source (.c) and header (.h) files in the fore-mentioned libraries.
To access these serial functions in the NI-IMAQ Function Reference Help, navigate to the following location: NI-IMAQ Functions » Low-level Functions » Serial Communication Functions
 
  • Use the Third-Party Configuration Tool from Your Camera's Manufacturer
Many camera manufacturers have a configuration tool (such as Basler Pylon) that can be used to configure the settings for your camera, even if it is being used with an NI frame grabber.