TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139260 times)
  2. FAT32 Library (71751 times)
  3. Network Ethernet Library (57123 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43086 times)
  6. FT800 Library (42404 times)
  7. GSM click (29835 times)
  8. mikroSDK (28079 times)
  9. PID Library (26885 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Project

Modbus RTU Implementation & Ladder Logic

Rating:

5

Author: Vladimir Djukovic

Last Updated: 2013-01-11

Package Version: 1.0.0.0

Category: Communication

Downloaded: 3316 times

Followed by: 3 users

License: MIT license  

This project contains some library code aimed to be used for developing slave PLC type controllers using microcontrollers for their hardware configurations

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Modbus RTU Implementation & Ladder Logic" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Modbus RTU Implementation & Ladder Logic" changes.

Do you want to report abuse regarding "Modbus RTU Implementation & Ladder Logic".

  • Information
  • Comments (9)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Project Blog

Hello World!

If You have any questions, suggestions, whatever... feel free to email me or post a comment here... 

Some features of Modbus RTU Implementation in this example:

Despite of that that this prototype configuration mainly has an experimental 
purpose it is considerably tested under conditions exactly as it is presented 
by the block diagram above. 

- Modbus Implementation library set has encapsulated features in relation
  to the Modbus standard, like Modbus massage framing, in other words 
  the user has not to take care about request message interruption,
  the controller software measures silent intervals between bytes of a
  request message and the start and termination of a message are 
  recognizable also. Those time intervals are defined by the standard, their 
  values are in linear correlation at the UART baud rate applied, for baud rates 
  above 19200 bps, they are constants

Broadcast is not implemented by the library - the controller ignores zerro
  address fields. It should be implemented as the user definable option in the
  next version

- Communication feature: Address detection mode exists as an option, on 
  that way only the address byte is being checked upon received as the first byte 
  of a request, if it is not matched with the slave address then processing of the rest 
  of the request is discarded - faster processing, no needless time consumation 
  but with a disadvantage of no parity checking applied in this mode

- Modbus RTU message protocol, Master - Slave data link, 
  established over RS-232 physical layer - tested within the range (2400 - 57600) bps
  Baud rate is configurable by a library function. 

development tools

development tools

NOTE: There is no RS-232 connection to PC on the photo. It is a picture after loading Modbus_RTU_Slave.hex test example from the package file

View full image
external memory block board

external memory block board

Ready for PIC board with PIC18F45K22 and parallel SRAM 128Kx8bit memory. The PIC on the board serves as a serial driver between the main MCU (the same chip on the main development board) and memory. It is programmed by Slave_SPI.hex file contained in the

View full image

A stage during the development cycle

NOTE: Although the SRAM chip has 128K capacity space it is used 64K (A0-A15, A16 = ground) for this slave configuration

Watch on YouTube

This is a test program that was made in order to be used for the external memory block functionality testing. Considering that this external memory has an important role in the entire system behavior, before it was used as a functional system component it had had to be well established the internal communication between the main MCU and the external memory block. This is one of assistant programs made in order to help in developing this Modbus RTU library code for slave controllers. Obviously this external memory block is an impractical solution but with some reasons it serves well in an experimental sense. It should be replaced with a common SRAM chip with SPI interface. 

ALSO FROM THIS AUTHOR

FTP Server

0

Demo - test; Simple embedded FTP server application in LAN environment based on PIC18F devices; Can be useful for special purposes. More on project blog page.

[Learn More]

Modbus RTU Master Implementation; GUI - demo

5

The project contains a simple graphical user interface software mainly used as a testing tool and integral part of the entire application which refers to the Modbus RTU application protocol implemented in master controllers based on MCUs. NEW: Modbus RTU Master function codes library, basic functions added

[Learn More]

Programmable Timer

4

An timer application with four independent programmable outputs each one with eight ON/OFF programs on daily basis (0-24h). Fully supported via an character LCD interface gives a comfort of setting the desired program. Additional usefull settings implemented also.

[Learn More]