Today is...
Monday, January 23, 2017
Welcome to, the global online
community of automation professionals.
Featured Video...
Featured Video
Watch an animation of a conveyor stacking operation demonstrating the use of a move on a gear command.
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive
String variables on Modbus
Modbus slave can receive character string variable

Is it possible to send a character's string variables from one Modbus RTU master to its related Modbus slave?

variable name VAR_1,type string
intial value '1234-01-05-10:15:36.125'

Thanks in advance.


Modbus allows transfer of data in terms of Coils (1 bit) or Registers (16-bit). You can send strings if you build them as a series of registers containing each 2 8-bit CHAR values (ASCII). But this implementation is all yours to develop.

Some of our powermeters (Modbus slaves) transfer timestamp information to the master in this way. Look at the ION 7500 Modbus mapping, for example. Data Records (transferred as 2 regiters, FLOAT vaue) are followed by 2 32-bit UINT registers with time data in ASCII format.

Hope this helps,
Daniel Chartier

By Jerry Miille on 20 November, 2007 - 12:37 pm

Sure, just pack the ASCII encoded string variables into consecutive Modbus registers, packed two characters per "register" and you are good to go.

Just remember, that Modbus does not specify this definition. You are on your own to get the Modbus Master and the Modbus Slave to be able to understand the communication. In fact the protocol specification does not specify "ANY TYPE DECLARATIONS", you either read "bits" or "words".

Jerry Miille