• Version
  • Language
  • Product
  • Knowledge base
  • Camera
  • Motion
  • Zivid.com ↗
  • Downloads ↗
  • Webshop ↗
Logo

入门

  • 用户指南
  • 软件安装
  • Studio操作指南
  • 快速捕获教程

学院

  • 相机
    • 捕获教程
    • GPU Access Tutorial
    • 点云捕获过程
    • 2D图像捕获流程
    • 2D+3D捕获策略
    • 捕获高质量的点云
    • 运行多台Zivid相机
    • File Camera(文件相机)
    • Projector
    • 现场标定
    • 预热
    • 检测以太网链路变化
      • 介绍
      • 读取链路速度
      • 拓扑学解释
        • 相机直连到电脑
        • 相机通过交换机连接到电脑
        • 多交换机配置
      • 如果线缆损坏了会产生什么影响?
      • 示例
    • 固件升级
    • 多线程
  • 应用

软件

  • Integrations
  • 示例
  • Docker
  • API参考
  • 捕获速度
  • Supporting Reference

参考文章

  • 相机设置
  • 计算器
  • 硬件
  • 一般相机主题
  • 一般3D主题

支持

  • FAQ
  • 故障排除
  • 勘误表
  • 联系我们
  • KB Version History
ZIVID KNOWLEDGE BASE
  • Zivid相机
  • 相机
  • 检测以太网链路变化

  • 检测以太网链路变化
    • 介绍
    • 读取链路速度
    • 拓扑学解释
      • 相机直连到电脑
      • 相机通过交换机连接到电脑
      • 多交换机配置
    • 如果线缆损坏了会产生什么影响?
    • 示例

检测以太网链路变化

  • 介绍

  • 读取链路速度

  • 拓扑学解释

    • 相机直连到电脑

    • 相机通过交换机连接到电脑

    • 多交换机配置

  • 如果线缆损坏了会产生什么影响?

  • 示例

介绍

监控以太网链路速度有助于在系统性能下降或吞吐量低于目标值之前检测到网络性能下降。链路速度意外下降可能表明存在线缆故障、连接器故障或意外的网络拓扑结构变更。

本教程演示如何读取和监控每台相机的两个以太网链路速度状态:

  • CameraState::Network::Ethernet::LinkSpeed (相机端)

  • CameraState::Network::LocalInterface::Ethernet::LinkSpeed (主机端)

读取链路速度

通过查询上面列出的 API,读取监控回路中每个相机的链路速度。

The host-side link speed is read from the local interface and does not require a connection to the camera:

查看源码

source

// Reading the host-side (local interface) Ethernet link speed does not require a connection to the camera.
const auto localInterface = getUsersLocalInterface(camera);
const auto localInterfaceLinkSpeed = localInterface.ethernet().linkSpeed();

std::cout << "Camera " << camera.info().serialNumber()
          << ": local interface Ethernet link speed=" << localInterfaceLinkSpeed << std::endl;
查看源码

source

// Reading the host-side (local interface) Ethernet link speed does not require a connection to the camera.
var localInterfaceLinkSpeed = GetUsersLocalInterface(camera).Ethernet.LinkSpeed;

Console.WriteLine("Camera {0}: local interface Ethernet link speed={1}",
    camera.Info.SerialNumber,
    localInterfaceLinkSpeed);
查看源码

source

# Reading the host-side (local interface) Ethernet link speed does not require a connection to the camera.
local_interface_link_speed = get_users_local_interface(camera).ethernet.link_speed

print(f"Camera {camera.info.serial_number}: local interface Ethernet link speed={local_interface_link_speed}")

The camera-side link speed is read from the camera state and does require being connected to the camera:

查看源码

source

// Reading the camera-side Ethernet link speed requires being connected to the camera.
camera.connect();
try
{
    const auto cameraLinkSpeed = camera.state().network().ethernet().linkSpeed();
    std::cout << "Camera " << camera.info().serialNumber() << ": camera Ethernet link speed=" << cameraLinkSpeed
              << std::endl;
}
catch(...)
{
    camera.disconnect();
    throw;
}
camera.disconnect();
查看源码

source

// Reading the camera-side Ethernet link speed requires being connected to the camera.
camera.Connect();
try
{
    var cameraLinkSpeed = camera.State.Network.Ethernet.LinkSpeed;
    Console.WriteLine("Camera {0}: camera Ethernet link speed={1}",
        camera.Info.SerialNumber,
        cameraLinkSpeed);
}
finally
{
    camera.Disconnect();
}
查看源码

source

# Reading the camera-side Ethernet link speed requires being connected to the camera.
camera.connect()
try:
    camera_link_speed = camera.state.network.ethernet.link_speed
finally:
    camera.disconnect()

print(f"Camera {camera.info.serial_number}: camera Ethernet link speed={camera_link_speed}")

For the corresponding API, see NetworkConfiguration.

拓扑学解释

相机直连到电脑

如果相机直接连接到主机 NIC :

  • 相机链路速度代表的是相机与主机 NIC 之间直接连接的线缆段。

  • 本地接口链路速度代表来自主机侧的同一直连电缆段的速度。

在这种情况下,两个 API 应当报告相同的链路速度。无论哪一个 API 的数值发生变化,都表明相机与主机之间的连接状态发生了改变。

相机通过交换机连接到电脑

如果相机和主机通过同一个交换机连接:

  • 相机链路速度代表相机到交换机的链路速度。

  • Local interface link speed represents the host-NIC-to-switch segment.

在这种情况下,两个 API 监控的是不同的网络段。因此,任何一个 API 的数值发生变化,都表明其对应的那个网络段出现了状态改变。

多交换机配置

在多交换机配置中,这些 API 仅观测从每个端点出发的第一跳连接:

  • 相机链路速度报告的是相机到第一个网络设备之间的链路速度。

  • 本地链路速度报告的是主机 NIC 到第一个网络设备之间的链路速度。

  • 这些 API 不会 交换机与交换机之间的中间网络段!

在这种情况下,任何一个 API 的数值发生变化,都表明其对应的那个网络段出现了状态改变;但中间网络段的变化可能无法被检测到。

如果线缆损坏了会产生什么影响?

损坏的线缆通常不会立即彻底失效。相反,链路往往会触发重新协商并降速运行,例如:

状况

链路速度

正常链接

link1Gbps

降速之后

link100Mbps

即使通信尚未完全中断,这种降速很可能是线缆或连接器出现问题的早期预警信号。在实际场景中,链路可能会在受到干扰时短暂断开,然后以较低的协商速度重新连接。链路以这种方式恢复时,吞吐量会下降,并且连接不稳定或未来断开连接的风险会增加。

如果监测结果显示性能持续下降,请检查并更换受影响段的线缆。

If your camera disconnects or restarts repeatedly during operation without a sustained link speed downgrade, see Camera disconnects or restarts repeatedly during operation for further diagnostic steps.

示例

这些 API 的完整示例可在此处查看:

  • AutomaticNetworkConfigurationForCameras.cpp

  • AutomaticNetworkConfigurationForCameras.cs

  • AutomaticNetworkConfigurationForCameras.py

上一页 下一页

© 版权所有 2015-2026 Zivid AS, last updated: 07 Aug 2026, 15:30 CET。

利用 Sphinx 构建,使用的 主题 由 Read the Docs 开发.

Links

  • Knowledge base
  • Products
  • Downloads
  • Webshop

Follow Us

  • Twitter
  • Facebook
  • LinkedIn
  • YouTube

Contact us

  • Zivid.com
  • Gjerdrums vei 10A
  • NO0484 Oslo, Norway
  • +47 21 02 24 72