Cookies are important for this site to function properly, to guarantee your safety, and to provide you with the best experience. By clicking OK, you accept all cookies. For more information, please access our Privacy Policy.
Table of Contents
Tutorials / 
An Introduction to Schneider’s PLC & HMI Simulation Using Machine Expert
Intermediate

An Introduction to Schneider’s PLC & HMI Simulation Using Machine Expert

Schneider Electric
PLC Programming
HMI Development

Introduction

Simulating PLCs and HMIs plays a crucial role in modern industrial automation. It offers engineers the ability to test and validate their control systems without the need for physical hardware, saving time and resources while ensuring reliability and safety. Simulation allows for thorough testing under various conditions, detecting errors early in the development process, and optimizing performance before deployment.

Schneider's Machine Expert is a comprehensive software suite designed to streamline PLC and HMI development. It provides a unified environment for configuring, programming, and simulating automation projects. Machine Expert simplifies the process of designing and testing control systems, offering a user-friendly interface and powerful simulation capabilities. 

In this tutorial, you will learn how to leverage the simulation tools in Schneider's Machine Expert to simulate PLC and HMI applications. We will start by exploring PLC simulation, covering activation, login, program loading, and variable monitoring. Then, we will delve into HMI simulation, configuring communication nodes, and executing the simulated HMI application. 

Prerequisites

To follow along with this tutorial, you will need an installation of Machine Expert.
Also, we advise you to go through the Schneider PLC programming and HMI programming tutorials to have a full grasp of this tutorial’s content.

Project presentation

We will build upon the previous project we created in the Schneider PLC & HMI programming tutorials. During these tutorials, we programmed a simple motor control PLC program and an HMI dashboard to interact with it. During this tutorial, we will explore the simulation tools that Machine Expert offers to try to run our PLC and HMI applications.

Let’s start by opening the Machine Expert project. You can notice that it contains a PLC section (Hardware and software configuration) and an HMI section.

Figure 1.1: Project presentation
Figure 1.1: Project presentation

Open the Application tree tab where we can find all the software components of the PLC/HMI programs. The PLC side consists of an FB (FB_Motor_Control) that contains the actual motor control application.

Figure 1.2: Motor control application.
Figure 1.2: Motor control application

This FB is called by the main program (SR_Main which is called by the MAST task). 

Figure 1.3: Main program
Figure 1.3: Main program

The used variables are defined in the GVL (Global Variable List). You can find more details about all the above in the Machine Expert overview tutorial and Schneider PLC programming tutorial.

Figure 1.4: GVL
Figure 1.4: GVL

PLC simulation

Now that we are familiar with the project we will use, let’s head to the PLC simulation first. Before anything, we need to activate the simulation.

Accessing the simulation

To activate the simulation, open the “Online” menu and click on “Simulation”

Figure 2.1: Starting the simulation
Figure 2.1: Starting the simulation

If you look at the bottom bar of the software, you will find that a red “Simulation” indicator has appeared which tells that the PLC simulation is active but we are still not connected to it. 

Figure 2.2: The simulation is on
Figure 2.2: The simulation is on

Logging into the simulated PLC

The simulated PLC behaves like an actual PLC connected to your PC. This means that we need to log in to it to access its content. To do this, open the “Online” menu and click on “Login.”

Figure 2.3: Logging into the simulated PLC
Figure 2.3: Logging into the simulated PLC

A first message will appear asking if you want to change the node address to “MachineExpert_Simulation.” Click on “Yes.”

Figure 2.4: Allowing the node address modification
Figure 2.4: Allowing the node address modification

After that, Machine Expert will attempt to load the PLC program to the simulated PLC. Another message will appear asking you if you want to load the actual program. Click on “Yes.”

Figure 2.5: Allowing the program loading
Figure 2.5: Allowing the program loading

After the loading process is done, we are now logged to the simulated PLC with the PLC program loaded into it. You can notice that many indicators have appeared in your interface; The Application name is now with a green background indicating that it is the online program; a “STOP” indicator appeared next to the “Simulation” indicator which displays the PLC’s state; and the values of the variables are now shown in the variable defining zone and in the programming zone.

Figure 2.6: Variables’ state indicator
Figure 2.6: Variables’ state indicator

Creating a watch table

Although the values of the variables are now displayed, we can make it way more practical by creating a watch table which will allow us to select the variables we want to monitor and organize them in a table. To do this, open the “View” menu, move to the “Watch” section, and click on “Watch 1.”

Figure 2.7: Creating a watch table
Figure 2.7: Creating a watch table

The watch table will appear in a separate section below the programming zone. 

Figure 2.8: The watch table appears
Figure 2.8: The watch table appears

Let’s add variables to the watch table. We will add the three variables defined in the GVL (Start_button, Stop_button, and Motor_state). First, click on the first row of the table. This will make a three-dotted button appear, click on it.

Figure 2.9: Adding variables to the watch table
Figure 2.9: Adding variables to the watch table

This will open an “Input Assistant” window where you can browse through all the data in your project/PLC.

Figure 2.10: Input assistant
Figure 2.10: Input assistant

The GVL variables can be found by opening the PLC_1/Application/GVL section. Once done, select the “Start_button” variable and click on “OK.”

Figure 2.11: Selecting the variable
Figure 2.11: Selecting the variable

You will see the variable appearing in the watch table.

Figure 2.12: The variable is added
Figure 2.12: The variable is added

Repeat the same operation to add the two missing variables (Stop_button and Motor_state).

Figure 2.13: Adding the remaining variables
Figure 2.13: Adding the remaining variables

Executing the program

We are set to execute the program and interact with it. The first thing we need to do is to turn the simulated PLC to “RUN” mode. To do this, click on the “Start” button. A message will appear asking you if you want to perform a start operation, click on “Yes.”

Figure 2.14: Turning the simulated PLC in RUN mode
Figure 2.14: Turning the simulated PLC in RUN mode

The red “STOP” indicator will turn into a green “RUN” indicator. This means that the PLC is running and it is executing the program.

Figure 2.15: The simulated PLC is running
Figure 2.15: The simulated PLC is running

Modifying the variables’ values

Since the program is being executed, we can monitor and modify the values of the variables through the watch table. Changing a variable’s value is a two-step operation: We need to select a prepared value and then write it to the PLC.

By default, all variables are initialized to 0 (False), let’s try setting the Start_button variable to 1 (True). In the watch table, click on the “Prepared value” section of the Start_button variable. This will display a “TRUE” indicator which means that this variable will be set to 1 upon writing.

Figure 2.16: Prepared value
Figure 2.16: Prepared value

Next, we need to write the prepared value into the PLC. To do this, open the “Debug” menu and click on “Write values.”

Figure 2.17: Write values
Figure 2.17: Write values

A message will appear asking you if you are sure to write the values, click on “Yes.”

Figure 2.18: Allowing the variables’ writing
Figure 2.18: Allowing the variables’ writing

The Start_button variable is now set to 1 and appears as “TRUE” in its “Value” section. Since this variable is used to control the motor, setting it to 1 will also turn the Motor_State variable to 1. 

Figure 2.19: The motor turns on
Figure 2.19: The motor turns on

Let’s try now to turn off the motor. For this, we need to set Start_button to 0 and Stop_button to 1. It is possible to prepare values for multiple variables and write them all at once. Prepare the “FALSE” value for the Start_button and the “TRUE” value for the Stop_button.

Figure 2.20: Prepared value
Figure 2.20: Prepared value

Then, same as earlier, write the values through the “Debug” menu or by pressing Ctrl+F7.

Figure 2.21: Writing values
Figure 2.21: Writing values

And as intended; Start_button becomes “FALSE,” Stop_button becomes “TRUE,” and Motor_State becomes “FALSE” which indicates that the motor has been turned off.

Figure 2.22: The motor is turned off
Figure 2.22: The motor is turned off

After that, we can simply turn the Stop_button back to “FALSE” using the same steps. 

