In this tutorial, you will learn the guidelines and procedures to communicate the PH3500 with the XP340 using the ModBus RTU protocol.
Components
Software: MasterTool IEC XE 3.40 ;
PLC: XP340 - Firmware: 1.11.10.0
Multimeter: PH3500
Cable: AMJG0808
Tutorial Sections
1. ARCHITECTURE
2. DEVELOPMENT
2.1 Operating Architecture of the PH3500
2.2 ModBus RTU Protocol Configuration on the PH3500
2.3 Tag Configuration
2.4 Creating a New Project in Mastertool
2.5 Add GVL
2.6 Add Device
2.7 ModBus RTU Configuration
2.8 Application in Operation
3. Video
1. ARCHITECTURE
2. DEVELOPMENT
2.1. Operating Architecture of the PH3500
Below are the main points to be connected in order to have an effective architecture.
2.2. ModBus RTU Protocol Configuration on the PH3500
Step 1: Press the button with the rotating arrow to enable the main menu with the options, one of which is "settings";
Step 2: Keep pressing the button with the upward arrow until the selector on the display points to the “CFG” option, that is, settings;
Step 3: Press the enter button to access the settings menu.
Step 4: Keep pressing the button with the upward arrow until the selector on the display points to the “COM” option, that is, communication;
Step 5: Press the enter button to access the communication menu.
Step 6: After these procedures, observe the information about address, format, and swap.
Notes:
- Short format corresponds to having 16-bit variables;
- Swap none corresponds to the function of inverting bytes or words
Step 7: After checking the ModBus parameters, press the down arrow button so you can configure the Serial port parameters;
Step 8: To edit, just press the enter button and then set the parameters as necessary for the application using the two buttons as shown in the second image above;
Step 9: After these procedures, just press the enter button twice for the changed information to be saved.
Notes:
Baud or Baud rate is the speed at which the information will be transmitted, that is, it is the transmission rate of the communication;
Communication data format;
2.3. Tag Configuration
According to the PH3500 multimeter user manual, in the instant measurements section you can see all the variable configuration parameters.
In this application, we will use the short address column as a reference since in step 5 the variable format was set.
Note: in this meter, we can see that the addresses start from 0, while in Xpress and Nexto they start from 1. Therefore, every time you select an address, you must add “1” so that it is correctly enabled in MasterTool.
2.4. 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 PH3500, we will use the XP 340 and the programming language in LADDER; click next making sure all languages are in ladder until "FINISH" appears and then the program will open.
2.5. 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 (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). And declare the variables as shown in the image beside. We will use 4 boolean variables.
2.6. Add Device
The next step will be to configure the serial port parameters in MasterTool. It is worth noting that the values to be set are those adopted on the Multimeter. In this example, we can see the values for baud rate, data bits, etc.
To establish communication, you must create a communication channel and add a device; in this case, we will use the PLC as Master/Client/Master under the ModBus RTU protocol.
A device must be added; in this case, we will use the PLC as Master/Client/Master under the ModBus RTU protocol.
2.7. ModBus RTU Configuration
After adding the device, you must insert the variables and then parameterize them according to the ModBus protocol.
Continuing the parameterization of the variables according to the application, in this example we used the information contained in the PH3500 user manual and obtained the following information, which we used to configure the PLC device.
NOTE: Each data type varies according to the needs of your application as well as its address.
The next step is to create the permissions for my data, in this case it will be done for reading Input Register
In this field, some data must be configured, where the most important is the slave address of our Multimeter and as seen in steps 5 and 6, it has address number 3.
Go to the easy connection icon and wait for it to read and scan the devices on the network. After this step, the PLC logs into the network.
After logging in to the PLC, you can already observe the reading of the variables.
3. VIDEO
Comments
0 comments
Please sign in to leave a comment.