功能块 ViBaseAxisBasedAcquisition

<< 点击显示目录 >>

主页  mappVision帮助助手 > 机器视觉帮助 > mapp Vision  > 编程 > > 核心库 > ViBase  > 功能块
 >

功能块 ViBaseAxisBasedAcquisition

功能块 ViBaseAxisBasedAcquisition 根据轴位置计算机器视觉相机图像采集的时间戳,并在这些时间采集图像。位置直接从相关视觉组件当前使用的视觉应用程序中配置的轴读取。

功能块

vibaseaxisbasedacquisition

接口

输入/输出

名称

数据类型

说明

输入

MpLink

指向ViComponentType的指针

用于获取图像的视觉组件指针。

IN

启用

BOOL

启用功能块并开始计算。

IN

采集参数

ViBaseAxBsdAcqAcqParType

根据轴位置定义何时触发采集的参数。

高级参数

高级参数

ViBaseAxBsdAcqAdvParType

用于使用高级函数的结构。

IN

更新

BOOL

更新采集参数。参见功能说明

IN

暂停采集

BOOL

如果为 TRUE,则内部计算仍在进行,但不采集图像。

IN

强制采集

BOOL

此输入的上升沿将强制尽快采集图像。

注意:

通过设置此输入,即使设置了 PauseAcquisition(暂停采集),也会采集图像。

输出

操作中

BOOL

计算处于激活状态,时间戳被转发到视觉组件。

BOOL

功能块处于活动状态,必须继续调用。

出错

错误

BOOL

执行过程中出错。

输出

状态 ID

DINT

状态信息。

输出

更新完成

BOOL

表示已初始化新的采集参数。

输出

附加信息

ViBaseAxBsdAcqAddInfoType

其他有用数据,例如用于系统监控或错误分析的数据。

表:功能块 ViBaseAxisBasedAcquisition 的输入和输出

ViComponentType

数据类型为 ViComponentType 的变量为内部变量。在创建视觉组件时,将自动创建相关的 "ViComponentType "变量。可以通过视觉组件的名称来引用该变量。

ViBaseAxBsdAcqAcqParType

参数

数据类型

描述

采集位置

LREAL[8]

以[测量单位]表示的在定义的 "周期 "或轴周期内应采集图像的位置。

注:

索引 > 0 时,值 0.0 定义为非活动位置。

从第一个非活动位置开始,后面的所有数组条目也必须定义为非活动。

所有活动位置必须严格单调递增。

周期

LREAL

如果使用非周期性轴或使用与定义轴周期不同的轴周期,则以[测量单位]为单位的周期。

定义采集位置的定义周期或重复采集位置的周期。

注意

只允许大于 0 且小于 231 * 轴的 "测量分辨率 "的值。

起始位置

LREAL

以 [测量单位] 为单位的周期起始位置。

非周期轴:该值对应一个绝对位置值,采集位置的周期从该值开始。如果已经超过该位置,则从 "StartPosition(起始位置)"+"Period(周期)"的下一个倍数开始执行功能。

周期轴:该值对应于轴周期内的一个位置值,功能应在该轴周期内启动。如果指定的值不是 "0",则 "Period"(周期)的起始点将相对于轴周期的起始点移动。可能的取值范围:[0,轴周期]。

表:ViBaseAxBsdAcqAcqParType

ViBaseAxBsdAcqAdvParType

参数

数据类型

数据类型

禁用负方向

BOOL

如果为 TRUE,则仅在轴的位置值增加时才触发图像采集。

添加位置补偿

真实

此处配置的时间值 [s] 将添加到自动确定的位置补偿时间(请参阅 ViBasedAxBsdAcqAddInfoType 的 DefaultPositionCompensation)。

必要时,可用于补偿从位置评估到 PLC 接收位置之间的时间。

也允许使用负值。

注意

如果使用轴的位置设定值,内部会自动确定正确的位置补偿时间。如果使用实际位置值(例如来自外部编码器轴的位置值),则还必须考虑以下时间:

编码器的评估时间

计数器模块的评估时间

网络周期时间(X2X、POWERLINK 等)

另请参阅自动化帮助:

X2X 链接 - 延迟时间

POWERLINK - 输入延迟

添加输出补偿

LREAL

此处配置的时间值 [s] 将添加到自动确定的输出补偿时间(请参阅 ViBasedAxBsdAcqAddInfoType 的 DefaultOutputCompensation)。

如有必要,可以用它来补偿将时间戳传输到摄像机模块所需的时间。

也允许使用负值。

注意

在默认设置下,内部会自动确定正确的输出补偿时间。

表:ViBaseAxBsdAcqAdvParType

ViBaseAxBsdAcqAddInfoType

参数

数据类型

数据类型

默认位置补偿

真实

自动确定的位置补偿时间 [s]。

默认输出补偿

真实

自动确定的输出补偿时间 [秒]。

时间戳计数

SINT

当为图像采集计算出新的时间戳值时,该值将发生变化。

注意:

如果设置了 "PauseAcquisition(暂停采集)",则不会设置该值。

计算的时间戳

DINT

转发给视觉组件的最后计算时间戳值。

请注意:

