rmodbus 1.2.8 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +4 -0
- data/README.md +34 -6
- data/lib/rmodbus/sp.rb +6 -1
- data/lib/rmodbus/version.rb +1 -1
- data/lib/rmodbus.rb +22 -25
- data/spec/spec_helper.rb +0 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81e104f4823d31c4054dcd5b0aba2daf6b4436fa
|
4
|
+
data.tar.gz: af007cd327a5a3fb9f7e6772bc4e7a8be70eeedb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8014693cac52f75394dd88b3ffd5edff75961829878ec2b2b1cbabe9b4db9528b925da17ff3c5c89024addc0029ba03a95aa89a116fb3f36cb03526709a2d07
|
7
|
+
data.tar.gz: 17eaaed42bb65f5c879dfec586dacc2f967aaaee5e4e3d1dcd6c191fb426f14badd6a03bbc5a1d23a0f3015a869de1db7d630d4c189e611830597b4f0c29395a
|
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
RModBus [![Build Status](https://secure.travis-ci.org/
|
1
|
+
RModBus [![Build Status](https://secure.travis-ci.org/rmodbus/rmodbus.png)](http://travis-ci.org/rmodbus/rmodbus) [![Gem Version](https://badge.fury.io/rb/rmodbus.svg)](http://badge.fury.io/rb/rmodbus)
|
2
2
|
==========================
|
3
3
|
|
4
4
|
**RModBus** - free implementation of ModBus protocol in pure Ruby.
|
5
5
|
|
6
6
|
Features
|
7
7
|
---------------------------
|
8
|
-
- Ruby 2.
|
8
|
+
- Ruby 2.2, 2.3 and JRuby (without serial ModBus RTU)
|
9
9
|
- TCP, RTU, RTU over TCP protocols
|
10
10
|
- Client(master) and server(slave)
|
11
11
|
- 16, 32 -bit and float registers
|
@@ -31,6 +31,29 @@ Download and install RModBus with the following:
|
|
31
31
|
gem install rmodbus
|
32
32
|
```
|
33
33
|
|
34
|
+
Or if you are using bundler, add to your Gemfile:
|
35
|
+
|
36
|
+
```
|
37
|
+
gem 'rmodbus'
|
38
|
+
```
|
39
|
+
|
40
|
+
If you want to use ModBus over serial, you will also need to install the 'serialport' gem.
|
41
|
+
If you are using bundler, add to your Gemfile:
|
42
|
+
|
43
|
+
```
|
44
|
+
gem 'serialport'
|
45
|
+
```
|
46
|
+
|
47
|
+
If you want to use ModBus::TCPServer or ModBus::RTUViaTCPServer and are using Ruby >= 2.2,
|
48
|
+
you will also need to install the 'gserver' gem. If you are using bundler, add to your Gemfile:
|
49
|
+
|
50
|
+
```
|
51
|
+
gem 'gserver'
|
52
|
+
```
|
53
|
+
|
54
|
+
Please note that GServer is deprecated, and I'm looking for a better solution.
|
55
|
+
Contributions are welcome!
|
56
|
+
|
34
57
|
Example
|
35
58
|
------------------------------------
|
36
59
|
|
@@ -54,13 +77,18 @@ Example
|
|
54
77
|
end
|
55
78
|
```
|
56
79
|
|
57
|
-
|
80
|
+
Versioning
|
58
81
|
----------------------------------
|
59
82
|
|
60
|
-
|
83
|
+
This project will follow http://semver.org/
|
61
84
|
|
62
85
|
```
|
63
|
-
|
86
|
+
Given a version number MAJOR.MINOR.PATCH, increment the:
|
87
|
+
|
88
|
+
MAJOR version when you make incompatible API changes,
|
89
|
+
MINOR version when you add functionality in a backwards-compatible manner, and
|
90
|
+
PATCH version when you make backwards-compatible bug fixes.
|
91
|
+
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
|
64
92
|
```
|
65
93
|
|
66
94
|
Reference
|
@@ -68,6 +96,6 @@ Reference
|
|
68
96
|
|
69
97
|
Home page: http://rmodbus.flipback.net
|
70
98
|
|
71
|
-
RModBus on GitHub: http://github.com/
|
99
|
+
RModBus on GitHub: http://github.com/rmodbus/rmodbus
|
72
100
|
|
73
101
|
ModBus specifications: http://www.modbus.org/specs.php
|
data/lib/rmodbus/sp.rb
CHANGED
@@ -12,6 +12,12 @@
|
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU General Public License for more details.
|
14
14
|
|
15
|
+
begin
|
16
|
+
require 'serialport'
|
17
|
+
rescue Exception => e
|
18
|
+
warn "[WARNING] Install `serialport` gem for use RTU protocols"
|
19
|
+
end
|
20
|
+
|
15
21
|
module ModBus
|
16
22
|
module SP
|
17
23
|
attr_reader :port, :baud, :data_bits, :stop_bits, :parity, :read_timeout
|
@@ -42,4 +48,3 @@ module ModBus
|
|
42
48
|
end
|
43
49
|
end
|
44
50
|
end
|
45
|
-
|
data/lib/rmodbus/version.rb
CHANGED
data/lib/rmodbus.rb
CHANGED
@@ -9,31 +9,28 @@
|
|
9
9
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
10
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
11
|
# GNU General Public License for more details.
|
12
|
-
require 'rmodbus/errors'
|
13
|
-
require 'rmodbus/ext'
|
14
|
-
require 'rmodbus/debug'
|
15
|
-
require 'rmodbus/options'
|
16
|
-
require 'rmodbus/rtu'
|
17
|
-
require 'rmodbus/tcp'
|
18
|
-
require 'rmodbus/slave'
|
19
|
-
require 'rmodbus/client'
|
20
|
-
require 'rmodbus/server'
|
21
|
-
require 'rmodbus/tcp_slave'
|
22
|
-
require 'rmodbus/tcp_client'
|
23
|
-
require 'rmodbus/tcp_server'
|
24
|
-
|
25
|
-
begin
|
26
|
-
require 'serialport'
|
27
|
-
require 'rmodbus/sp'
|
28
|
-
require 'rmodbus/rtu_slave'
|
29
|
-
require 'rmodbus/rtu_client'
|
30
|
-
require 'rmodbus/rtu_server'
|
31
|
-
rescue Exception => e
|
32
|
-
warn "[WARNING] Install `serialport` gem for use RTU protocols"
|
33
|
-
end
|
34
12
|
|
35
|
-
require 'rmodbus/
|
36
|
-
require 'rmodbus/rtu_via_tcp_client'
|
37
|
-
require 'rmodbus/rtu_via_tcp_server'
|
13
|
+
require 'rmodbus/ext'
|
38
14
|
require 'rmodbus/proxy'
|
39
15
|
require 'rmodbus/version'
|
16
|
+
|
17
|
+
module ModBus
|
18
|
+
autoload :Errors, 'rmodbus/errors'
|
19
|
+
autoload :Debug, 'rmodbus/debug'
|
20
|
+
autoload :Options, 'rmodbus/options'
|
21
|
+
autoload :SP, 'rmodbus/sp'
|
22
|
+
autoload :RTU, 'rmodbus/rtu'
|
23
|
+
autoload :TCP, 'rmodbus/tcp'
|
24
|
+
autoload :Slave, 'rmodbus/slave'
|
25
|
+
autoload :Client, 'rmodbus/client'
|
26
|
+
autoload :Server, 'rmodbus/server'
|
27
|
+
autoload :TCPSlave, 'rmodbus/tcp_slave'
|
28
|
+
autoload :TCPClient, 'rmodbus/tcp_client'
|
29
|
+
autoload :TCPServer, 'rmodbus/tcp_server'
|
30
|
+
autoload :RTUSlave, 'rmodbus/rtu_slave'
|
31
|
+
autoload :RTUClient, 'rmodbus/rtu_client'
|
32
|
+
autoload :RTUServer, 'rmodbus/rtu_server'
|
33
|
+
autoload :RTUViaTCPSlave, 'rmodbus/rtu_via_tcp_slave'
|
34
|
+
autoload :RTUViaTCPClient, 'rmodbus/rtu_via_tcp_client'
|
35
|
+
autoload :RTUViaTCPServer, 'rmodbus/rtu_via_tcp_server'
|
36
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmodbus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A.Timin, J. Sanders, K. Reynolds
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -84,30 +84,30 @@ dependencies:
|
|
84
84
|
name: serialport
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: gserver
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0
|
104
|
-
type: :
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0
|
110
|
+
version: '0'
|
111
111
|
description:
|
112
112
|
email: atimin@gmail.com
|
113
113
|
executables: []
|