The productivity series of PLCs comes with 4 built-in communication ports for easy connectivity to your PC or various industrial networks. Serial protocols like Modbus RTU can be utilized with either the RS232 or RS485 ports on this PLC. Modbus RTU is an open (published) protocol that uses the Master / Slave architecture. It’s a very common protocol used in industrial automation controls.
We will be using the RS485 (2-wire) port to communicate to a Solo Process Temperature Controller. Modbus RTU will be the protocol used on this serial communication media. The PLC will be the master and the Solo process temperature controller will be the slave. You will soon see how the Productivity Series of PLC’s is the best way to handle communication to other devices. Let’s get started.
Previously in this Productivity 1000 series PLC we have discussed:
System Hardware – Video
Installing the Software – Video
Establishing Communication – Video
First Program – Video
Documenting the Program – Video
Monitoring and Testing the Program – Video
Online Editing and Debug Mode – Video
Numbering Systems and Tag Database – Video
Contact and Coil Instructions – Video
Timer Instructions – Video
Counter Instructions – Video
Math Instructions – Video
Data Handling Instructions Part 1 – Video
Data Handling Instructions Part 2 – Video
Array Functions Part 1 – Video
Array Functions Part 2 – Video
Array Functions Part 3 – Video
Program Control – Video
Drum Sequencer Instructions – Video
Data Logger – Video
Web Server – Video
Solo Process Temperature Controller Configuration – Modbus RTU
The first thing that we will do is set up the Solo Temperature Controller. Additional information can be found at the following link.
https://accautomation.ca/solo-process-temperature-controller/
Wiring diagram – Productivity 1000 to Solo – Serial RS485
The solo process temperature controller needs to be setup before we can communicate to it. The default setting is ‘Off’ for the On-Line Configuration. Here is the way to change into the different modes in the Solo.
In the Initial Setting Mode we will change the on line configuration to on and make the changes to the Modbus settings as follows: 9600 Baud, Even, 7 Data Bits, 1 Stop Bit, Modbus RTU Format. We will leave the default unit number as 1.
Our controller is now set to communicate.
Download the documentation and/or configuration and monitoring software at the following URL link:
https://support.automationdirect.com/products/solo.html
Solo Process Temperature Controller Manual
https://cdn.automationdirect.com/static/manuals/solocontrolm/solocontrolm.html
Productivity 1000 Modbus Overview
1 – microSD Slot
2 – Micro USB 2.0 Programming Port
3- RS232 Serial Port (RJ12)
4 – RS485 Serial Port (TB Style)
5 – 10/100 MB Ethernet Port
Modbus RTU will be the serial (RS485) method in which we will communicate between the Productivity 1000 PLC and the Automation Direct Solo Process Temperature Controller. This is a master / slave protocol. The master sends a request and the slave will respond to that request only. Here is an example of a RS485 Modbus RTU network.
We can address up to 247 (Solo 1 to 247) devices on this master – slave protocol. A maximum of 32 devices (Nodes) on the network can communicate to the master. A review of the Modbus RTU protocol can be seen at the following URL.
https://www.rtautomation.com/technologies/modbus-rtu/
Productivity 1000 Port Setup – Modbus RTU
The RS485 port must be set up the exact same as the port setup of the Solo Process Temperature Controller. Under the Setup in the Application Tools select Hardware Config.
Alternatively you can also use the main menu | Setup | Hardware Config.
The hardware configuration window will now be displayed. Double click on the CPU unit outlined in green.
This will bring up the P1-540 CPU model window. Select the Serial Ports tab along the top of the screen.
We will make our port settings match what we set on the Solo.
Protocol – Modbus RTU
Baud – 9600
Node Address – 1 – This is the same as the solo. Since this is the master the number can be the same.
Parity – Even
Data Bits – 8
Stop Bits – 1
Ensure that port security is set for Read/Write. Select OK after setting these parameters.
Click the x on the hardware configuration window. We are now finished setting the port of the PLC for communication.
Productivity 1000 PLC Program – Modbus RTU Serial Communication
We will be using the Modbus Read (MRX) and the Modbus Write (MWX) instruction for our Modbus RTU master program.
Modbus Read (MRX)
This instruction is broken down into three sections. The first is the instruction parameters.
Select the Serial Port – CPU485
Our slave node number for the Solo is 1.
We will use structure with a name of Modbus_Read. This will set up the corresponding addresses and bits to be used with this instruction.
The second part is the addressing and polling options. This makes the setting of the Modbus Master the easiest that I have seen. The Automatic Polling feature allows you to choose the rate at you desire to send messages without having to use a separate timer and enable logic. The Message Queue stages the messages from the ladder code to go out to each physical communications port without requiring interlocking logic. The longer the poll time can be, within tolerance of the application, the better the overall network performance. So for efficiency in programming and for the best possible performance for the system, conservative poll rates should be used when utilizing the Automatic Poll feature. There is also a Poll offset field in the communications instructions. This helps prevent the instructions from being queued all at the same time. When the CPU project starts, there is a master timer that begins. The ladder scan will look to see if the instruction is enabled. If it is enabled, it will begin the Automatic Poll timer at the specified poll offset value from the master time clock.
We will select automatic polling at 100 milliseconds. This means that all of the timing between all of the Modbus Read and Write commands will be automatically handled by the PLC firmware.
Our Slave Modbus Starting Address is 4097. Note that the +400000 is added based upon the Modbus Function Code selected.
We will be using Modbus Decimal Addressing.
The third part of the instruction is Tagname Mapping. This will specify where the information read is to be placed. We will create a Non-Array of 1 tag. Our Tag will be a 16 bit integer named Solo_PV. This will display the present value of our slave.
Here is our completed Modbus Read instruction.
Modbus Write (MWX)
This instruction is broken down into three sections. The first is the instruction parameters.
Select the Serial Port – CPU485
Our slave node number for the Solo is 1.
We will use a structure with the name of Modbus_Write. This will set up the corresponding addresses and bits to be used with this instruction.
The second part is addressing and polling options. Automatic Polling performs all of the sequencings for you so you do not have to write any logic.
We will select automatic polling at 100 milliseconds. This means that all of the timing between all of the Modbus Read and Write commands will be automatically handled by the PLC firmware.
Our Slave Modbus Starting Address is 4098. Note that the +400000 is added based upon the Modbus Function Code selected.
We will be using Modbus Decimal Addressing.
The third part of the instruction is Tagname Mapping. This will specify where the information read is to be placed. We will create a Non-Array of 1 tag. Our Tag will be a 16 bit integer named Solo_SV. This will write the value of this register into our slave.
Here is our completed Modbus Write instruction.
Additional Modbus Read (MRX) Instructions
Structure – Modbus_Read2
Automatic polling will also be set up for reading the following Solo parameters.
Input Range High – 16 bit register
Input Range Low – 16 bit register
Input Type – 16 bit register
Control Mode – 16 bit register
Heating Cooling – 16 bit register
Output 1 Period – 16 bit register
Output 2 Period – 16 bit register
Structure – Modbus_Read3
Proportional Band – 16 bit register
Integral Time – 16 bit register
Derivative Time – 16 bit register
Here is our completed program:
Note that the Modbus read and write instructions do not have any logic to enable them. They are enabled all of the time because the automatic polling will take care of the timing sequence for us.
Monitoring our Modbus RTU Communication
We can use the Data View to monitor all of the read tags and write tag to our Solo process temperature controller. You can call up the Data View from the Monitor & Debug under the Application Tools. Using the main menu | Tools | Data View or Ctrl + Shift + F3 will also bring up the Data View window.
We can change the SV of the Solo using our tag Solo_SV.
Calling the Graph View of the Data View will show us a graph of the variable that we select.
The legend colour of the graph can be changed by right clicking the variables monitored and select Change Color…
Download the PLC program here.
Watch the video below to see the running and configuration of the Modbus RTU Serial Communication from the Productivity 1000 Series PLC to the Solo Process Temperature Controller.
Productivity 1000 Series PLC from Automation Direct
Overview Link (Additional Information on the Unit)
Configuration (Configure and purchase a system – BOM)
User Manual and Inserts (Installation and Setup Guides)
Productivity Suite Programming Software (Free Download Link)
This software contains all of the instruction sets and help files for the Productivity Series.
Next time we will look at serial Modbus TCP Ethernet communication in the Productivity 1000 Series PLC.
Watch on YouTube : Productivity 1000 Series PLC Modbus RTU Serial Communication
If you have any questions or need further information please contact me.
Thank you,
Garry
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
To get this free article, subscribe to my free email newsletter.
Use the information to inform other people how numbering systems work. Sign up now.
The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.