Cameras & sensorsTroubleshooting

Manual exposure value out of bounds: check the exposure unit first

Why a camera exposure value fails with an out of bounds error, how to read each stream's unit and range, and the query-before-set order that fixes it.

LumaSpec Vision9 min read Share on LinkedIn

On this page 7 sections
  1. 01The symptom: a refused write, not a bad number
  2. 02The three exposure units you will meet
  3. 03One camera, two scales: depth versus color
  4. 04Worked example: writing the target the right way and the wrong way
  5. 05The fix: query, convert, set, read back
  6. 06When the value really is out of range
  7. 07Questions

You type 33000 for the 33 ms exposure your dim scene needs, and the driver refuses with an out-of-bounds error. The number itself is almost never the problem — the unit is. The same 33 milliseconds is 33000 to a control that counts microseconds, 330 to one that counts tenth-millisecond steps, and 33 to a viewer that displays milliseconds. This guide gives you the unit-and-range check that ends the guessing: where each unit appears, how to convert once, how to query the range before you write, and how to prove the set took. It applies to GenICam area scan cameras and to the depth and color streams of stereo depth cameras.

The symptom: a refused write, not a bad number

The failure usually reads 33000 is out of bounds [1,10000]. Take the two halves separately. Your 33000 is a legal 33-millisecond exposure expressed in microseconds. The bracket is the control's permitted range, 1 to 10000, counted in whatever unit that control uses. Both halves are true at once, which is why the error feels absurd.

The round upper bound is the tell. A sensor's genuine maximum exposure follows its readout timing and lands on awkward values that shift with the frame rate. A cap of exactly 10000 is the signature of a scaled control with a tidy decimal range. Treat an out-of-bounds error on an exposure write as a unit mismatch until you have read that control's range and unit.

Ranked by how often each turns out to be the cause:

  1. The value is in the wrong unit for the control: microseconds into a tenth-millisecond control, or the reverse.
  2. The write went to the other stream's control — color instead of depth, or the other way round.
  3. Auto exposure is still engaged, and the manual value is overwritten or ignored.
  4. The value is genuinely beyond the control's maximum.

The three exposure units you will meet

Three scales cover nearly every case in the shop.

Unit Where it appears 33 milliseconds written in it
Microseconds (µs) GenICam ExposureTime on industrial cameras; depth-imager tuning guides 33000
0.1 ms steps The USB Video Class (UVC) exposure time control that host viewers write 330
Milliseconds (ms) Viewer read-outs and some GUI input fields 33

The GenICam standard defines ExposureTime in microseconds, so a GigE or USB3 area scan camera carries its unit in the node itself. Some older devices expose only a raw exposure node; its unit is whatever that device's documentation states, and the routine below handles it identically.

Host viewers on Windows reach many depth and color cameras through the USB Video Class, whose exposure time control counts in 0.1 ms steps: a value of 1 is 0.0001 s. Exposure there is a global control the host applies to the device rather than a per-stream vendor node. A bracketed limit of [1,10000] on that control therefore means 0.1 ms to 1000 ms — not 1 to 10000 µs.

One camera, two scales: depth versus color

A stereo depth camera exposes its depth and infrared imagers directly through the vendor SDK, and those controls take microseconds: a tuning-guide value of 33000 is the 33-millisecond target. The color imager is separate silicon, and host software frequently reaches it over the UVC path instead. The color stream then counts tenth-millisecond steps, which is why the same camera that accepts 33000 on depth shows small color values like 156.

The exception to expect: depth models with no separate color sensor produce their color image from the depth imager itself, and the color exposure then follows the depth scale. The rule that survives every case is that the unit belongs to the control and stream you are writing, never to the camera as a whole. Query each stream's range from the API before writing — querying a 3D camera's exposure range shows the calls — and when a color write fails with a control error on Windows, the UVC control that reports SET_CUR failures is the same trap one layer down. The 3D sensors range spans the depth cameras this applies to.

Worked example: writing the target the right way and the wrong way

Set-up: a dim conveyor scene, a 33-millisecond target exposure, camera running at 30 fps.

exposure [µs] = target [ms] × 1000 exposure [0.1 ms steps] = target [ms] × 10

Microsecond path: 33 × 1000 = 33000 µs. Frame check: one frame at 30 fps lasts 1 s ÷ 30 = 33.3 ms, so this exposure consumes 33 ÷ 33.3 ≈ 99% of the frame period. The value is legal, but it leaves no headroom — the camera holds 30 fps only while nothing else slips.

UVC path: 33 × 10 = 330 steps. Write 33000 into that control and it reads the request as 33000 × 0.1 ms = 3300 ms, which is 3.3 times its 1000 ms maximum, so it refuses. The tempting overcorrection is worse: write 33 believing the field shows milliseconds, and the control applies 33 × 0.1 ms = 3.3 ms — ten times too short. The write succeeds, the image comes back dark, and the gain you add next treats a symptom of a unit error.

