Today is...
Tuesday, November 25, 2014
Welcome to Control.com, the global online
community of automation professionals.
Advertisement
Featured Video...
Featured Video
Wiring and programming your servos and I/O just got a lot easier...
Advertisement
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?

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

Thanks in advance.

Hello;

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