Skip to content

Configuring a CXP-12 Interface Card#

This topic tells you how to configure a Basler CXP-12 Interface Card using the pylon API, the pylon Viewer, or the gpioTool.

Info

This topic covers basic use cases. For in-depth information about the software features of the interface card, see the acquisition applets PDF documentation.

Configuring the interface card is especially useful in the following situations:

Limitation

In all applets, buffers larger than 4 GB can't be allocated. Even if the applet allows a larger buffer size, you can't allocate buffers larger than 4 GB due to limitations in the driver and firmware.

You can calculate the buffer size as follows:

Buffer size = image height * image width * (pixel width / 8).

For RGB images: buffer size = (image height * image width * (pixel width / 8)) * 3 .

Available Area Scan Applets and Default Applets#

Depending on the interface card model, the following applets are available and set as default:

Applet Name Available For Interface Card Default Applet On Interface Card
Acq_SingleCXP12Area 1C, 2C, 4C 1C
Acq_DualCXP12Area 2C, 4C 2C
Acq_TripleCXP12Area 4C -
Acq_QuadCXP12Area 4C 4C

Available Line Scan Applets#

Depending on the interface card model, the following applets are available. Note that the default applet (i.e., the applet that is loaded by default) is always an area scan applet. Thus, if you want to use a line scan applet, you must load it first as described in Changing the Applet.

Applet Name Available For Interface Card
Acq_SingleCXP12Line 1C, 2C, 4C
Acq_DualCXP12Line 2C, 4C
Acq_TripleCXP12Line 4C
Acq_QuadCXP12Line 4C

Documentation#

The following sections provide links to the acquisition applets documentation:

CXP-12 Interface Card 1C#

GenTL Fglib
Acq_SingleCXP12x1Area PDF Acq_SingleCXP12x1Area PDF
Acq_SingleCXP12Line PDF Acq_SingleCXP12Line PDF
Frame Grabber Test Applet PDF Frame Grabber Test Applet PDF

CXP-12 Interface Card 2C#

GenTL Fglib
Acq_SingleCXP12Area PDF Acq_SingleCXP12Area PDF
Acq_DualCXP12Area PDF Acq_DualCXP12Area PDF
Acq_SingleCXP12Line PDF Acq_SingleCXP12Line PDF
Acq_DualCXP12Line PDF Acq_DualCXP12Line PDF
Frame Grabber Test Applet PDF Frame Grabber Test Applet PDF

CXP-12 Interface Card 4C#

GenTL Fglib
Acq_SingleCXP12Area PDF Acq_SingleCXP12Area PDF
Acq_DualCXP12Area PDF Acq_DualCXP12Area PDF
Acq_TripleCXP12Area PDF Acq_TripleCXP12Area PDF
Acq_QuadCXP12Area PDF Acq_QuadCXP12Area PDF
Acq_SingleCXP12Line PDF Acq_SingleCXP12Line PDF
Acq_DualCXP12Line PDF Acq_DualCXP12Line PDF
Acq_TripleCXP12Line PDF Acq_TripleCXP12Line PDF
Acq_QuadCXP12line PDF Acq_QuadCXP12line PDF
FrameGrabberTest Frame Grabber Test Applet PDF

Choosing the Right Applet#

If you are using single-channel (1-CXP) cameras only, the default applet will always work for you and you don't have to change it.

However, if you are using multi-channel (e.g., 2-CXP or 4-CXP) cameras, you must choose the right applet for your camera setup. Otherwise, the camera may not work or camera performance may be significantly reduced.

Which applet is the right one depends on the amount of cameras, the amount of channels per camera, and the desired ROI step size.

The ROI step size depends on the parallelism of the image preprocessing and therefore varies by camera and frame grabber.

CXP-12 Interface Card 1C#

Area Scan Applets for the CXP-12 Interface Card 1C#

Amount of 1-Channel Cameras Amount of 2-Channel Cameras Amount of 4-Channel Cameras Applet ROI Step Size [px] Topology
1 Acq_SingleCXP12x1Area x: 4
y: 1
One Camera, One Channel

Line Scan Applets for the CXP-12 Interface Card 1C#

Amount of 1-Channel Cameras Amount of 2-Channel Cameras Amount of 4-Channel Cameras Applet ROI Step Size [px] Topology
1 Acq_SingleCXP12Line x: 4
y: 1
One Camera, One Channel

CXP-12 Interface Card 2C#

Area Scan Applets for the CXP-12 Interface Card 2C#

