System designExplainer

Camera Link serial attribute control: read the ICD or use the API

Your frame grabber API already exposes most Camera Link camera attributes, serial commands included. Where its attribute calls stop, and what to do instead.

LumaSpec Vision10 min read Share on LinkedIn

On this page 10 sections
  1. 01What the camera file declares
  2. 02The grabber API already does this work
  3. 03Where the API route stops
  4. 04Talk to the serial port yourself
  5. 05Worked example: one polarity switch over serial at 9600 baud
  6. 06Choose the route for each attribute
  7. 07Checks before your attribute control ships
  8. 08When the API-first answer is wrong
  9. 09Next step
  10. 10Questions

Your program needs to change camera settings at run time: a longer integration time for a darker part, a different trigger source when the station reconfigures, a test pattern during commissioning. On a Camera Link camera every one of those settings crosses a serial link, and the frame grabber's camera file looks like the only map of what exists and what to send. Before you write a parser for it, take the short answer: the grabber SDK's attribute read and write calls already open that file, format the serial commands and check the responses for you. This guide shows what the camera file contains, which route fits each attribute, and what each route costs in milliseconds.

What the camera file declares

A Camera Link SDK ships a camera definition file for every camera model it supports. On the tooling most of these questions start from, the file carries an .icd extension; other vendors name it differently, so treat camera file as the generic term. One nested block per attribute declares everything a configuration utility needs to draw its panel: the attribute name, whether the value is a list of named options or an integer with a minimum, a maximum and an increment, and the serial command string attached to each value.

A video-polarity attribute reads in outline like this:

  • Attribute: Polarity, a list with two values, White hot and Black hot
  • each value carries a serial action with its command string, POLARITY:WHITEHOT plus a carriage return for one, POLARITY:BLACKHOT plus a carriage return for the other
  • the expected response is often declared empty, because these cameras acknowledge by simply switching

Typical entries cover integration time, trigger mode and source, video polarity, test patterns, analog video windowing (row and column start, zoom) and time stamping. The nesting, with lists inside attributes inside a file and quoted names throughout, is what makes a hand-written parser unattractive. The file is also the configuration utility's own source of truth: whatever route your program takes, the utility's panels are built from these same blocks, which is why your attribute names and the utility's always match.

The grabber API already does this work

Every Camera Link SDK pairs its acquisition functions with attribute functions: enumerate the attributes, read one, write one. Enumeration walks the camera file; the write call formats the serial command, sends it over the link and checks the response; the read call asks the camera for its current value. Your code deals in names and values, and the serial protocol never surfaces.

Three habits make this reliable:

  • enumerate at run time on the exact camera and camera file you ship, instead of hardcoding attribute names;
  • after every write, read the attribute back and compare, because a mismatch means the camera refused the value;
  • treat the serial link as single-owner from day one.

Camera lookup table control is the pattern end to end: Camera lookup table control through frame grabber serial follows one attribute from enumeration to a live write, with the response checked in between.

The grabber is the gateway for all of it. Its driver owns the Camera Link serial port, so any language that can call the SDK can set camera attributes through it.

Frame grabbersHikrobot MV-GC1102IOL Frame GrabberMV-GC1102IOL
Interface
Camera Link
$2,189.00View partBuild a system with it

Where the API route stops

A short list of settings never appears in the camera-attribute enumeration because they configure the frame grabber rather than the camera. Bit depth is the standard example: how the grabber unpacks the camera's taps into pixel data is host-side logic, so the camera never sees it as a serial command.

Two routes exist for these. If the SDK exposes the setting at the acquisition level, set it there and move on. If not, edit the camera file with the vendor's camera-file editor until the setting appears where you need it. The file route earns its keep exactly here, and almost nowhere else.

Compatibility runs in both directions, though: the camera file must match the camera model, and the grabber must support the camera's Camera Link configuration, whether Base, Medium or Full. The Camera Link camera file compatibility fix traces bit-stream errors back to a stale or mismatched file, and the Camera Link camera and frame grabber compatibility checks list what must match before the first frame. The camera finder lists the Camera Link models in the range under its Interface filter, 47 of them, so you can pair both ends from one place.

CamerasArea scan cameras

GigE, USB3, 10GigE and CoaXPress

1,287 models · from $149.00

Talk to the serial port yourself

The Camera Link standard puts a UART on the same cable as the image data and defines a small serial API for it: open, close, read and write operations that a conforming frame grabber implements in its driver. When an attribute is missing from the camera file entirely, or commissioning calls for a command the file never declared, this layer is yours.

What you need before the first write is the camera's serial protocol from its manual, meaning command strings, value units and response format, plus the baud rate both ends agree on. For the setup itself, this Camera Link serial-port configuration walkthrough shows port, baud and protocol settings in one place, and if your test bench lives in a script rather than compiled code, the same calls carry over, as in Camera Link serial commands driven from a scripting environment.

When writes fail for no visible reason, suspect ownership before the camera: find which process holds the grabber first.

Worked example: one polarity switch over serial at 9600 baud

The inputs, and where each comes from:

  • command string POLARITY:WHITEHOT plus a carriage return, 18 bytes, from the camera-file attribute shown above; your camera's exact string comes from its file or manual
  • serial framing of 8 data bits, no parity and one stop bit, 10 bits per byte, standard UART packing
  • baud rate 9600 baud for the slow case, with 115200 baud as the fast comparison; Camera Link serial links are configured across that range and the camera's manual states yours

The rule in words: a UART clocks each byte as 10 bits, so the time for one leg of a transaction is bytes times 10, divided by the baud rate.

