User Output Value
User Output Value#
这对于控制外部事件或设备(例如光源)很有用。
该功能的使用#
设置一个 I/O 线路的输出状态#
要设置 I/O 线路的输出状态:
- 将
LineSelector
参数设置为所需的输出线路,例如Line2
。 - 将
LineSource
参数设置为UserOutput
。 - 如果有多个用户输出线路源可用(例如,“用户输出 1”、“用户输出 2”),将
UserOutputSelector
参数设置为相应的线路源。
示例:假设您已将线路 2 的线路源设置为UserOutput1
。要配置线路 2 的线路状态,必须将UserOutputSelector
参数设置为UserOutput1
。 - 如果要将线路状态设置为高 (1),请将
UserOutputValue
参数设置为true
。 - 如果要将线路状态设置为低 (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 轻松设置参数。