TBox RTU Configuration with Modbus

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

When was Modbus originally published?

  • 1979 (correct)
  • 1990
  • 1985
  • 1970

What is the typical application of Modbus?

  • Automotive diagnostics
  • Aerospace communications
  • Industrial automation (correct)
  • Consumer electronics

What protocols are embedded in TBox?

  • ASCII only
  • RTU only
  • TCP only
  • RTU, TCP and ASCII (correct)

What is the station address range for Modbus?

<p>1 to 254 (D)</p> Signup and view all the answers

What is the broadcast address for Modbus?

<p>0 (B)</p> Signup and view all the answers

When using address 255, what response will occur?

<p>Normal reply from the slave (D)</p> Signup and view all the answers

What is the default TCP port used when TBox RTU is configured as a Modbus TCP slave?

<p>502 (B)</p> Signup and view all the answers

How is 'Modbus Address' defined?

<p>Addressing of data points in Modbus (B)</p> Signup and view all the answers

What is the bit range of a standard Modbus address?

<p>16 bits (D)</p> Signup and view all the answers

What is the numeric range of a Modbus address?

<p>0..65535 (A)</p> Signup and view all the answers

In TBox, how are data points presented?

<p>Tags (B)</p> Signup and view all the answers

What should be checked in RTU Properties for Modbus TCP?

<p>TCP port (B)</p> Signup and view all the answers

If using Modbus over serial ports, what configuration parameters should be checked to suit the master device?

<p>Type, Baudrate, Data bits, Parity, Stop bits, Protocol (D)</p> Signup and view all the answers

What is the maximum number of Modbus TCP slaves that can be handled in parallel on IP communication?

<p>64 (D)</p> Signup and view all the answers

What controls when Modbus transactions occur on a Modbus device?

<p>Configurable Trigger (C)</p> Signup and view all the answers

Which trigger will execute all Modbus transactions of this Modbus device one time when the trigger changes from 0 to 1?

<p>Positive edge (C)</p> Signup and view all the answers

Which trigger will execute all Modbus transactions of this Modbus device continually while a trigger is active?

<p>High state (B)</p> Signup and view all the answers

What is the purpose of the 'Packet reception delay' setting?

<p>Maximum time to wait for a complete packet from the slave (A)</p> Signup and view all the answers

What type of connection is RS232?

<p>Point-to-point connection (C)</p> Signup and view all the answers

What setting is recommended to increase data throughput and save bandwidth of TCP/IP networks?

<p>Keep socket open (D)</p> Signup and view all the answers

Flashcards

What is Modbus?

A communication protocol used in industrial automation for transferring data. It's efficient, robust and easy to configure.

Modbus slave functionality in TBox RTU

A built-in feature of TBox RTU that allows communication via Modbus RTU (serial ports) or Modbus TCP (Ethernet ports) without special configuration.

Modbus Station Address

The identification of each Modbus slave in a network, ranging from 1 to 254. Address 0 is a broadcast address, and address 255 is typically used in Modbus-TCP protocol.

Modbus TCP Port

When TBox RTU is configured as a Modbus TCP slave, it acts as a TCP server listening on the default port 502 for incoming TCP connections from the Modbus TCP master (client).

Signup and view all the flashcards

Modbus Address

Means the addressing of data points in Modbus protocol. It can be coded in 16 bits, allowing numbers between 0 and 65535. Can be identical for digital and analog tags.

Signup and view all the flashcards

Modbus Device

A device is a physical module connected to the TBox RTU via serial or Ethernet connection. They are treated as I/O and managed in the Resources category of the project.

Signup and view all the flashcards

Modbus Transaction

In TBox Modbus configuration, one specific communication that a Master will execute as per one ‘Modbus Device'.

Signup and view all the flashcards

Modbus Device Trigger

Is key to controlling Modbus polling. Mapped to a tag to control the execution of Modbus transactions. Can be positive edge, negative edge, high state, or low state.

Signup and view all the flashcards

Packet Reception Delay

The maximum time the master waits for a complete packet from the slave, useful for low-speed serial communication.

Signup and view all the flashcards

Inter Frame Gap (IFG)

The time the master RTU must wait before sending the next Modbus query to the slave device. Required for some external devices to switch between transmitting and receiving.

Signup and view all the flashcards

