跳转到内容

图像采集和 I/O 控制#

Basler blaze 相机配备有两条快速的光耦合 I/O 线。

input line 允许您控制相机,例如,在特定时间点触发图像拍摄。output line 可让您检索有关相机的信息,例如,正在拍摄图像时。

光电耦合 I/O 线路#

blaze cameras provide one opto-coupled input line and one opto-coupled output line:

  • Line0 预配置为相机的输入线路。
  • Line1 预配置为相机的输出线路。

您不能更改 I/O 线路的线路模式。

光电耦合输入线路#

下图展示了使用光电耦合输入线路的典型电路:

输入线路图

输入线路连接到引脚 6。引脚 5 接地。

光电耦合输出线路#

下图展示了使用光电耦合输出线路的典型电路:

输出线路图

输出线路连接到引脚 4。引脚 5 接地。

电气要求#

输入线路#

电压 描述
30 VDC 绝对最大电压。
切勿超过此电压,否则可能会损坏相机并导致保修失效。
0-24 VDC 安全工作范围
0–1.4 V 直流 逻辑 0
>2.2 VDC 逻辑 1
  • 最小电流:5 mA
  • 典型电流:5-15 mA
响应时间#
  • Typical response time (trigger to FrameActive): <300 µs
  • 最大响应时间(触发到 FrameActive):500 µs

未实现信号的去抖动。因此,您必须确保输入线上的电信号是干净的(例如,通过使用 PLC 输出或应用低通滤波器)。

输出线路#

电压 描述
30 VDC 绝对最大电压
3.3-24 VDC 安全工作范围
  • 最小电流:50 mA
  • Leakage current: <60 µA

I/O 线缆#

Basler 建议使用 Power-I/O 线缆 M12,M,8P/开放。线缆文档包括了 I/O 线的引脚输出和颜色编码。

特征和配置#

DigitalIOControl 功能类别包含用于配置和监控 I/O 线路操作的各种功能。

Line Selector#

The Line Selector feature allows you to select the I/O line that you want to configure. To select a line, set the LineSelector parameter to the desired I/O line, e.g., Line1.

Line Status#

要确定 I/O 线路的状态:

  1. LineSelector 参数设置为 Line0(输入线)或 Line1(输出线)。
  2. 获取 LineStatus 参数的值。

值为 false (0) 表示轮询时线路状态为低电平。值为 true (1) 表示轮询时线路状态为高电平。

Line Logic#

要确定 I/O 线路的逻辑:

  1. LineSelector 参数设置为 Line0(输入线)或 Line1(输出线)。
  2. 获取 LineLogic 参数的值。
    此为只读参数。

Line Source(仅输出线路)#

输出线 Line1 可以配置为通过 LineSource 参数提供不同的信号。这允许您监控相机的状态或控制外部设备。

要配置线路源:

  1. LineSelector 参数设置为 Line1
  2. 设置 LineSource 参数设置为以下值:
    • Off:线路始终处于低电平。
    • UserOutput0:线路设置为 UserOutputValue 参数值 UserOutput0
    • FrameActive:当相机正在获取深度图所需的所有子帧时,信号为 high
    • FrameTriggerWait: The signal is high when the camera is ready to receive trigger signals of the corresponding trigger type.

You can use the FrameActive signal to monitor whether the camera is currently exposing. The signal goes high when image acquisition of the first subframe starts and goes low when acquisition of the last subframe ends. This also allows you to use the FrameActive signal to synchronize multiple cameras and external devices.

In addition, you can use the FrameTriggerWait signal to find the right moment for triggering your flash if you're using one.

The following drawing illustrates the timing.

Line Source Example

Example: 如果将传送带上的物体移动到相机的视野中进行检查,则传送带不应移动,而 FrameActive 信号为高电平时可避免运动伪影。

有关多相机操作的更多信息和替代方法,请参阅使用多个相机

Line Inverter#

LineInverter 参数将 I/O 线路的电信号电平反转,即其线路状态从高电平变为低电平,反之亦然。

要启用 Line Inverter:

  1. LineSelector 参数设置为所需的 I/O 线路。
  2. LineInverter 参数设置为 true 可将所选 I/O 线路的电信号电平反转,或者将其设置为 false 可禁用反相。

Example: 如果输入线路 Line0 配置为触发器输入源,则将信号电平反转意味着触发器将在触发信号处于下降沿而不是上升沿时出现。

对于输出线路 Line1,选择的输出信号的电平已反转。

用户输出#

UserOutput 参数允许您手动控制输出线路的状态。只有一个用户输出可用。

要设置用户输出状态:

  1. LineSelector 参数设置为 Line1
  2. LineSource 参数设置为 UserOutput0
  3. UserOutputSelector 参数设置为 UserOutput0
  4. 设置 UserOutputValue 参数为所需的值:
    • true:线路状态为高电平 (1)。
    • false:线路状态为低电平 (0)。

UserOutputValue 参数的更改将立即显示在输出行上。

自由运行和触发器操作#

可以在 free run 模式和 triggered mode 下操作相机。

free run 中,根据配置的帧速率(默认值或通过 AcquisitionFrameRate 参数指定)在内部触发相机。

在自由运行模式下,您可以使用 Precision Time ProtocolSynchronous Free Run 功能同步多个相机的触发。

triggered mode 下,使用外部触发源来触发相机,例如通过 software trigger 或通过 hardware trigger(使用输入线 Line0)进行触发。

触发器始终是 FrameTrigger,即在当前操作模式下触发单帧的采集。

自由运行图像采集#

要启用自由运行图像采集:

  1. TriggerSelector 参数设置为 FrameStart
  2. TriggerMode 参数设置为 Off

触发图像采集#

信息

New trigger signals are ignored until the camera is ready for triggering again. The minimum time between two trigger signals depends on the operating mode of the camera (i.e., the maximum allowed frame rate), the characteristics of the I/O signal, and the processing time required for processing the I/O signal. You can use the FrameTriggerWait signal to find out when the camera is ready to receive trigger signals.

如果相机检测到过度触发,则 LastError 参数将显示错误代码 1

软件触发器#

要通过软件触发器启用图像采集:

  1. TriggerSelector 参数设置为 FrameStart
  2. TriggerSource 参数设置为 Software
  3. TriggerMode 参数设置为 On
  4. 使用 TriggerSoftware 触发单帧。
    现在采集和处理单个深度图并将其交付给客户端软件。

确保在软件触发器接收图像之前开始采集。

硬件触发器#

要通过硬件触发器启用图像采集:

  1. TriggerSelector 参数设置为 FrameStart
  2. TriggerSource 参数设置为 Line0
  3. TriggerMode 参数设置为 On
    图像在 Line0 的上升沿(如果 LineInverter 参数设置为 false)或下降沿(如果 LineInverter 参数为 true)触发。在图像被相机采集和处理之后,将发送到主机。

确保在硬件触发器接收图像之前开始采集。