传输层参数#
pylon API 提供对几个不同传输层的访问:
- PylonGigE 表示使用 GigE Vision 协议的千兆以太网相机
- PylonUsb 表示符合 USB3 Vision 的相机
- PylonCLSer 表示使用 CL 串口的 Camera Link 相机(仅限于相机配置;不可用于 Linux 和 macOS 平台)
本主题描述与传输层有关的参数。
一般参数#
启用命令复制#
Use the CommandDuplicationEnable
parameter to enable sending all commands and receiving all acknowledges twice. This option should only be enabled in case of network problems.
检测信号超时#
即: HeartbeatTimeout
parameter specifies the heartbeat timeout on the host side.
This parameter is the equivalent of the GevHeartbeatTimeout
parameter, which sets the heartbeat timeout on the camera side.
即: HeartbeatTimeout
and GevHeartbeatTimeout
parameters are synchronized automatically. If you change one parameter, the other one changes accordingly.
最大重试计数读取#
Use the MaxRetryCountRead
parameter to specify the maximum number of retries for read operations after a read operation has timed out.
最大重试计数写入#
Use the MaxRetryCountWrite
parameter to specify the maximum number of retries for write operations after a read operation has timed out.
启用迁移模式#
Use the MigrationModeEnable
parameter to enable mapping of certain SFNC 1.x node names to SFNC 2.x node names. This allows you to write code for camera devices that are compatible with different SFNC (Standard Features Naming Convention) versions.
如需了解详情,请参阅 pylon API 文档中的“迁移现有代码以使用基于 SFNC 2.x 的相机设备”部分。
读取超时#
Use the ReadTimeout
parameter to specify the read access timeout value in milliseconds.
如果执行 GigE Vision 控制协议命令耗时超过预期,则调整该值可能会有所帮助。
写入超时#
Use the WriteTimeout
parameter to specify the write access timeout value in milliseconds.
如果执行 GigE Vision 控制协议命令耗时超过预期,则调整该值可能会有所帮助。
统计参数#
最后错误状态#
即: Statistic_Last_Error_Status
parameter indicates the last error status for a read or write operation.
最后错误状态文本#
即: Statistic_Last_Error_Status_Text
parameter indicates the status code of the last failed buffer.
读取操作失败计数#
即: Statistic_Read_Operations_Failed_Count
parameter counts the number of failed read operations.
读取管道重置计数#
即: Statistic_Read_Pipe_Reset_Count
parameter counts the number of read pipe resets.
读写超时计数#
即: StatisticReadWriteTimeoutCount
parameter counts the number of timeouts during read and write operations when waiting for a response from the device.
写入操作失败计数#
即: Statistic_Write_Operations_Failed_Count
parameter counts the number of failed write operations.
写入管道重置计数#
即: Statistic_Write_Pipe_Reset_Count
parameter counts the number of write pipe resets.
示例代码#
// ** General Parameters **
// Command Duplication Enable
camera.GetTLParams().CommandDuplicationEnable.SetValue(true);
// Heartbeat Timeout
camera.GetTLParams().HeartbeatTimeout.SetValue(3000);
// Maximum Retry Count Read
camera.GetTLParams().MaxRetryCountRead.SetValue(2);
// Maximum Retry Count Write
camera.GetTLParams().MaxRetryCountWrite.SetValue(2);
// Migration Mode Enable
camera.GetTLParams().MigrationModeEnable.SetValue(true);
// Read Timeout
camera.GetTLParams().ReadTimeout.SetValue(500);
// Write Timeout
camera.GetTLParams().WriteTimeout.SetValue(500);
// ** Statistics Parameters **
// Last Error Status
int64_t lastErrorStatus = camera.GetTLParams().Statistic_Last_Error_Status.GetValue();
// Last Error Status Text
GenICam::gcstring lastErrorStatusText = camera.GetTLParams().Statistic_Last_Error_Status_Text.GetValue();
// Read Operations Failed Count
int64_t readOperationsFailedCount = camera.GetTLParams().Statistic_Read_Operations_Failed_Count.GetValue();
// Read Pipe Reset Count
int64_t readPipeResetCount = camera.GetTLParams().Statistic_Read_Pipe_Reset_Count.GetValue();
// Read Write Timeout Count
int64_t writePipeResetCount = camera.GetTLParams().StatisticReadWriteTimeoutCount.GetValue();
// Write Operations Failed Count
int64_t writeOperationsFailedCount = camera.GetTLParams().Statistic_Write_Operations_Failed_Count.GetValue();
// Write Pipe Reset Count
int64_t writePipeResetCount = camera.GetTLParams().Statistic_Write_Pipe_Reset_Count.GetValue();
// ** General Parameters **
// Command Duplication Enable
camera.Parameters[PLTransportLayer.CommandDuplicationEnable].SetValue(true);
// Heartbeat Timeout
camera.Parameters[PLTransportLayer.HeartbeatTimeout].SetValue(3000);
// Maximum Retry Count Read
camera.Parameters[PLTransportLayer.MaxRetryCountRead].SetValue(2);
// Maximum Retry Count Write
camera.Parameters[PLTransportLayer.MaxRetryCountWrite].SetValue(2);
// Migration Mode Enable
camera.Parameters[PLTransportLayer.MigrationModeEnable].SetValue(true);
// Read Timeout
camera.Parameters[PLTransportLayer.ReadTimeout].SetValue(500);
// Write Timeout
camera.Parameters[PLTransportLayer.WriteTimeout].SetValue(500);
// ** Statistics Parameters **
// Last Error Status
Int64 lastErrorStatus = camera.Parameters[PLTransportLayer.Statistic_Last_Error_Status].GetValue();
// Last Error Status Text
string lastErrorStatusText = camera.Parameters[PLTransportLayer.Statistic_Last_Error_Status_Text].GetValue();
// Read Operations Failed Count
Int64 readOperationsFailedCount = camera.Parameters[PLTransportLayer.Statistic_Read_Operations_Failed_Count].GetValue();
// Read Pipe Reset Count
Int64 readPipeResetCount = camera.Parameters[PLTransportLayer.Statistic_Read_Pipe_Reset_Count].GetValue();
// Read Write Timeout Count
Int64 writePipeResetCount = camera.Parameters[PLTransportLayer.StatisticReadWriteTimeoutCount].GetValue();
// Write Operations Failed Count
Int64 writeOperationsFailedCount = camera.Parameters[PLTransportLayer.Statistic_Write_Operations_Failed_Count].GetValue();
// Write Pipe Reset Count
Int64 writePipeResetCount = camera.Parameters[PLTransportLayer.Statistic_Write_Pipe_Reset_Count].GetValue();
您也可以使用 pylon Viewer 轻松设置参数。