Amount of 1-Channel Cameras Amount of 2-Channel Cameras Amount of 4-Channel Cameras Applet ROI Step Size [px] Topology
1 Acq_DualCXP12Area x: 8
y: 1
One Camera, One Channel
2 Acq_DualCXP12Area x: 8
y: 1
Two Cameras, One Channel Each
1 Acq_SingleCXP12Area x: 16
y: 1
One Camera, Two Channels

Line Scan Applets for the CXP-12 Interface Card 2C#

Amount of 1-Channel Cameras Amount of 2-Channel Cameras Amount of 4-Channel Cameras Applet ROI Step Size [px] Topology
1 Acq_DualCXP12Line x: 8
y: 1
One Camera, One Channel
2 Acq_DualCXP12Line x: 8
y: 1
Two Cameras, One Channel Each
1 Acq_SingleCXP12Line x: 16
y: 1
One Camera, Two Channels

CXP-12 Interface Card 4C#

Area Scan Applets for the CXP-12 Interface Card 4C#

Amount of 1-Channel Cameras Amount of 2-Channel Cameras Amount of 4-Channel Cameras Applet ROI Step Size [px] Topology
1 Acq_QuadCXP12Area x: 8
y: 1
One Camera, One Channel
2 Acq_QuadCXP12Area x: 8
y: 1
Two Cameras One Channel Each
3 Acq_QuadCXP12Area x: 8
y: 1
Three Cameras One Channel Each
4 Acq_QuadCXP12Area x: 8
y: 1
Four Cameras One Channel Each
1 Acq_DualCXP12Area x: 16
y: 1
One Camera Two Channels
2 Acq_DualCXP12Area x: 16
y: 1
Two Cameras Two Channels Each
1 Acq_SingleCXP12Area x: 32
y: 1
One Camera Four Channels
1 1 Acq_TripleCXP12Area x: 8
y: 1
One Camera With One Channel And One Camera With Two Channels
2 1 Acq_TripleCXP12Area x: 8
y: 1
Two Cameras With one Channel And One Camera With Two Channels

Line Scan Applets for the CXP-12 Interface Card 4C#

Amount of 1-Channel Cameras Amount of 2-Channel Cameras Amount of 4-Channel Cameras Applet ROI Step Size [px] Topology
1 Acq_QuadCXP12Line x: 8
y: 1
One Camera, One Channel
2 Acq_QuadCXP12Line x: 8
y: 1
Two Cameras One Channel Each
3 Acq_QuadCXP12Line x: 8
y: 1
Three Cameras One Channel Each
4 Acq_QuadCXP12Line x: 8
y: 1
Four Cameras One Channel Each
1 Acq_DualCXP12Line x: 16
y: 1
One Camera Two Channels
2 Acq_DualCXP12Line x: 16
y: 1
Two Cameras Two Channels Each
1 Acq_SingleCXP12Line x: 32
y: 1
One Camera Four Channels
1 1 Acq_TripleCXP12Line x: 8
y: 1
One Camera With One Channel And One Camera With Two Channels
2 1 Acq_TripleCXP12Line x: 8
y: 1
Two Cameras With one Channel And One Camera With Two Channels

Changing the Applet#

The applet running on the interface card defines its functionality. For certain camera setups, you may have to change the default applet.

To change the applet used by the interface card, set the InterfaceApplet parameter to the name of the applet to be loaded, e.g., Acq_DualCXP12Area.

Using the Interface Card to Trigger a Basler boost CXP-12 Camera#

Info

This section is only relevant if you specifically want to trigger the camera via the interface card. Usually, the camera is triggered via the camera's I/O connector. For more information, see Triggered Image Acquisition.

Hardware Triggering (External)#

With external triggering enabled, you can send trigger input signals to the interface card, and the interface card forwards these signals to the Basler boost camera.

To configure the interface card for external hardware triggering:

  1. Set the AreaTriggerMode parameter to External.
  2. Set the TriggerInSource parameter to the desired "Front GPI" input line.
    For example, if you want to use GPI0 (pin 11 and 12 on the interface card) for external triggering, set the parameter to FrontGpiTriggerSource0.
  3. Set the TriggerCameraOutSelect parameter to the corresponding "Bypass" option.
    For example, if you selected FrontGpiTriggerSource0, set the TriggerCameraOutSelect parameter to BypassFrontGpi0.
  4. Set the TriggerState parameter to Active.
  5. If necessary, configure the trigger signals as described below.

All trigger signals will be forwarded to the camera's source signals CxpTrigger0 and CxpTrigger1. The signals can be used for various purposes. The most common use case is image acquisition. See the example below.

Hardware Triggering (Internal)#

