Example 6: MM_S6_Vis_Timer

You are currently viewing the documentation for the latest version (2.1.0). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

Program Introduction

Description

The PLC calculates the vision cycle time, which is the time it takes to trigger the Mech-Vision project to run and obtain the vision result.

File path

You can navigate to the installation directory of Mech-Vision and Mech-Viz and find the file by using the Communication Component/Robot_Interface/EthernetIP/Programming Samples/AB PLC EthernetIP/sample applications/ExportedRoutineOfSampleProjects/MM_S6_Vis_Timer.L5X path.

Project

Mech-Vision project

Prerequisites

This example program is provided for reference only. Before using the program, please modify the program according to the actual scenario.

Program Description

This part describes the MM_S6_Vis_Timer example program.

The only difference between the MM_S6_Vis_Timer example program and the MM_S1_Vis_Basic example program is that MM_S6_Vis_Timer can calculate the vision cycle time (Rung 7 to 9). As such, only the feature of switching the parameter recipe is described in the following section. For information about the parts of MM_S4_Vis_SwitchRecipe that are consistent with those of MM_S1_Vis_Basic, see Example Program 1: MM_S1_Vis_Basic.
sample6 1
sample6 2
sample6 3
sample6 4
sample6 5
sample6 6
sample6 7
sample6 8
sample6 9
sample6 10

In the above example program, the feature of calculating the vision cycle time is shown in the figure below.

sample6 11

The table below illustrates the process of calculating the vision cycle time.

For common functions that come with AB PLC, please refer to Common Functions.

Feature Description

Calculate vision cycle time

sample6 8
sample6 9

Rung 7 and 8 indicate that the delay timers (pulse_10ms_1 and pulse_10ms_2) are connected by using two TONs, and a 10 ms pulse width (pulse_10ms_1.DN) is generated. Therefore, the rising edge period of pulse_10ms_1.DN is 20 ms (10 × 2).

sample6 10

Rung 9: Calculate the amount of time (i.e. vision cycle time) for Camera_Pose_Ready to change from 0 (the external image-capturing signal has been triggered) to 1 (the PLC has obtained the vision result). The amount of time is calculated in 20 ms increments based on the Time_Used value.

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.