Rx Timeout

The longest time that the master RTU waits for a response from a slave. An error is indicated if no response is received within this time.

Signup and view all the flashcards

Keep Socket Open

Enabling this is recommended in Modbus TCP master configurations to increase data throughput and save TCP/IP network bandwidth. Keeps the socket open for 30s of inactivity.

Signup and view all the flashcards

Enable Advanced Modbus Mapping

With this option checked, TBox RTU will fill non-existent addresses with 0 instead of returning an exception code, useful in certain circumstances with some Modbus master devices.

Signup and view all the flashcards

Study Notes

Overview

  • Modbus is a communication protocol created by Modicon in 1979, now Schneider Electric
  • Modbus is used for industrial automation applications because it transfers data efficiently
  • The application note provides a generic workflow for configuring TBox RTU with Modbus slave and master functionalities
  • Methodologies apply to all TBox RTU models, using TBox MS as an example

Modbus Slave

  • All Modbus protocols (RTU, TCP, ASCII) exist within TBox
  • Modbus slave is a built-in functionality of the TBox RTU
  • Communication to TBox RTU is possible via Modbus RTU (on serial ports) and Modbus TCP (on Ethernet ports) without configuration
  • TWinSoft communicates with TBox in Modbus without any configuration

Station Address

  • The 'Station Address' identifies each Modbus slave on the network (serial or TCP/IP)
  • Each Modbus slave must have a unique station address in a multi-drop network
  • The range of Modbus station addresses is 1 to 254
  • Address 0 is the broadcast address which receives no answer from the slave
  • Address 255 gives a normal reply, from any address, and is used in Modbus-TCP protocol
  • The station address of TBox RTU is configured in the RTU Properties window

TCP Port

  • TBox RTU acts as a TCP server listening for incoming TCP connections on port 502 from the TCP client (Modbus TCP master) when configured as a Modbus TCP slave over a TCP/IP network.
  • The port number can be changed via RTU Properties->Advanced
  • A global reset will restore the default Modbus TCP slave port to 502

Modbus Address

  • 'Modbus Address' refers to the addressing of data points in the Modbus protocol
  • Data points are presented as tags within TBox
  • When a new tag is created, a specific Modbus Address can be assigned to the data point on the tag properties window
  • The default assigned Modbus address can also be used for each created tag to prevent duplicated Modbus addresses
  • Modbus addresses use 16 bits, enabling numbers between 0 and 65535
  • Modbus addresses can be identical for digital and analog tags because the protocol uses different functions for access
  • A 32-bit variable uses 2 x Modbus addresses

Configuration Procedure

  • Since Modbus slave is built into TBox, there is nothing to configure
  • Still, the way TBox is configured needs to be known to access it
  • Check the 'Station Address' in RTU Properties
  • If Modbus TCP is used, check the TCP port in RTU Properties->Advanced->Ports page
  • With serial ports, check the configuration Type (RS232/485), Baudrate, Data bits, Parity, Stop bits, and Protocol (Modbus RTU/Modbus ASCII)
  • Establish the connection between the master device and TBox via Ethernet or serial
  • Use TBox Modbus simulators for testing or troubleshooting

Modbus Master

  • Modbus master does not assign any dedicated station address
  • Any device can be a master device on a serial Modbus bus with strictly one master device
  • When Modbus protocol extends to TCP/IP network, the IP address identifies each device
  • To access a slave, the station address used can be 255
  • If Modbus routing to access a device behind TBox is required, the real station address must be addressed

Modbus Device

  • External Modbus slave devices are treated as I/O when TBox RTU is a Modbus master
  • I/O is managed in the Resources category
  • A Modbus Device is a physical module connected to the TBox RTU via serial or Ethernet connection
  • Add a Modbus slave device by selecting Resources->I/O, right clicking Add an I/O Card and selecting Modbus Device

Modbus Transactions

  • In TBox Modbus configuration, one 'Modbus Transaction' means one specific communication that TBox RTU (as Modbus master) will execute as per one ‘Modbus Device’
  • A Modbus Device can be configured with multiple Modbus Transactions
  • TBox RTU executes communications sequentially (one after each other) to this Modbus Device
  • Communications can read or write one or more data points from or to the Modbus device, either digital or analog
  • Multiple, successive Modbus addresses can be read/write in one transaction
  • To add a Modbus transaction, select Modbus Transactions, and double click Add a Modbus Transaction

