功能块 ViBaseGetImage

<< 点击显示目录 >>

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

功能块 ViBaseGetImage

通过功能块 ViBaseGetImage,可以从摄像机中获取最后一次采集的图像,并将其存储在 PLC DRAM 存储器的数据缓冲区中。然后可在 mapp View HMI 应用程序中显示该图像,或使用库 FileIO 来持久化该图像(请参阅用例:备份、显示或提供摄像机图像)。

功能块

vibasegetimage

接口

输入/输出

名称

数据类型

说明

输入

MpLink

指向ViComponentType的指针

应从视觉组件获取图像的指针。

IN

执行

BOOL

在该输入的上升沿开始执行功能块。

输入

类型

ViBaseImageTypeEnum(基本图像类型枚举

确定提供图像数据的图像格式。

输入

质量等级

USINT

JPG 压缩质量级别。如果 Type = viBASE_IMAGE_TYPE_BMP,则忽略。有效值范围:1 - 100.

超时

超时

时间

执行功能块的最长时间。值 0 时无时间限制。不允许使用负值。

缓冲区

缓冲区

UDINT

指向复制图像数据的内存区域的指针。

IN

缓冲区大小

UDINT

指定数据区域的长度(要复制的字节数)。必须至少为 512 字节。

输出

完成

BOOL

执行成功。功能块执行完毕。

BOOL

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

激活

BOOL

表示已开始从摄像机传输图像数据。

错误

错误

BOOL

执行过程中出错。

输出

状态 ID

DINT

状态信息。

输出

缓冲区长度

UDINT

实际复制的字节数。

输出

网络时间

DINT

拍摄图像时的净时间。

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

ViComponentType

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

ViBaseImageTypeEnum

枚举常量

说明

viBASE_IMAGE_TYPE_BMP

0

图像数据为未压缩的位图格式。

viBASE_IMAGE_TYPE_JPG

1

图像数据为有质量损失的压缩 JPEG 格式。

表:ViBaseImageTypeEnum

本节主题:

功能说明

输入和输出说明

状态编号


With function block ViBaseGetImage, the last acquired image can be retrieved from the camera and stored in a data buffer in DRAM memory on the PLC. This image can then be displayed in a mapp View HMI application or persisted using library FileIO (see Use cases: Backing up, displaying or providing the camera image).

Function block

vibasegetimage

Interface

I/O

Name

Data type

Description

IN

MpLink

Pointer to ViComponentType

Pointer to the vision component from which the image should be retrieved.

IN

Execute

BOOL

Execution of the function block begins on a rising edge of this input.

IN

Type

ViBaseImageTypeEnum

Determines the image format in which the image data is provided.

IN

QualityLevel

USINT

JPG compression quality level. Ignored if Type = viBASE_IMAGE_TYPE_BMP. Valid range of values: 1 - 100.

IN

Timeout

TIME

Maximum time to execute the function block. No time limit is active for value 0. Negative values are not permitted.

IN

Buffer

UDINT

Pointer to a memory area to which the image data is copied.

IN

BufferSize

UDINT

Length of the specified data area (number of bytes to be copied). Must be at least 512 bytes.

OUT

Done

BOOL

Execution successful. The function block is finished.

OUT

Busy

BOOL

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

OUT

Active

BOOL

Indicates that data transfer of the image from the camera has started.

OUT

Error

BOOL

Error during execution.

OUT

StatusID

DINT

Status information.

OUT

BufferLen

UDINT

Number of bytes actually copied.

OUT

Nettime

DINT

NetTime when the image was taken.

Table: Inputs and outputs of function block ViBaseGetImage

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.

ViBaseImageTypeEnum

Enum constant

Value

Description

viBASE_IMAGE_TYPE_BMP

0

The image data is in uncompressed bitmap format.

viBASE_IMAGE_TYPE_JPG

1

The image data is in compressed JPEG format with loss of quality.

Table: ViBaseImageTypeEnum

Topics in this section:

Function description

Description of inputs and outputs

Status numbers