Article translated with the assistance of AI tools. Images and parts of the content will still be reviewed.
In this tutorial you will learn the guidelines and procedures to simulate a simple logic and communicate
Components
Software: MasterTool IEC XE 3.34 ; MDBUS Simulator
PLC: XP340; Firmware: 1.11.10.0
Ethernet Cable
Tutorial Sections
1. ARCHITECTURE
2. DEVELOPMENT
2.1 Creating a new project in Mastertool
2.2 Add GVL
2.3 Add device
2.4 Modbus Configuration
2.5 MDBUS Configuration
2.6 MDBus Control Panel
3.0 VIDEO
1. ARCHITECTURE
2. DEVELOPMENT
We will monitor the variables communicating through the MDBUS software
2.1. Creating a new project in Mastertool
Create a new project by clicking on "New Project", enter the name and the folder path where you want to save it.
For this simulation with Mastertool and MDBus simulator, we will use the XP 340 and the programming language in LADDER; click next making sure all languages are set to ladder until "FINISH" appears and then the program will open
2.2. Add GVL
We will start by creating a list of global variables. To do this, right-click on Application >> Add objects >> Variable list. Name the list with the desired name, without spaces or special characters, then click "Add".
When the list opens on your screen, change the declaration type to text mode (1), then delete the parameter above VAR_GLOBAl (optional) if you want to use the global variable list throughout the project without having to declare the list name. Then declare the variables as shown in the image below.
2.3. Add device
Right-click on the word NET1, then click Add Device. A window will appear, click the "+" symbol to the left of the word MODBUS, then do the same as shown beside; double-click MODBUS symbol server
Close the device window; open the MODBUS Symbol Server tab and declare the variables that were declared in the GVL. (in the example beside, the parameter for calling the GVL variables was not deleted, so the GVL path had to be shown) Next, the inputs will be configured as in the ModBus configuration table on the next page
2.4. Modbus Configuration
Declare the same variables as in the GVL. The data type varies according to the function. We will use only read and write types. To select the data type, click the arrow. Variables of the same type must have different addresses, which must be identified in "Initial data address"
Finally, download the project to the PLC >> in Login click "yes" in the next dialog windows >> then set to run.
2.5. MDBUS Configuration
Open the ModBus simulator >> in the Configuration tab >> in Mode, the simulator will be Master since the PLC is the Server >> in IP Addr., enter the PLC's IP >> Set the IP port to 502 and communication to RTU TCP mode. In Database Points, in the Number column, you can set the number of outputs and inputs of each type to be simulated. After completing the configuration, click "OK"
In displays, select the types of variables we used in the MasterTool project (Coil and Holding Regs.). The displays will appear on the screen. Then set the simulator to ON
After setting the simulator to ON, click on Control. In this window, you will control the state of the variables. On the display screen, you will read the states of the variables.
2.6. MDBus Control Panel
3. VIDEO
Comments
0 comments
Please sign in to leave a comment.