产品转换用例

<< 点击显示目录 >>

主页  mappVision帮助助手 > 机器视觉帮助 > mapp Vision  > 编程 > > 核心库 > ViBase  > 用例 >

产品转换用例

功能块ViBaseLoadApplication可用于在运行时用另一个应用程序替换摄像机上的视觉应用程序。这只有在两个视觉应用程序兼容的情况下才能实现。

这种情况的一个用例是机器上的产品更换。为此,必须为机器上的每个产品创建和配置单独的视觉应用程序,而且它们必须相互兼容。

使用人机界面应用程序更换产品

在此扩展用例中,用户应能通过人机界面应用程序控制摄像机上的产品更换,并从列表中选择所需的视觉应用程序。这可以通过 mapp View 结合 mapp Vision 功能块ViBaseLoadApplicationViBaseListApplication 轻松实现。

下面几页将介绍配置这种示例人机界面应用程序的示例程序。这需要一个配置了 mapp Vision 的 AS 项目。

示例人机界面应用程序的要素和功能

示例人机界面应用程序包括以下主要功能元素:

1.可加载的现有视觉应用程序列表,包含一个选择选项。

2.按钮 "加载应用程序 "用于将选定的视觉应用程序加载到摄像机上。

3.按钮 "刷新列表 "用于初始填充或更新列表。)

4.按钮 "清除数据 "可将整个示例人机界面应用程序重置为初始状态。

此外,还有以下动态信息元素:

5.包含支持信息和使用说明的页眉。

6.可加载的视觉应用软件数量信息输出,如果视觉应用软件数量多于可列出的数量,则会发出警告。)

在下列情况下自动选择列表中第一个机器视觉应用程序条目:3)

点击 "刷新列表 "按钮。

点击 "加载应用程序 "按钮,从列表中加载选定的视觉应用程序。

显示弹出消息:

如果在初始填充或更新列表时发生错误。

如果在加载选定的视觉软件时发生错误。

单击 "加载应用程序 "按钮将当前选择的视觉应用程序成功加载到摄像机后。

这里描述了两种不同的实施方案,它们的区别在于使用哪种 mapp 视图部件来列出和选择视觉应用程序:

变体 A在部件表中列出视觉应用程序。

变体 B在部件 DropDownBox 中列出视觉应用程序。

pcuc_variantea_table

图带有 Widget Table 和选定主要元素的变体 A

pcuc_varianteb_dropdownbox

图:带 widget DropDownBox 和选定主要元素的变体 B

使用下一节中的说明实现两个变体中的一个并将其传输到控制器后,可通过以下 URL 启动示例人机界面应用程序:

[PLC IP]:81/index.html?visuid=ProductChangeOverUseCase。

 

HMI 应用程序不能与 mapp Vision HMI 应用程序同时使用:

初始填写列表、

更新列表、

加载选定的视觉应用程序

只要相关摄像机上的mapp Vision HMI 会话尚未完全结束,就无法执行这些操作。

这将通过数据点CameraStatus 上的 MAPPVISION_HMI_ACTIVE 位丢失来表示。

本节主题:

创建人机界面应用程序

创建程序

动态设计人机界面应用程序

 

1) 如果在此期间发生以下情况,尤其需要/建议刷新列表:

- 在 AS 中新配置了兼容的视觉应用程序并将其传输到控制器。

- 从 AS 项目中再次删除了兼容的视觉程序,或对其进行了不兼容的修改并将其传输到控制器。

- 在 mapp Vision HMI 应用程序中新建了兼容的视觉应用程序,或再次删除了现有应用程序。

- 使用功能块 ViBaseLoadApplication 可独立于示例 HMI 应用程序更改视觉应用程序。

2) 所描述的示例人机界面应用程序最多可显示 10 个视觉应用程序。

不过,只需稍加努力,就可以调整配置以显示更多条目。

另外,在 mapp Vision HMI 应用程序中删除视觉应用程序也有帮助。

3) ViBaseListApplication 生成的列表将当前在相关视觉组件中设置为引用的视觉应用程序(也称为 "活动视觉应用程序 "或 "机器视觉应用程序")作为第一个条目。


Function block ViBaseLoadApplication can be used to replace the vision application on a camera with another application at runtime. This is only possible if the two vision applications are compatible.

A use case for this would be a product changeover on a machine. To do this, an individual vision application must be created and configured for every product on that machine, and they must all be compatible with each other.

Product change with HMI application

In this extended use case, the user should be able to control the product change on a camera via HMI application and to select the desired vision application from a list. This can be easily implemented with mapp View in combination with mapp Vision function blocks ViBaseLoadApplication and ViBaseListApplication.

An example procedure for configuring such a sample HMI application is described on the following pages. This requires an Automation Studio project configured with mapp Vision.

Elements and features of the sample HMI application

The sample HMI application consists of the following main functional elements:

1.A list of existing, loadable vision applications with a selection option.

2.Button "Load application" to load the selected vision application onto the camera.

3.Button "Refresh list" to initially fill or update the list.1)

4.Button "Clear data" to reset the entire sample HMI application to its initial state.

In addition, there are the following dynamic, informative elements:

5.Header with supporting information and instructions for use.

6.Information output with the number of loadable vision applications as well as a warning if there are more vision applications than can be listed.2)

Automatic selection of the first list entry with the machine vision application after the following:3)

Clicking on button "Refresh list".

Loading the selected vision application from the list by clicking button "Load application".

Pop-up messages are displayed:

If an error occurs during initial filling or updating the list.

If an error occurs while loading the selected vision application.

After the currently selected vision application has been successfully loaded onto the camera by clicking button "Load application".

Two implementation variants are described that differ in which mapp View widget is used to list and select the vision application:

Variant A lists the vision applications in widget Table.

Variant B lists the vision applications in widget DropDownBox.

pcuc_variantea_table

Fig.: Variant A with widget Table and selected main elements

pcuc_varianteb_dropdownbox

Fig.: Variant B with widget DropDownBox and selected main elements

After implementing one of the two variants using the descriptions in the next sections and transferring it to the controller, the sample HMI application can be launched in the following URL:

[PLC IP]:81/index.html?visuid=ProductChangeOverUseCase.

 

The HMI application cannot be actively used at the same time as the mapp Vision HMI application:

Initial filling of the list,

Updating the list,

Loading the selected vision application

are not possible as long as a mapp Vision HMI session on the associated camera has not been fully completed.

This is indicated by the dropping of bit MAPPVISION_HMI_ACTIVE on data point CameraStatus.

Topics in this section:

Creating an HMI application

Creating a program

Designing the HMI application dynamically

 

1) Refreshing the list is especially necessary/recommendable if the following takes place in the meantime:

- Compatible vision applications were newly configured in Automation Studio and transferred to the controller.

- Compatible vision applications were deleted again from the Automation Studio project or incompatibly modified and transferred to the controller.

- Compatible vision applications were newly created in the mapp Vision HMI application, or existing ones were deleted again.

- The vision application was changed independently of the sample HMI application using function block ViBaseLoadApplication.

2) The described sample HMI application is configured to display a maximum of ten vision applications.

The configuration can be adjusted for more entries with little effort, however.

Alternatively, removing vision applications in the mapp Vision HMI application can help.

3) ViBaseListApplication generates the list with the vision application currently set as a reference in the associated vision component (also referred to as "active vision application" or "machine vision application") as the first entry.