communication with a ModBus instrument via RS232

  • Thread starter Marc-Gunnar Schroeder
  • Start date
M

Thread Starter

Marc-Gunnar Schroeder

Is it possible to talk 'directly' to a ModBus instrument via RS232 like the windows hyperterminal or is there any 'command-line'-tool availaible, which translates a given string to such an instrument, and receives an answer which could be given back to a file or what ever?
...Yes, I know, this question sounds very unprofessional, and indeed I'am...
 
If your Modbus device speaks Modbus/ASCII protocol, you could use Hyperterminal. You would have to manually calculate the checksum, which is tedious. Even still, other than checking out the device, this is not a very useful application.

If your Modbus device speaks Modbus/RTU, consider using an ActiveX control with Visual Basic, VC+, Excel or other compatible container program. Please see SMRX at http://www.sapia-inc.com for a fully functioning demo that will have hour application talking Modbus/RTU within minutes.

[email protected]
 
T

Todd Kirchner

Modbus is just a protocol that can be communicated over rs232/422/485 or ethernet. If you want to get some data from a modbus instrument, you need to set up rs232 communications and parse out the modbus information from the data stream. You would need detailed information on how the protocol works and good software writing skills to pull this off. If you are interested in this approach, the modbus protocol is available in detail on the internet.

From your description, it sounds like you would like to have some way to bring in data from a device that talks modbus into a PC via modbus serial and make use of that data somehow. I would suggest using an OPC server to accomplish this. OFS Factory Server from Schnieder Electric is a good choice... you can also try KEPWare... Look for something that supports modbus serial. Also, make sure you understand the Master/Slave relationship when using the modbus protocol if you are using multiple nodes on the modbus network.

Todd Kirchner
Controls Engineer
Siemens Dematic
 
L

Lynn at Alist

Is it the "comand line" you want (for batch programming?) or would a Windows tool work? I'm not aware of any "command lines" for Modbus, but do a simple search at control.com archive for "Modbus Test" or "Modbus Simulator". This topic comes up a lot. There at least a dozen simple freeware or shareware tools that allow you to poll a Modbus slave. I use the ones from win-tech.com, but others I know use one from calta.com

-Lynn
 
C

Curt Wuollet

If you simply have a particular register or set of registers that you wish to read repeatedly for a particular application, a shell script or a few lines of C code will do that for you without implementing the entire protocol. All that is needed is to set up a port, send a request and read and interpret the result. I've done this sort of thing several times to get limited data from a PLC system with my Linux box. Modbus is one of the easier protocols to emulate. The big advantage of doing it this way is that timing requirements can be accomodated. There are a lot of options for Linux. For MS, I'm not sure about a batch file anymore, but it should be doable in QBASIC or whatever "command line" tool MS provides these days, if any. A lot depends on what you need to do with the data once you get it.

Regards

cww
 
Top