In this tutorial you will learn the guidelines and procedures to simulate a simple logic and communicate
Components
Software: MasterTool IEC XE 3.34; Kepware Version 6.10
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 Kepware Configuration
3. VIDEO
1. ARCHITECTURE
2. DEVELOPMENT
We will monitor the variables communicating through the Kepware 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 Kepware, we will use XP 340 and the programming language will be 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 as you wish, without spaces or special characters, then click "Add".
When the list opens on your screen, change the declaration type to text mode, 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
Click on the word NET1 with the right mouse button, then click on Add Device. A window will appear, click on the "+" symbol to the left of the word MODBUS, then do the same as shown; double click on 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, the GVL variable call parameter was not deleted, so the GVL path had to be shown). Then the entries will be configured as per the Modbus configuration table on the next page.
2.4. Modbus Configuration
Declare the same variables that were in the GVL. The data type varies according to the function. We will use only the read and write types. To select the data type, click the arrow. Variables of the same type must have different addresses, which should 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 Kepware Configuration
Open the Kepware simulator as administrator; then, in the simulator's project tree, right-click on Connectivity and add a new channel in "New Channel".
In the window that opens, you will select the protocol. We will use ModBus TCP/IP Ethernet, then click next; in the next window name the channel if necessary.
After naming the channel, click next twice. When you reach the window as shown, click on "..." and select Realtek. Click OK to select the adapter used. Finally, click Next until the add channel window closes and you return to the main screen.
Click on "Click to add device" to add a device within the created channel, if necessary you can name the device (in the example it was named XP340). Then click Next, make sure the ModBus model is selected and click Next again.
In the next window, you will need to enter the PLC's IP address and station. The IP address must be entered using dots. Then click Next until the window closes.
Note: The PLC's IP address can be found through MasterTool, in Easy Connection
Next, we will add the tags by selecting the device >> Click to add a static tag >> enter the tag name and the same address used in MasterTool, then click OK to add the tag. Then right-click to insert more tags.
After all tags have been entered, click the Quick Client icon and the tag control window will open.
In the Quick Client window, select the option Modbus.device_name, in this option the tags that were added will appear.
Select the Tag with the right mouse button, then click on Synchronous Write. Enter the value you want to send to the tag and click OK. This process is the same for all tags.
Note: The lamp was declared as input status (read variable) therefore we cannot write to it through the simulator, only through MasterTool
Split the screen between Quick Client and MasterTool to be able to see the change in the state of the variables.
3. VIDEO
Comments
0 comments
Please sign in to leave a comment.