The BRX Do-More PLC can communicate to a remote I/O (input and output) controller modules using the Modbus protocol for communications. The BX-MBIO provides both Modbus RTU and Modbus TCP interfaces. Modbus RTU is a serial communication and Modbus TCP is an Ethernet communication. Modbus RTU is supported over an RS-485 serial connection. Modbus TCP is supported over an Ethernet connection. They function as listening/replying devices (slave, server) and can connect with any mastering (master, client) device that communicates using the Modbus protocol.
Previously we looked at the BX-MBIO Modbus RTU TCP Remote IO Controller wiring and configuration.
Modbus RTU TCP Remote IO Controller BX-MBIO
– BX-MBIO Hardware Video
– BX-MBIO Powering and Configuring Video
We will connect the BRX Do-More PLC to the Modbus remote IO. This will be done using the Modbus TCP and Modbus RTU protocol. Ethernet and serial RS485 communication to the BX-MBIO unit will be the media.
The BX-MBIO remote I/O expansion units feature the following:
• RJ45 Ethernet port for communications via Modbus TCP
• RS485 serial port for communications via Modbus RTU
• Supports up to 8 additional Expansion Modules (Add the discrete or analog I/O you require)
• AC and DC powered units available
• AC powered units include an integral 24VDC auxiliary output power supply
• Power connector and serial port connector included
Let’s get started.
Previously in this BRX series PLC, we have discussed:
System Hardware – Video
Unboxing – Video
Installing the Software – Video
Establishing Communication – Video
Firmware Update – Video
Numbering Systems and Addressing – Video
First Program – Video
Monitoring and Testing the Program – Video
Online Editing and Debug Mode – Video
Timers – Video
Counters – Video
High-Speed IO – Video
Compare Instructions – Video
Math Instructions – Video
Program Control – Video
Shifting Instructions – Video
Drum Instruction – Video
Serial Communication – Modbus RTU to Solo Process Temperature Controller – Video
Data Logging – Video
Email – Text SMS Messaging Gmail – Video
Secure Email Communication Video
AdvancedHMI Communication – Modbus TCP – Video
Analog IO – System Configuration – Video
HTTP JSON Instructions – Video
Analog Dusk to Dawn Program – Video
INC DEC 512 Registers for DMX512 – Video
PID with PWM Output – Video
PID Ramp Soak Profile – Video
Do-More Simulator MQTT Publish / Subscribe – Video
BRX Do-More PLC MQTT Communications – Video
Stride Field Remote IO Modules Modbus TCP Ethernet
– Unboxing SIO MB12CDR and SIO MB04ADS Video
– Powering and Configuring Video
BRX Do-More PLC to Stride Field IO Modbus TCP – Video
BRX Do-More PLC Ethernet Remote IO Controller BX-DMIO
– Unboxing BX-DMIO Video
– Configuration and Programming Video
Modbus RTU TCP Remote IO Controller BX-MBIO
– Hardware Video
– Powering and Configuring Video
Our entire series can be found here.
https://accautomation.ca/series/brx-do-more-plc/
The programming software and manuals can be downloaded from the Automation Direct website free of charge.
Watch the video below to see the BRX Do-More PLC control analog and digital inputs and outputs remotely via BX-MBIO.
BRX Do-More PLC System Modbus TCP Setup – Client (Master)
Our BRX plc will act as the Modbus Client (Master). It will communicate to the BX-MBIO remote I/O which are Modbus Servers (Slaves).
Call up the COM Port Setup window by using the main menu | PLC | System Configuration… Alternatively you can select System Configuration from the Tools menu in the Project Browser.
Select the CPU Configuration on the left-hand side.
You will see the Internal Ethernet Port Configuration. Select the Configure… button to configure the IP addresses of the Ethernet port. (See picture below.)
Select enable for the Modbus/TCP server. We will leave the maximum concurrent sessions, client inactivity timeout and TCP port number as their default values.
Here is our IP address for the BRX PLC Ethernet port. Our do-more PLC is now ready to be a Modbus TCP Client (Master).
BRX Do-More PLC System Modbus RTU Setup – Master (Client)
In the system configuration window under the CPU configuration, you will see the selections for serial port configuration. Select Modbus RTU Client under the protocol. Under the port types, select RS485 and enable 120-ohm termination.
Select the change @IntSerModbusClient Device Settings… button.
The edit modbus RTU client settings window will be displayed. We will leave the communication parameters as default.
Note: The port settings (baud rate, data bits, stop bits, parity, etc.) must match the settings on the BX-MBIO remote IO unit.
The do-more PLC is now ready to be a Modbus RTU Client (Master).
BX-MBIO Modbus Server (Slave) Setup Address and Parameters
Previously we used NetEdit3 and a web browser to configure our modbus remote input and output unit. See the links above.
Start NetEdit3 by selecting it from the Applications section of the Launchpad on our Do-More Designer software.
Select the BX-MBIO module from the list that was scanned and then select the MBIO Settings tab at the bottom.
Select the General… button.
Here is the IP address for our unit.
Select the Serial Port… button.
Here are the port settings for the modbus remote IO unit. This must match the settings on the BRX PLC that we set above.
BX-MBIO Modbus Addresses
Using the web-based configuration from the NetEdit3 software we can call up the main menu. This can be done also by entering the IP address of the MBIO unit in your web browser software.
Select display modbus I/O mapping. This will show us the Modbus addresses that we will need to program our PLC.
This table will now be used to program our BRX PLC.
Analog Input Tester
Using the voltage input tester that we created previously, we will be wiring this up to the first voltage input on the BX-08AD-2B unit.
Create an Analog Voltage Input Tester for a PLC – Video
BRX Do-More PLC Program
Our sample program has a Main program that will do the overall logic. It will call up two programs that will handle the communications to the BX-MBIO unit.
– Modbus_RTU_MBIO(Communicate_RTU) – Modbus RTU via Serial RS485
– Modbus_TCP_MBIO(Communicate_TCP) – Modbus TCP via Ethernet RJ45
Main Program
The main program will call the communication programs and handle the main logic.
The first rung of the program will call the program Modbus_TCP_MBIO.
The second rung of the program will call the program Modbus_RTU_MBIO.
Rung 3 and 4 will set up timers based on the analog input signal coming from the remote Modbus input and output unit.
If timer 0 is done, rung 5 will compare the analog input to a value of 100. This is to ensure that the analog timer will not chatter the output if the value becomes too low. The first discrete output relay is then turned on. We have included both the settings for Modbus TCP and RTU because both of our communication methods have control over the output. (This is done for demonstration purposes. Normally you would use either Modbus TCP or RTU and not both.)
Modbus_TCP_MBIO
Modbus TCP Communication to BX-MBIO
Address Assignments:
V0 to V7 – Analog Input Remote Rack
V10 to V17 – Analog Output Remote Rack
C500 to C503 – Discrete Input signals Remote Rack
V20:0 to V20:4 – Discrete Output signals Remote Rack
V30 – V31 – Remote Rack Errors
The above Modbus address list is where the BX-MBIO errors are located. Writing a 0 into these addresses will clear the error. Link Monitor Timeout is used to determine the amount of time between Modbus transmissions before the BX-MBIO displays an error.
Upon the first scan of the PLC or the detection of a remote I/O error, reset the error on the remote I/O rack. This is done using the Modbus Network Write instruction. C1 and C2 are used to trigger the next communication from this one. This will keep our timing synchronized.
Set the link monitor timeout for 3 seconds.
This is what it will look like when a link monitor timeout occurs.
Read the analog inputs on the Modbus remote I/O unit.
Write the analog outputs on the Modbus remote I/O unit.
Read the discrete inputs on the Modbus remote I/O unit.
Write the discrete outputs on the Modbus remote I/O unit.
Read the Modbus remote input and output rack unit errors.
If there are no errors then turn on C15 which will then trigger reading the analog inputs again.
If an error is read, then turn on C16 with will then reset the errors. This is at the beginning of the program routine.
Modbus_RTU_MBIO
Modbus RTU Communication to BX-MBIO
Address Assignments:
V100 to V107 – Analog Input Remote Rack
V110 to V117 – Analog Output Remote Rack
C600 to C603 – Discrete Input signals Remote Rack
V120:0 to V120:4 – Discrete Output signals Remote Rack
V130 – V131 – Remote Rack Errors
The Modbus RTU program is identical to the TCP program to get the information. The addresses used are offset by 100 in most cases. Normally you would program one or the other Modbus method.
Upon the first scan of the PLC or the detection of a remote I/O error, reset the error on the remote I/O rack. This is done using the Modbus Network Write instruction. C101 and C102 are used to trigger the next communication from this one. This will keep our timing synchronized.
Set the link monitor timeout for 3 seconds.
This is what it will look like when a link monitor timeout occurs.
Read the analog inputs on the Modbus remote I/O unit.
Write the analog outputs on the Modbus remote I/O unit.
Read the discrete inputs on the Modbus remote I/O unit.
Write the discrete outputs on the Modbus remote I/O unit.
Read the Modbus remote input and output rack unit errors.
If there are no errors then turn on C115 which will then trigger reading the analog inputs again.
If an error is read, then turn on C116 with will then reset the errors. This is at the beginning of the program routine.
Watch the videos below to see the running of the BRX PLC program to communicate to our BX-MBIO Modbus remote I/O unit.
Download the BRX D0-More PLC program here.
BRX Series PLC from Automation Direct – Power to deliver
Overview Link (Configure and purchase a system)
Manuals and Product Inserts (Installation and Setup Instruction)
Do-More Designer Software v2.7.4 (Free Download Link) – The software will contain all of the instruction sets and help files for the BRX Series PLC.
BX-MBIO
Product Insert
Specifications
NetEdit3 is automatically installed as part of both Do-More Designer and DirectSOFT PLC programming packages.
Modbus Learning Links:
Simply Modbus Frequently Asked Questions
Modbus TCP/IP Overview – Real-Time Automation
All You Need to Know About Modbus RTU – Video
Watch on YouTube: BRX Do-More PLC to Modbus TCP RTU Remote IO Controller BX-MBIO
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.