User Output Value

发布时间 2024-01-08 21:32:38作者: fire909090

User Output Value#

相机的 User Output Value 功能允许您通过软件将一个或所有输出线路的状态设置为高电平 (1) 或低电平 (0)。

这对于控制外部事件或设备(例如光源)很有用。

该功能的使用#

设置一个 I/O 线路的输出状态#

要设置 I/O 线路的输出状态:

  1. 将 LineSelector 参数设置为所需的输出线路,例如 Line2
  2. 将 LineSource 参数设置为 UserOutput
  3. 如果有多个用户输出线路源可用(例如,“用户输出 1”、“用户输出 2”),将 UserOutputSelector 参数设置为相应的线路源。
    示例:假设您已将线路 2 的线路源设置为 UserOutput1。要配置线路 2 的线路状态,必须将 UserOutputSelector 参数设置为 UserOutput1
  4. 如果要将线路状态设置为高 (1),请将 UserOutputValue 参数设置为 true
  5. 如果要将线路状态设置为低 (0),请将 UserOutputValue 参数设置为 false

设置多个 I/O 线路的输出状态#

您可以使用 UserOutputValueAll 参数配置多个输出线路的状态。该参数报告为 64 位值。

该值中的部分位与输出线路相关联。每一位均配置其关联线路的状态:

  • 如果某位设置为 0,则关联线路的状态设置为低电平。
  • 如果某位设置为 1,则关联线路的状态设置为高电平。

哪个位与哪条线路相关联取决于您的相机型号

详情#

显示所有相机型号

相机型号UserOutputValueAll 位与线路的关联
acA1440-73gm 位 0 始终为 0
位 1 配置Line 2 的状态
位 2 配置Line 3 的状态
示例:所有线路高 = 0b110

示例代码#

# Select Line 2 (output line)
camera.LineSelector.Value = "Line2"
# Set the source signal to User Output 1
camera.LineSource.Value = "UserOutput1"
# Select the User Output 1 signal
camera.UserOutputSelector.Value = "UserOutput1"
# Set the User Output Value for the User Output 1 signal to true.
# Because User Output 1 is set as the source signal for Line 2,
# the status of Line 2 is set to high.
camera.UserOutputValue.Value = True
# Set the status of all output values in a single operation
# Assume the camera has two output lines and you want to set both to high
# 0b110 (binary) = 6 (decimal)
camera.UserOutputValueAll.Value = 6
 
 

您也可以使用 pylon Viewer 轻松设置参数。