Figure 2.23: Reseting all variables
Figure 2.23: Reseting all variables

Note: Be sure to keep the simulation active and the PLC in RUN mode during the HMI simulation section.

HMI simulation

Now that we covered the basics of PLC simulation, we can head to the HMI side. Let’s first open the HMI project. In Machine Expert, go to the Application tree and double-click on “Vijeo Designer Project Container” under the “Global” section.

Figure 3.1: Opening Vijeo Designer
Figure 3.1: Opening Vijeo Designer

This will open Vijeo Designer and display the HMI dashboard we created in the Schneider HMI programming tutorial. 

Figure 3.2: Vijeo Designer
Figure 3.2: Vijeo Designer

Configuring the nodes

Before we can execute anything, we need to configure the communication nodes to tell the HMI application that we need to connect to the simulated PLC.

In the Navigator, open the “I/O Manager” section and double-click on the HMI node (SOM_HMIG5UE_HMIDT952). This will open the node’s configuration window.

Figure 3.3: HMI node
Figure 3.3: HMI node

The HMI node must have a name for it to be able to connect to other devices. In the “Equipment Address or Node Name” section, type the node name of your choice. Here, we’ll be simply using the “HMI_node” name. Once done, click on “OK.”

Figure 3.4: Naming the HMI node
Figure 3.4: Naming the HMI node

After that, we need to do the same to the PLC node (SOM_PLC_1) but we cannot use any node name. We have to specify the name used by the simulated PLC. 

Go back to Machine Expert. Head to the Devices tree and double-click on the “PLC_1” section. This will display the PLC settings where you can find the node name we have to use (MachineExpert_Simulation).

Figure 3.5: PLC node name
Figure 3.5: PLC node name

Now, return to Vijeo Designer and open the PLC node settings (SOM_PLC_1).

Figure 3.6: PLC node
Figure 3.6: PLC node

Then, type the node name of the simulated PLC (MachineExpert_Simulation) in the “Equipment Address or Node Name” section. Once done, click on “OK.”

Figure 3.7: Naming the PLC node
Figure 3.7: Naming the PLC node

Running the simulated HMI

Everything is now set and ready to execute the HMI simulation. To run it, simply click on the “Start simulation” button. 

Figure 3.8: Starting the HMI simulation
Figure 3.8: Starting the HMI simulation

Wait for the program compilation and building to be done. The HMI application will start right after.

Figure 3.9: Loading
Figure 3.9: Loading

Once done, the HMI application will open in a new window. From here, we can interact with the dashboard which controls the PLC program. 

Let’s try interacting with the application. Click on the green “Start motor” button.

Figure 3.10: Simulated dashboard
Figure 3.10: Simulated dashboard

You should see the red lamp in the center turn green indicating that the motor has been turned on.

Figure 3.11: The motor turns on
Figure 3.11: The motor turns on

After that, click on the red “Stop motor” button. This should turn the lamp back to red indicating that the motor has been turned off.

Figure 3.12: The motor turns off
Figure 3.12: The motor turns off

Conclusion

In this tutorial, you learned how to effectively utilize simulation tools in Schneider's Machine Expert environment to simulate PLC and HMI applications. You acquired key skills such as activating and logging into PLC simulation, loading and monitoring program variables, and executing control logic. Additionally, you gained insights into configuring communication nodes, running HMI simulations, and interacting with HMI dashboards to control PLC operations. 

Implementing simulation in the Machine Expert environment proves to be both efficient and straightforward. Machine Expert offers a unified platform for PLC and HMI development, simplifying the process of designing, programming, and testing automation projects. Its intuitive interface, coupled with powerful simulation capabilities, enables engineers to simulate and validate control systems with ease. By providing a virtual environment to test and refine PLC and HMI applications, Machine Expert significantly reduces development time and costs while ensuring the reliability and performance of automation solutions. Overall, integrating simulation into the Machine Expert workflow enhances productivity and facilitates the creation of robust and efficient industrial automation systems.