2017-01-26 Update 2 Modbus Document Update

This commit is contained in:
parallelbgls
2017-01-26 17:24:00 +08:00
parent b0bd1f2cb6
commit ee80eb82d3
3 changed files with 86 additions and 3 deletions

View File

@@ -65,6 +65,7 @@
<None Include="Modbus.Net.Modbus.nuspec">
<SubType>Designer</SubType>
</None>
<None Include="README.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,80 @@
Modbus.Net
===================
[![NuGet](https://img.shields.io/nuget/v/Modbus.Net.Modbus.svg)](https://www.nuget.org/packages/Modbus.Net.Modbus/)
Modbus Implementation of Modbus.Net
Table of Content:
* [Basic Concept](#basic)
* [Address Mapping](#address)
* [Addres Coding](#coding)
* [SubAddress Rules](#subpos)
##<a name="basic"></a> Basic Concept
Modbus is a serial communications protocol originally published by Modicon (now Schneider Electric) in 1979 for use with its programmable logic controllers (PLCs). Simple and robust, it has since become a de facto standard communication protocol, and it is now a commonly available means of connecting industrial electronic devices.(From Wekipedia)
##<a name="address"></a> Address Mapping
Modbus has four types of address: Coil, Discrete Input, Holding Register and Input Register.
Modbus has two address description method: standard and extend.
The following table could show the full address discription in Modbus.
Type | Standard | Extend |
---------------- | ----------- | ------------- |
Coil | 00001-09999 | 000001-065536 |
Discrete Input | 10001-19999 | 100001-165536 |
Holding Register | 30001-39999 | 300001-365536 |
Input Register | 40001-49999 | 400001-465536 |
Standard and Extend address description are all supported in Modbus.Net.Modbus. The only difference is don't write too large number in address.
The following table shows how to write address in Modbus.Net.Modbus
Standard Modbus Address | Modbus.Net.Modbus String Address |
----------------------- | -------------------------------- |
00001 | 0X 1 |
00002 | 0X 2 |
09999 | 0X 9999 |
065536 | 0X 65536 |
10001 | 1X 1 |
30001 | 3X 1 |
40001 | 4X 1 |
##<a name="coding"></a> Address Coding
In Modbus.Net, you can write "0X"(Coil), "1X"(Discrete Input), "3X"(Input Register), "4X"(Holding Register) in Area.
Don't forget to type a space between Area and Address.
If you want to use subpos, type string address like this:
4X 1.12 (Area Address.Subpos)
##<a name="subpos"></a> SubAddress Rules
For 0X and 1X, the scalation is 1/8. This means each address is bool.
Noticing that you can only read 1X.
SubAddress System is not activated in 0X and 1X.
For 3X and 4X, the scalation is 2. This meas each address is short.
The number of SubAddress is from 0 to 15.
Caution: Modbus.Net.Modbus SubAddress has a giant difference towards standard Modbus.
Bit position from standard modbus is from last to first. But Modbus.Net is from first to last.
Standard Modbus
1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Modbus.Net.Modbus
1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

View File

@@ -11,6 +11,7 @@ Table of Content:
* [Quick Start](#quick_start)
* [Tutorial](#tutorial)
* [Implement](#implement)
* [Addition](#addition)
##<a name="features"></a> Features
* A open platform that you can easy to extend a industrial communication protocal.
@@ -499,7 +500,7 @@ public class AddressFormaterModbus : AddressFormater
}
```
##Addition
##<a name="addition"></a> Addition
###For Subpos System
Subpos system is implemented for reading and writing of bits.
@@ -521,6 +522,8 @@ For example if you want the get a value from the 6th byte in Hold Register. In t
```
Modbus 400003 2nd byte
Donnot wonder I use real number to implement subpos counter. There are no tolerances because only (1/2 pow n) could be used to count subpos.
==
class AddressUnit
@@ -551,7 +554,6 @@ Remember subpos system cannot cross a byte in current version. If you want to cr
* Address Utility (In Road)
* Move SlaveAddress parameter to GetData and SetData. (In Road)
* More functions in TaskManager. (In Road)
* Fix reverse bit bug in Modbus. (In Road)
###Version 1.2.3
* OPC UA Support (In Road)
@@ -563,4 +565,4 @@ Remember subpos system cannot cross a byte in current version. If you want to cr
* Siemens MPI Support (In Road)
###Version 1.4.0
* .NET Core Support (Undetermined)
* .NET Core Support (In Road)