bits per leg = bytes × 10 time per leg (s) = bits / baud

Arithmetic, slow case: 18 bytes × 10 = 180 bits, and 180 / 9600 = 0.01875 s, so 18.75 ms to clock the command out. Allow a similar 18-byte response: another 18.75 ms. Round trip 37.5 ms, before the camera's own apply time, which you measure once per camera and never get from the file.

Fast case: 180 / 115200 = 0.0015625 s, or 1.5625 ms per leg, about 3.1 ms round trip.

Decision: attribute writes belong at start-up or recipe change, never inside the trigger loop. At a station rate of 10 frames per second the frame period is 100 ms, so one 37.5 ms slow-rate transaction consumes 37.5% of it and risks lost frames while the camera reconfigures. If you need a different exposure per frame, skip serial entirely: two exposure times on one camera, alternated per trigger shows the route built for exactly that.

Choose the route for each attribute

Case Route What it takes
Attribute appears in the SDK's enumeration Attribute write, then read-back Camera file's name and value range
Grabber-side setting such as bit depth Acquisition setting, else camera-file edit The vendor's camera-file editor
Attribute missing from the camera file Raw serial write Camera manual command set, baud, exclusive port
Different settings per trigger Sequencer or alternate exposure, not serial Per-frame feature support in the camera
Enumeration comes back empty or generic Fix the file-camera pairing first The compatibility checks above

Per case, the recommendation: start-up and recipe changes go through the attribute calls, commissioning experiments use raw serial against the manual's command list, per-frame changes use the camera's sequencer features, and an empty enumeration is a pairing fault, not a reason to write a parser.

Checks before your attribute control ships

  1. Enumerate the attribute list on the exact camera file and camera you ship; names and ranges differ between models and file versions.
  2. Round-trip every write: read the value back, compare, and treat a mismatch as a rejection, not a success.
  3. Prove ownership in both directions: decide who closes the serial session when your program crashes, and what happens when the configuration utility opens mid-run.
  4. Measure one real transaction at production rate and count dropped frames; the 37.5 ms figure above is a plan number, not a measurement of your camera.
  5. Keep the camera manual's command list beside the raw serial path and log everything you send during commissioning, so a regression traces back to one string.

When the API-first answer is wrong

Wrong or missing camera file: the enumeration comes back empty or generic and every write fails. Fix the pairing before writing any code, because that is a configuration fault, not a parsing job; when the grabber itself is not being seen, the Camera Link frame grabber detection and integration guide covers the layer below the file.

Several programs share one camera: the serial port allows a single owner, so funnel all camera changes through one process or service instead of letting each tool open the port.

The camera is not Camera Link at all: GigE and USB3 cameras carry their features as GenICam parameters over the data link, with no camera file and no serial port, so the equivalent job there is runtime camera parameter control. Same goal, different mechanism.

Next step

Start from the attribute functions your SDK already ships and open the camera file only when the enumeration comes back short. If you are choosing the host link for a new build, the frame grabbers category covers Camera Link, CoaXPress, GigE and 10GigE cards.

AccessoriesFrame grabbers

CoaXPress, Camera Link and GigE cards

58 models · from $189.00

The configurator then walks camera, grabber and cabling step by step. And when a Camera Link camera is eventually replaced by a CoaXPress, 10GigE or XoFLink successor, the serial layer disappears with it and the host card changes with it:

Frame grabbersHikrobot MV-GT1102P Dual 10GigE Frame GrabberMV-GT1102P
Interface
10GigE
Ports
2 ports
$2,029.00View part
Frame grabbersHikrobot MV-GX1008 Octo CXP-6 Frame GrabberMV-GX1008
Interface
CoaXPress
$1,949.00View part
Frame grabbersHikrobot MV-GS1104F-DF XoF frame grabber, 4 ports, SFP+ slot, 40G total bandwidth supported, DataForwarding functionMV-GS1104F-DF
Interface
XoFLink
Ports
4 ports
$2,059.00View part

For a camera-grabber pairing the catalog does not settle, contact us with the camera model and the attribute you need to control from your program.

Questions

Can I set a Camera Link camera's exposure time from my own code?

Yes. Call the frame grabber SDK's attribute write with the camera file's name for integration or exposure time and a value in the units that file declares. The SDK performs the serial transaction and the camera applies the new value from the next frame. Read the attribute back with the matching get call to confirm the camera accepted it before your program continues.

What does an .icd camera file contain?

One nested entry per camera attribute: the attribute name, its type as a list of named options or an integer with minimum, maximum and increment, and the serial command string attached to each value. The configuration utility that ships with the frame grabber builds its attribute panels from this same file, so your program and the utility see exactly the same attribute set.

Why is bit depth missing from the grabber's camera attribute calls?

Bit depth describes how the frame grabber unpacks the camera's taps into pixel data, so it is host-side logic rather than a camera setting relayed over the serial link. The camera-attribute enumeration may not list it at all. Set it at the acquisition level if the SDK exposes it there, or adjust the camera file with the vendor's camera-file editor.

How fast is the Camera Link serial link?

It is a UART, so time per leg is bytes multiplied by 10 bits, divided by the baud rate your camera file or camera manual declares. An 18-byte command plus an equal-length response takes about 37.5 ms round trip at 9600 baud and about 3.1 ms at 115200 baud, before the camera's own apply time.

Can two programs open the Camera Link serial port at once?

No. The port has a single owner: while one application holds it, another program's open or write fails with a busy error. Close the session before handing the camera to another process, and if several programs need the same camera, route every attribute change through one service instead of letting each tool open the port.