如果设置了 "PauseAcquisition(暂停采集)",则不会设置该值。

表格:ViBaseAxBsdAcqAddInfoType

本节主题:

功能描述

输入和输出说明

状态编号


Function block ViBaseAxisBasedAcquisition calculates timestamps for image acquisitions of the machine vision camera based on axis positions and acquires images at these times. The positions are read directly from the axis configured in the currently used vision application of the associated vision component.

Function block

vibaseaxisbasedacquisition

Interface

I/O

Name

Data type

Description

IN

MpLink

Pointer to ViComponentType

Pointer to the vision component from which images should be acquired.

IN

Enable

BOOL

Enables the function block and starts the calculations.

IN

AcquisitionParameters

ViBaseAxBsdAcqAcqParType

Parameters that define when the acquisition is triggered depending on the axis position.

IN

AdvancedParameters

ViBaseAxBsdAcqAdvParType

Structure for using advanced functions.

IN

Update

BOOL

Updates the acquisition parameters. See Function description.

IN

PauseAcquisition

BOOL

If TRUE, the internal calculations are still active, but no image is acquired.

IN

ForceAcquisition

BOOL

A rising edge on this input will force an image acquisition as quickly as possible.

Note:

By setting this input, an image is acquired even if PauseAcquisition is set.

OUT

InOperation

BOOL

The calculations are active, and the timestamps are forwarded to the vision component.

OUT

Busy

BOOL

The function block is active and must continue to be called.

OUT

Error

BOOL

Error during execution.

OUT

StatusID

DINT

Status information.

OUT

UpdateDone

BOOL

Indicates that new acquisition parameters have been initialized.

OUT

AdditionalInfo

ViBaseAxBsdAcqAddInfoType

Additional useful data, for example for system monitoring or error analysis.

Table: Inputs and outputs of function block ViBaseAxisBasedAcquisition

ViComponentType

Variables of data type ViComponentType are internal variables. During the creation of a vision component, an associated "ViComponentType" variable will be automatically created. This can be referenced by the name of the vision component.

ViBaseAxBsdAcqAcqParType

Parameter

Data type

Description

AcquisitionPositions

LREAL[8]

Positions in [measurement units] within the defined "Period" or axis period in which images should be acquired.

Notes:

For index > 0, value 0.0 defines an inactive position.

Starting from the first inactive position, all following array entries must also be defined as inactive.

All active positions must be strictly monotonically increasing.

Period

LREAL

Period in [measurement units] if a non-periodic axis is used or a different axis period than the one defined should be used.

Defines the period within which the acquisition positions are defined or after which they are repeated.

Note:

Only values greater than 0 and less than 231 * the "measuring resolution" of the axis are permitted.

StartPosition

LREAL

Start position in [measurement units] of the period.

Notes:

Non-periodic axis: The value corresponds to an absolute position value at which the period for the acquisition positions is started. If this position has already been exceeded, the function is started at the next multiple of "StartPosition" + "Period".

Periodic axis: The value corresponds to a position value within the axis period at which the function should be started. If a value other than "0" is specified, the start of "Period" is shifted with respect to the start of the axis period. Range of possible values: [0, axis period].

Table: ViBaseAxBsdAcqAcqParType

ViBaseAxBsdAcqAdvParType

Parameter

Data type

Description

DisableNegativeDirection

BOOL

If TRUE, the image acquisition is only triggered when the position value of the axis increases.

AddPositionCompensation

REAL

The time value [s] configured here is added to the automatically determined position compensation time (see DefaultPositionCompensation for ViBasedAxBsdAcqAddInfoType).

If necessary, this can be used to compensate for the duration between the position evaluation and the reception of the position on the PLC.

Negative values are also permitted.

Note:

If a position setpoint of an axis is used, the correct position compensation time is automatically determined internally. If actual position values are used (e.g. from an external encoder axis), the following times must also be taken into account:

Evaluation time of the encoder

Evaluation time of the counter module

Network cycle time (X2X, POWERLINK, etc.)

See also Automation Help:

X2X Link - Latency times

POWERLINK - Input latency

AddOutputCompensation

LREAL

The time value [s] configured here is added to the automatically determined output compensation time (see DefaultOutputCompensation for ViBasedAxBsdAcqAddInfoType).

If necessary, this can be used to compensate for the duration required to transfer the timestamp to the camera module.

Negative values are also permitted.

Note:

With a default setting, the correct output compensation time is automatically determined internally.

Table: ViBaseAxBsdAcqAdvParType

ViBaseAxBsdAcqAddInfoType

Parameter

Data type

Description

DefaultPositionCompensation

REAL

Automatically determined position compensation time [s].

DefaultOutputCompensation

REAL

Automatically determined output compensation time [s].

TimestampCount

SINT

The value is changed when a new timestamp value is calculated for the image acquisition.

Note:

The value is not set if "PauseAcquisition" is set.

CalculatedTimestamp

DINT

Last calculated timestamp value forwarded to the vision component.

Note:

The value is not set if "PauseAcquisition" is set.

Table: ViBaseAxBsdAcqAddInfoType

Topics in this section:

Function description

Description of inputs and outputs

Status numbers