Polling Management Principles

  • Modbus communication is processed on different communication ports (RS232, RS485, Ethernet) simultaneously
  • Only one Modbus transaction is under process at a time on a serial port
  • On IP communication (Ethernet, GPRS, 3G, 4G), up to 64 Modbus TCP slaves can be handled in parallel, with transactions on each device carried out sequentially
  • Modbus transactions of a Modbus device are completed sequentially, since Modbus is designed as a half-duplex protocol
  • The configurable trigger controls the start/stop of the external Modbus device

Trigger

  • The trigger of Modbus Device controls the Modbus polling
  • The trigger is mapped to a tag so the polling is controlled by the value of the trigger tag
  • The tag assignment is found in the dialog of Modbus Device configuration
  • Methods to use the trigger include positive edge: all Modbus transactions of the Modbus device are executed once when Trigger changes from 0 to 1.
  • Negative edge: all Modbus transactions of this remote device are executed once when Trigger changes from 1 to 0
  • High state: all Modbus transactions are executed permanently if Trigger=1
  • Low state: all Modbus transactions are executed permanently if Trigger=0
  • When the trigger works in edge mode, the trigger value will be restored automatically after all the Modbus transactions of the Modbus device have been executed, with or without error
  • With a 'negative edge' trigger and the trigger changes from 1 to 0, all Modbus transactions of the device execute once, then the trigger is restored to 1 automatically

Useful Hints – Diagnostics

  • Assign tags to Cycle count, Status and Communication error diagnostics items to use them in the logic
  • Cycle count increments by 1 when all transactions of a device end
  • It monitors if Modbus transactions are executed normally
  • If a permanent level is used, the change in cycle count can be detected
  • Status and Communication errors are evaluated after each Modbus transaction
  • This is used to diagnose if Modbus communication is healthy

Useful Hints - Timing

  • TBox RTU uses 3 timing parameters to control the Modbus polling process:
  • Packet reception delay is the maximum time the master waits for a complete packet from the slave
  • IFG (Inter Frame Gap) is the time the master RTU must wait before its next Modbus query to the slave device
  • Rx Timeout is the longest time the master RTU waits for the response from a slave
  • These 3 parameters are found in the Advanced tab page of the properties window of a serial or Ethernet port

Master Configuration Procedure

  • Define the Modbus master configuration of TBox RTU, including:
    • The quantity of external Modbus slave devices that need to poll
    • The data types and ranges needed to read or write in each Modbus slave device
    • Whether each Modbus slave device uses a serial or Ethernet connection
  • If using a serial port, identify if RS232 or RS485 is required
    • The RS232 port of TBox RTU connects to one external device given it is a point-to-point connection
    • The RS485 port of TBox RTU connects to multiple slave devices as it’s a multiple-drop communication bus
  • Configure the Baudrate, data bits, parity, and stop bits on the TBox RTU
  • With Ethernet, make sure how many devices need polling and their IP addresses
    • TBox RUT cannot have the same subnets on different Ethernet ports
  • Add a Modbus Device based on requirement and configure the communication port
  • Check the TCP port, and adapt it in RTU properties -> Advanced -> TCP ports

Troubleshooting

  • The diagnostic tags can be used, as well as other utilities like Wireshark and Modbus simulator

Special Notes – Keep Socket Open

  • With the TBox RTU as a Modbus TCP master, 'Keep socket open' should be enabled to increase data throughput
  • This saves bandwidth on the TCP/IP network
  • The option is located in RTU Properties->Advanced->Modbus Transactions window
  • When enabled, the socket stays open until there are no activities on this socket in 30s
  • When disabled, the socket closes after every transaction so a new socket opens in the next transaction
  • Some Modbus slave devices do not like frequent socket open/close actions over Ethernet ports, so enabling Keep socket open is a better choice

Illegal Data Address

  • When TBox RTU is a Modbus slave and the polled data address (tag) does not exist, an exception code returns, following the Modbus protocol standard
  • With 'Enable Advanced Modbus Mapping' checked, TBox RTU will fill the non-existent addresses with 0, instead of returning the exception code

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Use Quizgecko on...
Browser
Browser