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 find the program file by using the Communication Component/Robot_Interface/Siemens Snap7/TIA Portal/sample applications/SampleProjectSnap7.zip path in the installation directory of Mech-Vision and Mech-Viz.

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 (Network 7). As such, only the feature of calculating the vision cycle time is described in the following part. For information about the parts of MM_S6_Vis_Timer that are consistent with those of MM_S1_Vis_Basic, see Example Program 1: MM_S1_Vis_Basic.
sample1 1
sample1 2
sample1 3
sample6 4
sample1 5
sample1 6
sample6 7

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

sample6 8

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

For common functions that come with Siemens S7 Series PLC, see Common Functions.

Feature Description

Calculate the vision cycle time

sample6 7

Network 7 indicates that timers are used to calculate the vision cycle time. The following section describes the details.

  • 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.Q) is generated. As such, the rising edge period of pulse_10ms_1.Q is 20 ms (10 × 2).

  • The amount of time it takes (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) 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.