Configuring the Camera
4-12 BASLER L304kc
Draft
4.2.2 Feature Control and Status Registers
4.2.2.1 Definition of a Feature Control and Status Register
The feature control and status registers (CSRs) let you set the parameters for camera features
such as exposure mode, gain, offset and the AOI. These registers also let you check the current
parameter settings and the status for each feature.
Each feature has one or more CSRs associated with it. The fields within a feature’s CSR(s) are
used to control how the feature operates. By using binary write commands to write to fields within
a feature’s CSR(s), you can change the parameter settings for the feature. By using binary read
commands, you can determine the current setting for the parameters and get information about
the feature’s status.
The address for any field within a register is equal to the register base address plus the offset for
the field. Look at the Video Data Output Mode CSR on page 4-14 as an example. The Mode field
of this register has an address of 0x1701 (the base address of 0x1700 plus the offset of 0x0001).
By writing a value to this address, you can set the video data output mode. By reading the value
at this address, you can determine the current output mode setting.
The Video Data Output Mode CSR is a simple CSR with only two fields. Most of the other feature
CSRs have several read/write fields that let you set the parameters associated with a feature.
They may also have read only fields that contain information about the minimum and maximum
allowed settings for each parameter. Section 4.2.2.3 lists the feature CSRs in L304
kc cameras and
shows detailed information about the use of each field within the registers.
4.2.2.2 “Raw” Value Fields vs. “Absolute” Value Fields
As you look through the descriptions of the feature CSRs, you will notice that some CSRs have a
parameter that can be set by writing a value to a “raw” field or by writing a value to an “absolute”
field. You will find this to be true for the Exposure Time, Line Period, Red Gain, Green Gain, Blue
Gain, Red Offset, Green Offset, Blue Offset, Red Color Shift Correction, Green Color Shift
Correction and Blue Color Shift Correction parameters. The common characteristic among these
parameters is that they are expressed as rational numbers. These numbers are on a continuous
scale rather than a scale of discrete integers. Any one of the parameters expressed as rational
numbers can be set on a “raw” scale or on an “absolute” scale. A raw scale is simply a range of
integer values that has no defined units. An absolute scale is a range of floating point values that
has defined units.
Lets look at the Red Gain parameter as an example:
Setting the Raw Red Gain
If you set the red gain by writing a value to the Raw Red Gain field of the Red Gain CSR, you can
write any integer value from 181 to 2560 (decimal). Writing an integer value to the raw register
sets the red gain, but it doesn’t directly tell you how many dB of red gain you will be getting from
the camera at that setting. To determine the dB of red gain you are getting at a particular raw red
gain setting, you must use the formula:
dB = 20 x log ( raw setting / 256 ). For example, if the raw red
gain field is set to 1200 (decimal):
dB = 20 x log ( raw setting / 256 )
dB = 20 x log ( 1200 / 256 )
dB = 13.42
So with the raw red gain field set to 1200, the camera would be set for 13.42 dB of red gain.