One habit covers both paths: divide the target by the frame period before writing. If the quotient passes 1, no unit conversion will save the value — the exposure is longer than the frame, and the frame rate must drop (how exposure settings cap the frame rate).

The fix: query, convert, set, read back

  1. Name the control. Depth imager, color imager, or the host's UVC exposure control — the unit belongs to this exact control, not to the camera.
  2. Read the range before writing. On GenICam cameras the ExposureTime node carries minimum, maximum and unit in one read (query the option range before you set). The range's shape also identifies the unit: a maximum of 10000 means 0.1 ms steps; a maximum of tens of thousands at 30 fps means microseconds.
  3. Convert once, on paper. 33 ms becomes 33000 µs or 330 UVC steps. Do the conversion once and write it down; converting twice from memory is where the second error enters.
  4. Free the value from auto. Disable the auto-exposure mode first and apply settings in the order the driver expects — many drivers only accept exposure changes before streaming starts (set manual exposure before streaming).
  5. Write, then read back. Read the node after the write and compare it with the exposure reported in the frame metadata (read exposure time from frame metadata). A small constant offset points at granularity or firmware rounding, not at units (why reported exposure differs from the set value).
  6. Time ten frames. If the frame rate fell below target, the exposure is eating the frame period; shorten it or lower the frame-rate target deliberately.

On a GenICam camera the whole routine is a handful of API calls — setting exposure time through a GenICam API shows the sequence. The cameras below cover the common set-ups:

Area scan camerasHikrobot MV-CS200-10UM 20 MP Area Scan Camera, USB3.0, IMX183, 2nd Gen., MonoMV-CS200-10UM
Sensor format
1"
Lens mount
C-mount
$759.00View part
Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
$309.00View part
Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
$560.00View part

The MV-CS200-10UM is a 20 MP USB3 mono camera with a rolling shutter and a 1" sensor. The MV-CU020-90GC pairs a 2.5 MP color sensor with a global shutter, a 1/1.7" format and GigE. The LS-CMR-0166 delivers 4000 × 3000 at 30 fps over USB3.

Shutter type matters once integration grows past a few milliseconds: on a rolling-shutter sensor a 33-millisecond exposure also shears fast-moving parts band by band, while a global shutter blurs the frame evenly.

When the value really is out of range

Convert correctly, read the range, and a refused value can still be genuine: the maximum is simply lower than your target. That happens when the driver clamps integration to hold the frame rate. The way out is optical, not numerical — more light, a faster lens, then more gain, in that order, because gain amplifies noise while light adds signal.

Two neighbouring traps: if you leave auto exposure on and cap its limit instead, the limit value carries the same microsecond unit (auto-exposure limits are in microseconds too), and an uncapped auto exposure will happily blur moving parts (capping auto exposure to stop motion blur).

The habit to keep is four words: query, convert, set, read back. When you are choosing the camera as well, the camera finder filters by interface and shutter, the cameras topic hub gathers the exposure and streaming guides around this one, and the configurator's camera step below walks the choice in order.

Build the whole station

The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.

Start with the camera

If a write still refuses after the unit check, send us the exact error text, the interface and the value you tried.

Questions

Why does the depth stream accept 33000 while the color stream only takes small values like 156?

The two streams expose different controls. The depth imager's exposure is written in microseconds through the vendor SDK, so 33000 means 33 milliseconds. The color imager is separate silicon, usually reached through the USB Video Class control that counts tenth-millisecond steps, so 156 steps is 15.6 ms. Depth models with no separate color sensor read color off the depth imager and keep the depth scale for color.

What unit does the USB Video Class exposure time control use?

0.1 ms per step, which is 100 µs: a value of 1 means 0.0001 s, and the upper bound of 10000 means 1000 ms. That bracket is exactly what an out-of-bounds error is quoting. Write the 33-millisecond target as 330 steps, never 33000. The scale is fixed by the control, so it applies to viewer writes, vendor wrappers and your own code alike.

How do I find the exposure unit when no documentation states it?

Read the control's minimum and maximum, write the maximum once, and read the exposure back from the frame metadata or status. If the maximum is 10000 and the camera reports 1.0 s, the step is 0.1 ms; if it reports 10000 µs, the unit is microseconds. One maximum-value test pins the scale without guessing.

Does exposure time limit the frame rate?

Yes. Exposure plus readout must fit inside the frame period. At 30 fps the period is 33.3 ms, so a 33-millisecond exposure fills 99% of the budget and leaves no headroom; anything longer forces a lower frame rate. If frames slow after an exposure change, halve the exposure or accept the lower rate deliberately.

Why is my manual exposure ignored or overwritten?

Auto exposure is usually still engaged. Turn the auto mode off, write the manual value in the control's own unit, and apply settings in the order the driver expects — many drivers only honour exposure changes made before streaming starts. If the value still drifts, read the exposure from frame metadata to see what the camera actually applied.