from the Automation List department...
String variables on Modbus
PLCs and related questions. topic
Posted by Ali on 14 November, 2007 - 12:14 am
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.

Posted by dchartier on 14 November, 2007 - 12:49 am

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

Posted 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

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2014 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

The meek shall inherit the earth -- they are too weak to refuse.
Advertise here
our advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive