配置 CXP-12 接口卡#
信息
This topic covers basic use cases. For in-depth information about the software features of the interface card, see the acquisition applets PDF documentation.
在以下情况下配置接口卡特别有用:
- 您要更改接口卡使用的小程序。
- 希望通过接口卡触发连接的 Basler boost CXP-12 相机。
- 希望对接口卡执行去马赛克处理以提高成像系统的性能。
- 希望使用相机不可用的输出格式,例如 16 位单色格式。
- 您要配置接口卡接收或发送的触发信号。
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#
根据接口卡型号,以下小程序可用且设置为默认值:
小程序名称 | 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 |
In addition to the Acqusition Applets, you can also use the Enhanced Applets. The Enhanced Applets are a prototype and are only available upon request via your local Basler Sales representative or field application engineer. All Enhanced Applets have the additional features:
- Binning (currently only monochrome) of up to 4x4
- Block-based flat field correction (FFC) for monochrome cameras
- PGI high quality Debayering and image quality improvements
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.
小程序名称 | Available For Interface Card |
---|---|
Acq_SingleCXP12Line | 1C、2C、4C |
Acq_DualCXP12Line | 2C、4C |
Acq_TripleCXP12Line | 4C |
Acq_QuadCXP12Line | 4C |
文档#
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 接口卡 2C#
CXP-12 接口卡 4C#
选择正确的小程序#
如果您仅使用单通道 (1-CXP) 相机,则默认小程序始终对您可用,您无需进行更改。
但是,如果您使用的是多通道(例如,2-CXP 或 4-CXP)相机,则您必须选择适合您相机设置的合适小程序。否则,相机将无法正常工作或相机性能可能会明显降低。
具体哪个小程序是正确的,取决于相机数量、每台相机的通道数量,以及所需的 ROI 步长。
ROI 步长取决于图像预处理的并行度,因此随相机和图像采集卡而变化。
CXP-12 Interface Card 1C#
Area Scan Applets for the CXP-12 Interface Card 1C#
单通道相机数量 | 双通道相机数量 | 四通道相机数量 | 小程序 | ROI 步长 [像素] | 拓扑 |
---|---|---|---|---|---|
1 | Acq_SingleCXP12x1Area | x: 4 y: 1 |
Line Scan Applets for the CXP-12 Interface Card 1C#
单通道相机数量 | 双通道相机数量 | 四通道相机数量 | 小程序 | ROI 步长 [像素] | 拓扑 |
---|---|---|---|---|---|
1 | Acq_SingleCXP12Line | x: 4 y: 1 |
CXP-12 接口卡 2C#
Area Scan Applets for the CXP-12 Interface Card 2C#
单通道相机数量 | 双通道相机数量 | 四通道相机数量 | 小程序 | ROI 步长 [像素] | 拓扑 |
---|---|---|---|---|---|
1 | Acq_DualCXP12Area | x: 8 y: 1 | |||
2 | Acq_DualCXP12Area | x: 8 y: 1 | |||
1 | Acq_SingleCXP12Area | x: 16 y: 1 |
Line Scan Applets for the CXP-12 Interface Card 2C#
单通道相机数量 | 双通道相机数量 | 四通道相机数量 | 小程序 | ROI 步长 [像素] | 拓扑 |
---|---|---|---|---|---|
1 | Acq_DualCXP12Line | x: 8 y: 1 | |||
2 | Acq_DualCXP12Line | x: 8 y: 1 | |||
1 | Acq_SingleCXP12Line | x: 16 y: 1 |
CXP-12 接口卡 4C#
Area Scan Applets for the CXP-12 Interface Card 4C#
单通道相机数量 | 双通道相机数量 | 四通道相机数量 | 小程序 | ROI 步长 [像素] | 拓扑 |
---|---|---|---|---|---|
1 | Acq_QuadCXP12Area | x: 8 y: 1 | |||
2 | Acq_QuadCXP12Area | x: 8 y: 1 | |||
3 | Acq_QuadCXP12Area | x: 8 y: 1 | |||
4 | Acq_QuadCXP12Area | x: 8 y: 1 | |||
1 | Acq_DualCXP12Area | x: 16 y: 1 | |||
2 | Acq_DualCXP12Area | x: 16 y: 1 | |||
1 | Acq_SingleCXP12Area | x: 32 y: 1 | |||
1 | 1 | Acq_TripleCXP12Area | x: 8 y: 1 | ||
2 | 1 | Acq_TripleCXP12Area | x: 8 y: 1 |
Line Scan Applets for the CXP-12 Interface Card 4C#
单通道相机数量 | 双通道相机数量 | 四通道相机数量 | 小程序 | ROI 步长 [像素] | 拓扑 |
---|---|---|---|---|---|
1 | Acq_QuadCXP12Line | x: 8 y: 1 | |||
2 | Acq_QuadCXP12Line | x: 8 y: 1 | |||
3 | Acq_QuadCXP12Line | x: 8 y: 1 | |||
4 | Acq_QuadCXP12Line | x: 8 y: 1 | |||
1 | Acq_DualCXP12Line | x: 16 y: 1 | |||
2 | Acq_DualCXP12Line | x: 16 y: 1 | |||
1 | Acq_SingleCXP12Line | x: 32 y: 1 | |||
1 | 1 | Acq_TripleCXP12Line | x: 8 y: 1 | ||
2 | 1 | Acq_TripleCXP12Line | x: 8 y: 1 |
更改小程序#
接口卡上运行的小程序定义其功能。对于某些相机设置,您可能必须更改默认小程序。ace
To change the applet used by the interface card in pylon, set the InterfaceApplet
parameter to the name of the applet to be loaded, e.g., Acq_DualCXP12Area
:
使用接口卡触发 Basler boost CXP-12 相机#
信息
仅当您特别想通过接口卡触发相机时,此部分才有意义。一般是通过相机的 I/O 连接器触发相机。有关更多信息,请参见触发图像采集。
硬件触发(外部)#
启用外部触发后,您可以将触发输入信号发送到接口卡,然后接口卡将这些信号转发到 Basler boost 相机。
要配置接口卡以进行外部硬件触发,请执行以下操作:
- 将
AreaTriggerMode
参数设置为External
。 - 将
TriggerInSource
参数设置为所需的“Front GPI”输入线路。
例如,如果要使用 GPI0(接口卡上的引脚 11 和 12)进行外部触发,请将该参数设置为FrontGpiTriggerSource0
。 - 将
TriggerCameraOutSelect
参数设置为相应的“Bypass”选项。
例如,如果您选择FrontGpiTriggerSource0
,则将TriggerCameraOutSelect
参数设置为BypassFrontGpi0
。 - 将
TriggerState
参数设置为Active
。 - 如有必要,按如下所述配置触发信号。
所有触发信号都将转发到相机的源信号 CxpTrigger0
和 CxpTrigger1
。信号可以用于各种目的。最常见的用例是图像采集。请参见下面的示例。
硬件触发(内部)#
启用内部触发后,接口卡将在内部以指定频率生成触发信号。所有外部触发信号将被忽略。
要配置接口卡以进行内部硬件触发,请执行以下操作:
- 将
AreaTriggerMode
参数设置为Generator
。 - 将
TriggerOutputFrequency
参数设置为所需的触发输出频率。例如,如果将该参数设置为 8,则接口卡将每秒生成 8 个触发信号。 - 将
TriggerCameraOutSelect
参数设置为所需的输出线路,例如PulseGenerator0
。 - 将
TriggerState
参数设置为Active
。
现在,无论何时开始图像采集,接口卡都会以指定的频率生成触发信号。
所有触发信号都将转发到相机的源信号 CxpTrigger0
和 CxpTrigger1
。信号可以用于各种目的。最常见的用例是图像采集。请参见下面的示例。
示例:使用触发信号进行图像采集#
要使用接口卡生成的外部或内部触发信号来采集图像,请执行以下操作:
- 在相机上,将
TriggerSelector
参数设置为FrameStart
。 - 将
TriggerMode
参数设置为On
。 - 将
ExposureMode
参数设置为Timed
。 - Set the
TriggerSource
parameter toCxpTrigger0
orCxpTrigger1
.
现在,相机将在接口每次接收或生成触发信号时收集图像。
信息
您可以将触发信号用作任何可由信号源控制的 Basler boost 相机功能的来源。例如,将 CounterTriggerSource
参数设置为 CxpTrigger0
,可让您使用接口卡控制 Counter 的功能。
在接口卡上执行去马赛克处理#
使用 CXP-12 Interface Card 1C,您可以在接口卡上执行去马赛克处理。这样可以减少相机和主机上的计算负载。
为此:
- Start the pylon Viewer and open a connection to the interface card and the camera.
- 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).
现在,接口卡将对相机的原始图像数据执行去马赛克处理并输出 RGB 图像数据。
信息
确保在上面的步骤 3 中设置了正确的 RGB pixel format。否则,将无法正确采集图像。
使用相机上不可用的输出格式#
Basler boost 相机可以输出多种 pixel format 的图像数据,例如 Bayer RG 8 或 RBG 8。有关更多信息,请参见 pixel format 主题。
如果相机上未提供所需的 pixel format,并且您还希望避免在主机上进行图像转换,则可以使用接口卡提供的一种 pixel format。
接口卡提供以下格式:
Gray8bit | Gray10bit | Gray12bit | Gray16bit |
Color24bit | Color30bit | Color36bit | Color48bit |
Bayergr8 | Bayergr10 | Bayergr12 | Bayergr16 |
Bayerrg8 | Bayerrg10 | Bayerrg12 | Bayerrg16 |
Bayergb8 | Bayergb10 | Bayergb12 | Bayergb16 |
Bayerbg8 | Bayerbg10 | Bayerbg12 | Bayerbg16 |
要使用相机上不可用的输出格式,请执行以下操作:
- 在相机上,将
PixelFormat
参数设置为所需的相机 pixel format,例如Mono12
。 - 在接口卡上,将
AutomaticFormatControl
参数设置为false
。
这使您可以独立于相机使用的 pixel format 设置输出格式。 - 在接口卡上,将
Format
参数设置为所需的输出格式,例如Gray16bit
。
使用上面的示例值,接口卡将基于 12 位相机图像数据输出 16 位图像数据。如下所示插入填充位(零)。
Configuring the Trigger Signals Using the gpioTool#
使用 gpioTool 命令行工具,可以配置接口卡接收或发送的触发信号的物理属性:
- 可以将输入线路配置为接收单端或差分信号。
- 可以将输入线路配置为在上拉或下拉模式下工作。
- 可以指定是否应将输出信号反相。
The gpioTool is included in the pylon Software Suite.
要启动该工具,请执行以下操作:
- 打开命令提示符窗口 (Windows) 或“终端”窗口 (Linux)。
-
更改至 pylon 安装的 bin 目录:
- Windows(64 位):%programfiles%\Basler\pylon x\Runtime\x64\pylonCXP\bin
- Windows(32 位):%programfiles%\Basler\pylon x\Runtime\Win32\pylonCXP\bin
- Linux:/opt/pylon/lib/pylonCXP/bin
-
使用如下所述的选项启动 gpioTool。
选项#
可以使用如下选项:
-b [board_index]
指定您要在系统中寻址的 CXP-12 接口卡。对于 -h
以外的所有选项,此参数都是必需的。
[board_index]
的值范围是系统中安装的所有 CXP-12 接口卡板的索引号。如果您的系统中只有一个 CXP-12 接口卡,请将 [board_index]
设置为 0。
-b [board_index] -g
显示指定的 CXP-12 接口卡的当前 GPIO 组设置。
-b [board_index] -v
显示具有详细输出的当前 GPIO 组设置。
-b [board_index] -s [bank]:[settings]
在指定的 CXP-12 接口卡上配置 GPIO 组。
[bank]
指定 GPIO 组的索引号。在 CXP 接口卡 1C 上,只有一个 GPIO 组(前端 GPIO)可用。因此,始终都应将 [bank]
设置为 0。
[settings]
配置相应的设置。参见下文。
-H
显示帮助。
设置#
对于 -b [board_index] -s [bank]:[settings]
中的 [settings]
部分,可以使用如下设置:
设置 | 值 | 结果 |
---|---|---|
[signal] | se | 将输入线路配置为接收单端信号。 |
[signal] | ds | 将输入线路配置为接收差分信号。 |
[pull-up-down] | pu | 将输入线路配置为在上拉模式下工作。a |
[pull-up-down] | pd | 将输入线路配置为在下拉模式下工作。a |
[inversion] | ni | 禁用输出线路的反转。 |
[inversion] | in | 启用输出线路的反转。 |
-
在大多数应用程序中,您需要配置此模式。接口卡激活一个 10 kΩ 的上拉电阻,以接收来自 NPN 晶体管(集电极开路、漏极开路)的信号。
-
接口卡会激活一个 10 kΩ 的下拉电阻,以接收来自 PNP 晶体管(发射极开路、开源)的信号。
您必须按照以下格式输入设置:[signal],[pull-up-down],[inversion]
。示例:ds,pu,ni
另外,您可以将 [settings]
设置为 default
。这将重置 GPIO 组的配置。
示例#
gpioTool -b 0 -s 0:ds,pu,ni
此命令按以下方式配置接口卡:
-b 0
:在板 0 上配置 GPIO。-s
:开始实际配置。0:
:配置 GPIO 组 0(前端 GPIO)。ds,pu,ni
:将前端 GPIO 配置为接收差分信号 (ds),在上拉模式 (pu) 下工作并发送未反相的输出信号 (ni)。
重置配置#
要将板和 GPIO 组重置为默认设置,请在 [settings]
设置为 default
的情况下启动 gpioTool:
gpioTool -b [board_index] -s [bank]:default
示例: gpioTool -b 0 -s 0:default
示例代码#
// 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);
此示例代码仅适用于 C++ 语言。
您也可以使用 pylon Viewer 轻松设置参数。