With internal triggering enabled, the interface card generates trigger signals internally at a specified frequency. All external trigger signals will be ignored.

To configure the interface card for internal hardware triggering:

  1. Set the AreaTriggerMode parameter to Generator.
  2. Set the TriggerOutputFrequency parameter to the desired trigger output frequency. For example, if you set the parameter to 8, the interface card will generate 8 trigger signals per second.
  3. Set the TriggerCameraOutSelect parameter to the desired output line, e.g., PulseGenerator0.
  4. Set the TriggerState parameter to Active.

Now, whenever you start image acquisition, the interface card will generate trigger signals at the specified frequency.

All trigger signals will be forwarded to the camera's source signals CxpTrigger0 and CxpTrigger1. The signals can be used for various purposes. The most common use case is image acquisition. See the example below.

Example: Using the Trigger Signals for Image Acquisition#

To use the external or internal trigger signals generated by the interface card to acquire images:

  1. On the camera, set the TriggerSelector parameter to FrameStart.
  2. Set the TriggerMode parameter to On.
  3. Set the ExposureMode parameter to Timed.
  4. Set the TriggerSource parameter to CxpTrigger0 or CxpTrigger1.

Now, the camera will acquire an image each time the interface card receives or generates a trigger signal.

Info

You can use the trigger signals as the source for any Basler boost camera feature that can be controlled by a signal source. For example, setting the CounterTriggerSource parameter to CxpTrigger0 allows you to control the Counter feature using the interface card.

Performing Debayering on the Interface Card#

With the CXP-12 Interface Card 1C, you can perform debayering on the interface card. This reduces computing load on the camera and the host computer.

To do so:

  1. Start the pylon Viewer and open a connection to the interface card and the camera.
  2. Use the feature tree to make the following settings:
    • On the camera, set the Pixel Format option to a Bayer pixel format, e.g., Bayer RG 12.
    • Navigate to Device Transport Layer and disable the Automatic Format Control option.
      This allows you to set the output format independently of the pixel format used by the camera.
    • On the interface card, set the OutputFormat option to the corresponding RGB pixel format.
      The bit depth must be three times the bit depth of the Bayer pixel format. For example, Bayer RG 12 (camera) = Color 36 bit (interface card).

Now, the interface card will perform debayering on the camera's raw image data and output RGB image data.

Info

Make sure that you set the correct RGB pixel format in step 3 above. Otherwise, images will not be acquired properly.

Using Output Formats not Available on the Camera#

The Basler boost camera can output image data in a number of pixel formats, e.g., Bayer RG 8 or RBG 8. For more information, see the pixel format topic.

If your required pixel format is not available on the camera and you also want to avoid image conversion on the host computer, you may be able to use one of the pixel formats provided by the interface card.

The interface card provides the following formats:

Gray8bit Gray10bit Gray12bit Gray16bit
Color24bit Color30bit Color36bit Color48bit
Bayergr8 Bayergr10 Bayergr12 Bayergr16
Bayerrg8 Bayerrg10 Bayerrg12 Bayerrg16
Bayergb8 Bayergb10 Bayergb12 Bayergb16
Bayerbg8 Bayerbg10 Bayerbg12 Bayerbg16

To use an output format not available on the camera:

  1. On the camera, set the PixelFormat parameter to the desired camera pixel format, e.g., Mono12.
  2. On the interface card, set the AutomaticFormatControl parameter to false.
    This allows you to set the output format independently of the pixel format used by the camera.
  3. On the interface card, set the Format parameter to the desired output format, e.g., Gray16bit.

With the example values above, the interface card will output 16-bit image data based on 12-bit camera image data. Padding bits (zeros) will be inserted as illustrated below.

16-Bit Image Data Based on 12-Bit Camera Image Data

Configuring the Trigger Signals Using the gpioTool#

With the gpioTool command line tool, you can configure the physical properties of the trigger signals received or sent by the interface card:

  • You can configure the input lines to receive single-ended or differential signals.
  • You can configure the input lines to operate in pull-up or pull-down mode.
  • You can specify whether output signals should be inverted.

The gpioTool is included in the pylon Software Suite.

To start the tool:

  1. Open a Command Prompt window (Windows) or Terminal window (Linux).
  2. Change to the bin directory of your pylon installation:

    • Windows (64 bit): %programfiles%\Basler\pylon x\Runtime\x64\pylonCXP\bin
    • Windows (32 bit): %programfiles%\Basler\pylon x\Runtime\Win32\pylonCXP\bin
    • Linux: /opt/pylon/lib/pylonCXP/bin
  3. Start the gpioTool using the options described below.

Options#

The following options are available:

gpioTool -b [board_index]
         -g
         -v
         -s [bank]:[settings]
         -h

-b [board_index]
Specify which CXP-12 Interface Card in your system you want to address. This parameter is mandatory for all options except -h.
The value range of [board_index] is the index numbers of all CXP-12 Interface Card boards installed in your system. If you only have one CXP-12 Interface Card in your system, set [board_index] to 0.

-b [board_index] -g
Show the current GPIO bank settings of the CXP-12 Interface Card specified.

-b [board_index] -v
Show the current GPIO bank settings with verbose output.

-b [board_index] -s [bank]:[settings]
Configure the GPIO bank on the CXP-12 Interface Card specified.
[bank] specifies the index number of the GPIO bank. On the CXP Interface Card 1C, exactly one GPIO bank (the front GPIO) is available. Therefore, always set [bank] to 0.
[settings] configures the settings. See below.

-h
Show help.

Settings#

For the [settings] part in -b [board_index] -s [bank]:[settings], the following settings are available:

Setting Value Result
[signal] se Configures the input lines to receive single-ended signals.
[signal] ds Configures the input lines to receive differential signals.
[pull-up-down] pu Configures the input lines to operate in pull-up mode.a
[pull-up-down] pd Configures the input lines to operate in pull-down mode.b
[inversion] ni Disables inversion for the output lines.
[inversion] in Enables inversion for the output lines.

  1. In most applications, you will need to configure this mode. The interface card activates a 10 kΩ pull-up resistor to receive signals from NPN transistors (open collector, open drain).

  2. The interface card activates a 10 kΩ pull-down resistor to receive signals from PNP transistors (open emitter, open source).

You must enter the settings in the following format: [signal],[pull-up-down],[inversion]. Example: ds,pu,ni

Alternatively, you can set [settings] to default. This resets the configuration of a GPIO bank.

Example#

gpioTool -b 0 -s 0:ds,pu,ni

This command configures the interface card as follows:

  • -b 0: Configure the GPIOs on board 0.
  • -s: Start the actual configuration.
  • 0:: Configure GPIO bank 0 (front GPIO).
  • ds,pu,ni: Configure the front GPIO to receive differential signals (ds), to work in pull-up mode (pu), and to send the outgoing signals not inverted (ni).

Resetting the Configuration#

To reset a board and GPIO bank to the default settings, start the gpioTool with [settings] set to default:

gpioTool -b [board_index] -s [bank]:default

Example: gpioTool -b 0 -s 0:default

Sample Code#

// Select the Acq_SingleCXP12Area applet
camera.GetTLParams().InterfaceApplet.SetValue(Acq_SingleCXP12Area);
// Configure the interface card for external triggering
camera.GetTLParams().AreaTriggerMode.SetValue(AreaTriggerMode_External);
camera.GetTLParams().TriggerInSource.SetValue(TriggerInSource_FrontGpiTriggerSource0);
camera.GetTLParams().TriggerCameraOutSelect.SetValue(TriggerCameraOutSelect_BypassFrontGpi0);
camera.GetTLParams().TriggerState.SetValue(TriggerState_Active);
// Configure the interface card for internal triggering
camera.GetTLParams().AreaTriggerMode.SetValue(AreaTriggerMode_Generator);
camera.GetTLParams().TriggerOutputFrequency.SetValue(8);
camera.GetTLParams().TriggerCameraOutSelect.SetValue(TriggerCameraOutSelect_PulseGenerator0);
camera.GetTLParams().TriggerState.SetValue(TriggerState_Active);
// Use the external or internal trigger signals for image acquisition
camera.TriggerSelector.SetValue(TriggerSelector_FrameStart);
camera.TriggerMode.SetValue(TriggerMode_On);
camera.ExposureMode.SetValue(ExposureMode_Timed);
camera.TriggerSource.SetValue(TriggerSource_CxpTrigger0);
// Perform debayering on the interface card (Bayer RG 12 --> RGB 36 bit)
camera.PixelFormat.SetValue(PixelFormat_BayerRG12);
camera.GetTLParams().AutomaticFormatControl.SetValue(false);
camera.GetTLParams().Format.SetValue(Format_Color36bit);
// Configure the interface card to output 16-bit mono image data based on
// 12-bit mono image data from the camera
camera.PixelFormat.SetValue(PixelFormat_Mono12);
camera.GetTLParams().AutomaticFormatControl.SetValue(false);
camera.GetTLParams().Format.SetValue(Format_Gray16bit);

This sample code is only available in C++ language.

You can also use the pylon Viewer to easily set the parameters.