ladder_drive 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +41 -0
- data/LICENSE +21 -0
- data/README.md +191 -0
- data/README_jp.md +193 -0
- data/Rakefile +9 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/ladder_drive +28 -0
- data/ladder_drive.gemspec +33 -0
- data/lib/ladder_drive/asm.rb +211 -0
- data/lib/ladder_drive/cli.rb +55 -0
- data/lib/ladder_drive/config.rb +107 -0
- data/lib/ladder_drive/config_target.rb +93 -0
- data/lib/ladder_drive/console.rb +113 -0
- data/lib/ladder_drive/intel_hex.rb +79 -0
- data/lib/ladder_drive/ladder_drive.rb +36 -0
- data/lib/ladder_drive/plc_define.rb +35 -0
- data/lib/ladder_drive/plc_device.rb +171 -0
- data/lib/ladder_drive/protocol/emulator/emu_protocol.rb +54 -0
- data/lib/ladder_drive/protocol/emulator/emulator.rb +29 -0
- data/lib/ladder_drive/protocol/keyence/keyence.rb +31 -0
- data/lib/ladder_drive/protocol/keyence/kv_device.rb +51 -0
- data/lib/ladder_drive/protocol/keyence/kv_protocol.rb +187 -0
- data/lib/ladder_drive/protocol/mitsubishi/mc_protocol.rb +268 -0
- data/lib/ladder_drive/protocol/mitsubishi/mitsubishi.rb +30 -0
- data/lib/ladder_drive/protocol/mitsubishi/qdevice.rb +114 -0
- data/lib/ladder_drive/protocol/protocol.rb +107 -0
- data/lib/ladder_drive/tasks/build.rb +101 -0
- data/lib/ladder_drive/uploader.rb +101 -0
- data/lib/ladder_drive/version.rb +26 -0
- data/lib/ladder_drive.rb +32 -0
- data/lib/plc/LICENSE +21 -0
- data/lib/plc/emulator/emu_device.rb +121 -0
- data/lib/plc/emulator/emu_plc.rb +482 -0
- data/lib/plc/emulator/emu_plc_server.rb +71 -0
- data/lib/plc/emulator/emulator.rb +28 -0
- data/lib/plc/keyence/kv/kv-5000/DocumentWindowInfo.xml +91 -0
- data/lib/plc/keyence/kv/kv-5000/KvsMon.ini +0 -0
- data/lib/plc/keyence/kv/kv-5000/LadderDrive.mod +0 -0
- data/lib/plc/keyence/kv/kv-5000/LbkMdm.ini +0 -0
- data/lib/plc/keyence/kv/kv-5000/Main.mod +0 -0
- data/lib/plc/keyence/kv/kv-5000/MonEnv.kmu +1 -0
- data/lib/plc/keyence/kv/kv-5000/PlcSended.dky +0 -0
- data/lib/plc/keyence/kv/kv-5000/SensorMonitorInfo.xml +4 -0
- data/lib/plc/keyence/kv/kv-5000/TransInfo.tif +0 -0
- data/lib/plc/keyence/kv/kv-5000/UnitSet.ue2 +0 -0
- data/lib/plc/keyence/kv/kv-5000/UnitSet.ue2.old +0 -0
- data/lib/plc/keyence/kv/kv-5000/WsTreeEnv.xml +28 -0
- data/lib/plc/keyence/kv/kv-5000/kv-5000.cm1 +0 -0
- data/lib/plc/keyence/kv/kv-5000/kv-5000.cm2 +0 -0
- data/lib/plc/keyence/kv/kv-5000/kv-5000.ftc +0 -0
- data/lib/plc/keyence/kv/kv-5000/kv-5000.kpr +0 -0
- data/lib/plc/keyence/kv/kv-5000/kv-5000.lbl +0 -0
- data/lib/plc/keyence/kv/kv-5000/kv-5000.mil +0 -0
- data/lib/plc/keyence/kv/kv-5000/kv-5000.spl +0 -0
- data/lib/plc/keyence/kv/kv-5000/operand-history.txt +16 -0
- data/lib/plc/keyence/kv/kv-5000/sample.al2 +2 -0
- data/lib/plc/mitsubishi/iq-r/r08/r08.gx3 +0 -0
- data/lib/plc/plc.rb +27 -0
- data/sample/ladder_drive/sample1.esc +4 -0
- data/sample/ladder_drive/sample2.esc +28 -0
- data/sample/ladder_drive/sample2.png +0 -0
- data/template/escalator/config/plc.yml +27 -0
- data/template/ladder_drive/Rakefile +1 -0
- data/template/ladder_drive/asm/main.esc +70 -0
- data/template/ladder_drive/config/plc.yml +27 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3c79beb0c083c72e759e676ecdffe1172dae07ba
|
4
|
+
data.tar.gz: 7352398566885573d294b5f4b84473a0bcd4ad14
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 84cb917f7b171e3631bc246dd9b2135b6992ef7c89de41506fc0b4a6f7f71b07d80dfa4a2c62bd81f2087eda9ed89ae28f9b8e2e2903ba72c5620c69fe56d689
|
7
|
+
data.tar.gz: 00a67076c5529457af230c57036964d52bf509089c10daf33cd085ca6b18f10cd114d16f6b8fdd492b7daea13814b215e6fd21ad638d10f09c73b20702fb349d
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ladder_drive (0.3.0)
|
5
|
+
activesupport (>= 4.2.7)
|
6
|
+
thor
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (4.2.7.1)
|
12
|
+
i18n (~> 0.7)
|
13
|
+
json (~> 1.7, >= 1.7.7)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
16
|
+
tzinfo (~> 1.1)
|
17
|
+
i18n (0.7.0)
|
18
|
+
json (1.8.3)
|
19
|
+
minitest (5.9.1)
|
20
|
+
power_assert (0.2.7)
|
21
|
+
rake (10.5.0)
|
22
|
+
test-unit (3.1.7)
|
23
|
+
power_assert
|
24
|
+
thor (0.19.4)
|
25
|
+
thread_safe (0.3.5)
|
26
|
+
tzinfo (1.2.2)
|
27
|
+
thread_safe (~> 0.1)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
x64-mingw32
|
32
|
+
|
33
|
+
DEPENDENCIES
|
34
|
+
activesupport (>= 4.2.7)
|
35
|
+
bundler (~> 1.11)
|
36
|
+
ladder_drive!
|
37
|
+
rake (~> 10.0)
|
38
|
+
test-unit
|
39
|
+
|
40
|
+
BUNDLED WITH
|
41
|
+
1.14.3
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 ITO SOFT DESIGN Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,191 @@
|
|
1
|
+
[[Japanese description is here.]](https://github.com/ito-soft-design/ladder_drive/blob/master/README_jp.md)
|
2
|
+
|
3
|
+
# LadderDrive
|
4
|
+
|
5
|
+
The ladder_drive is a simple abstract ladder for PLC (Programmable Logic Controller).
|
6
|
+
|
7
|
+
We aim to design abstraction ladder which is able to run on any PLC with same ladder source or binary and prepare full stack tools.
|
8
|
+
|
9
|
+
# Getting started
|
10
|
+
|
11
|
+
It's required the Ruby environment.
|
12
|
+
To prepare the Ruby environment, please find web sites.
|
13
|
+
|
14
|
+
Install LadderDrive at the command prompt.
|
15
|
+
|
16
|
+
```sh
|
17
|
+
$ gem install ladder_drive
|
18
|
+
```
|
19
|
+
|
20
|
+
[![https://gyazo.com/6f00d74612def41fb33d836275b74c24](https://i.gyazo.com/6f00d74612def41fb33d836275b74c24.gif)](https://gyazo.com/6f00d74612def41fb33d836275b74c24)
|
21
|
+
|
22
|
+
# Create an LadderDrive project
|
23
|
+
|
24
|
+
At the command prompt, create a new LadderDrive project.
|
25
|
+
|
26
|
+
```sh
|
27
|
+
$ ladder_drive create my_project
|
28
|
+
$ cd my_project
|
29
|
+
```
|
30
|
+
|
31
|
+
[![https://gyazo.com/c538f66129aa425e2b1da4f478a10f52](https://i.gyazo.com/c538f66129aa425e2b1da4f478a10f52.gif)](https://gyazo.com/c538f66129aa425e2b1da4f478a10f52)
|
32
|
+
|
33
|
+
Created files are consisted like the tree below.
|
34
|
+
|
35
|
+
```
|
36
|
+
.
|
37
|
+
├── Rakefile
|
38
|
+
├── asm
|
39
|
+
│ └── main.esc
|
40
|
+
├── config
|
41
|
+
│ └── plc.yml
|
42
|
+
└── plc
|
43
|
+
└── mitsubishi
|
44
|
+
└── iq-r
|
45
|
+
└── r08
|
46
|
+
├── LICENSE
|
47
|
+
└── r08.gx3
|
48
|
+
```
|
49
|
+
|
50
|
+
# Connection configuration
|
51
|
+
|
52
|
+
## PLC configuration
|
53
|
+
|
54
|
+
There is a plc project under the plc directory.
|
55
|
+
Launch the one of the plc project which you want to use.
|
56
|
+
(Currently we support the Emulator and MITSUBISHI iQ-R R08CUP only.)
|
57
|
+
|
58
|
+
Configure ethernet connection by the tool which is provided by plc maker.
|
59
|
+
Then upload settings and plc program to the plc.
|
60
|
+
|
61
|
+
[![](http://img.youtube.com/vi/fGdyIo9AmuE/0.jpg)](https://youtu.be/fGdyIo9AmuE)
|
62
|
+
|
63
|
+
|
64
|
+
## LadderDrive configuration
|
65
|
+
|
66
|
+
There is a configuration file at config/plc.yml.
|
67
|
+
Currently we support MITSUBISHI iQ-R R08CUP and the Emulator.
|
68
|
+
You only change host to an ip address of your plc.
|
69
|
+
|
70
|
+
```
|
71
|
+
# plc.yml
|
72
|
+
plc: # Beginning of PLC section.
|
73
|
+
iq-r: # It's a target name
|
74
|
+
cpu: iq-r # It's just a comment.
|
75
|
+
protocol: mc_protocol # It's a protocol to communicate with PLC.
|
76
|
+
host: 192.168.0.10 # It's PLC's IP address or dns name.
|
77
|
+
port: 5007 # It's PLC's port no.
|
78
|
+
```
|
79
|
+
|
80
|
+
[![](http://img.youtube.com/vi/m0JaOBFIHqw/0.jpg)](https://youtu.be/m0JaOBFIHqw)
|
81
|
+
|
82
|
+
|
83
|
+
## LadderDrive programming
|
84
|
+
|
85
|
+
LadderDrive program file is located under the asm directory.
|
86
|
+
By default, use asm/main.esc.
|
87
|
+
Edit it and programming.
|
88
|
+
|
89
|
+
Refer [Wiki](https://github.com/ito-soft-design/ladder_drive/wiki/mnemonic) to check mnemonic.
|
90
|
+
|
91
|
+
```
|
92
|
+
# main.esc
|
93
|
+
# |M0|-|M1|----(M2)
|
94
|
+
LD M0
|
95
|
+
AND M1
|
96
|
+
OUT M2
|
97
|
+
END
|
98
|
+
```
|
99
|
+
|
100
|
+
[![](http://img.youtube.com/vi/OjaSqrkWv8Q/0.jpg)](https://youtu.be/OjaSqrkWv8Q)
|
101
|
+
|
102
|
+
|
103
|
+
# Transfer the LadderDrive program
|
104
|
+
|
105
|
+
At the command prompt, use ```rake``` command to upload ladder_drive program to the plc.
|
106
|
+
By default, the target plc is ```emulator```. Then launch the Emulator.
|
107
|
+
|
108
|
+
```sh
|
109
|
+
$ rake
|
110
|
+
```
|
111
|
+
|
112
|
+
If you use with the ```target``` option, the target PLC is it.
|
113
|
+
|
114
|
+
```sh
|
115
|
+
$ rake target=iq-r
|
116
|
+
```
|
117
|
+
|
118
|
+
You can describe the default target by the target section in plc.yml.
|
119
|
+
|
120
|
+
```
|
121
|
+
# plc.yml
|
122
|
+
default:
|
123
|
+
target: iq-r
|
124
|
+
```
|
125
|
+
|
126
|
+
```rake``` is same as ```rake target=iq-r```.
|
127
|
+
|
128
|
+
|
129
|
+
The LadderDrive program runs immediately after uploaded.
|
130
|
+
|
131
|
+
```sh
|
132
|
+
$ rake [target=iq-r]
|
133
|
+
uploading build/main.hex ...
|
134
|
+
launching emulator ...
|
135
|
+
done launching
|
136
|
+
done uploading
|
137
|
+
|
138
|
+
LadderDrive is an abstract PLC.
|
139
|
+
This is a console to communicate with PLC.
|
140
|
+
|
141
|
+
>
|
142
|
+
```
|
143
|
+
|
144
|
+
After uploaded the program, it becomes in to console mode.
|
145
|
+
You can read and write a device by entering commands.
|
146
|
+
|
147
|
+
Use the r command if you want to read devices.
|
148
|
+
Below example reads values of devices from M0 to M7.
|
149
|
+
|
150
|
+
```sh
|
151
|
+
> r m0 8
|
152
|
+
```
|
153
|
+
|
154
|
+
Below example writes values to devices from M0 to M7.
|
155
|
+
|
156
|
+
```sh
|
157
|
+
> w m0 0 0 0 1 1 0 1 1
|
158
|
+
```
|
159
|
+
|
160
|
+
If you want to turn on and off the device like pushing a button, use p command.
|
161
|
+
|
162
|
+
```sh
|
163
|
+
> p m0
|
164
|
+
```
|
165
|
+
|
166
|
+
You can describe turn on time duration after a device. The unit is sec.
|
167
|
+
|
168
|
+
```sh
|
169
|
+
> p m0 1.5
|
170
|
+
```
|
171
|
+
|
172
|
+
```
|
173
|
+
# |M0|---(M1)
|
174
|
+
LD M0
|
175
|
+
OUT M1
|
176
|
+
```
|
177
|
+
|
178
|
+
[![https://gyazo.com/565d24a35887503281a46775f6ccd747](https://i.gyazo.com/565d24a35887503281a46775f6ccd747.gif)](https://gyazo.com/565d24a35887503281a46775f6ccd747)
|
179
|
+
|
180
|
+
<!-- [![](http://img.youtube.com/vi/qGbicGLB7Gs/0.jpg)](https://youtu.be/qGbicGLB7Gs) -->
|
181
|
+
|
182
|
+
|
183
|
+
# Information related ladder_drive
|
184
|
+
|
185
|
+
- [My japanese diary [ladder_drive]](http://diary.itosoft.com/?category=ladder_drive)
|
186
|
+
- [Wiki](https://github.com/ito-soft-design/ladder_drive/wiki/)
|
187
|
+
|
188
|
+
|
189
|
+
## License
|
190
|
+
|
191
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/README_jp.md
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
# エスカレーター
|
2
|
+
|
3
|
+
## 概要
|
4
|
+
|
5
|
+
エスカレーターはPLC(Programmable Logic Controller)向けの抽象的なラダーです。
|
6
|
+
どのPLCでも同じソース(できればバイナリー)で実行できる形態を目指しています。
|
7
|
+
|
8
|
+
まずはニーモニックレベルで実現し、その上に分かりやすい形のプログラミングツールを用意できればと考えています。
|
9
|
+
|
10
|
+
## 使い方
|
11
|
+
|
12
|
+
使用するにはRubyが実行できる環境が必要です。
|
13
|
+
Rubyの実行環境の構築はWebサイト等を検索して構築してください。
|
14
|
+
|
15
|
+
### インストール
|
16
|
+
|
17
|
+
gemでエスカレーターをインストールします。
|
18
|
+
|
19
|
+
```sh
|
20
|
+
$ gem install ladder_drive
|
21
|
+
```
|
22
|
+
|
23
|
+
[![https://gyazo.com/6f00d74612def41fb33d836275b74c24](https://i.gyazo.com/6f00d74612def41fb33d836275b74c24.gif)](https://gyazo.com/6f00d74612def41fb33d836275b74c24)
|
24
|
+
|
25
|
+
### プロジェクト作成
|
26
|
+
|
27
|
+
エスカレーターをインストールするとladder_driveコマンドが使用できる様になります。
|
28
|
+
ladder_driveコマンドでラダーを構成するプロジェクトファイルを作ります。
|
29
|
+
|
30
|
+
```sh
|
31
|
+
$ ladder_drive create my_project
|
32
|
+
$ cd my_project
|
33
|
+
```
|
34
|
+
|
35
|
+
[![https://gyazo.com/c538f66129aa425e2b1da4f478a10f52](https://i.gyazo.com/c538f66129aa425e2b1da4f478a10f52.gif)](https://gyazo.com/c538f66129aa425e2b1da4f478a10f52)
|
36
|
+
|
37
|
+
ファイルの構成は下の様になっています。
|
38
|
+
plc以下にエスカレーターを実行するPLCプロジェクトの雛形があります。
|
39
|
+
現在はエミュレーターと三菱電機のiQ-RシリーズR08CPUのみの対応となっています。
|
40
|
+
他メーカーや他の機種は今後追加する予定です。
|
41
|
+
|
42
|
+
|
43
|
+
```
|
44
|
+
.
|
45
|
+
├── Rakefile
|
46
|
+
├── asm
|
47
|
+
│ └── main.esc
|
48
|
+
├── config
|
49
|
+
│ └── plc.yml
|
50
|
+
└── plc
|
51
|
+
└── mitsubishi
|
52
|
+
└── iq-r
|
53
|
+
└── r08
|
54
|
+
├── LICENSE
|
55
|
+
└── r08.gx3
|
56
|
+
```
|
57
|
+
|
58
|
+
### 通信設定
|
59
|
+
|
60
|
+
#### PLCの通信設定
|
61
|
+
|
62
|
+
plc以下の使用したいPLCのプロジェクトファイルを開きます。
|
63
|
+
IPアドレスなど必要な箇所変更し、PLCに転送します。
|
64
|
+
|
65
|
+
[![](http://img.youtube.com/vi/fGdyIo9AmuE/0.jpg)](https://youtu.be/fGdyIo9AmuE)
|
66
|
+
|
67
|
+
#### エスカレーターの設定
|
68
|
+
|
69
|
+
config/plc.ymlファイルで設定します。
|
70
|
+
|
71
|
+
現在はiQ-Rのみの対応なので:host: 192.168.0.10の行でPLCに設定したIPアドレスを指定するだけで接続できます。
|
72
|
+
|
73
|
+
```
|
74
|
+
# plc.yml
|
75
|
+
plc: # Beginning of PLC section.
|
76
|
+
iq-r: # It's a target name
|
77
|
+
cpu: iq-r # It's just a comment.
|
78
|
+
protocol: mc_protocol # It's a protocol to communicate with PLC.
|
79
|
+
host: 192.168.0.10 # It's PLC's IP address or dns name.
|
80
|
+
port: 5007 # It's PLC's port no.
|
81
|
+
```
|
82
|
+
|
83
|
+
[![](http://img.youtube.com/vi/m0JaOBFIHqw/0.jpg)](https://youtu.be/m0JaOBFIHqw)
|
84
|
+
|
85
|
+
### エスカレータープログラム作成
|
86
|
+
|
87
|
+
エスカレーターのプログラムはasm以下にあります。
|
88
|
+
現在はmain.escファイルから生成します。
|
89
|
+
|
90
|
+
main.escを編集しプログラムを作成します。
|
91
|
+
PLC側の実装がまだ進んでいないので実行できるニーモニックはLD、OUT、AND、ORとその反転程度です。
|
92
|
+
|
93
|
+
ニーモニックについては[Wiki](https://github.com/ito-soft-design/ladder_drive/wiki/mnemonic)の方を参照してください。
|
94
|
+
|
95
|
+
```
|
96
|
+
# main.esc
|
97
|
+
# |M0|-|M1|----(M2)
|
98
|
+
LD M0
|
99
|
+
AND M1
|
100
|
+
OUT M2
|
101
|
+
END
|
102
|
+
```
|
103
|
+
|
104
|
+
[![](http://img.youtube.com/vi/OjaSqrkWv8Q/0.jpg)](https://youtu.be/OjaSqrkWv8Q)
|
105
|
+
|
106
|
+
### プログラムの転送
|
107
|
+
|
108
|
+
エスカレータープログラムをplcに転送するには```rake```コマンドを使用します。
|
109
|
+
デフォルトではエミュレーターが対象になり、エミュレーターが起動します。
|
110
|
+
|
111
|
+
```sh
|
112
|
+
$ rake
|
113
|
+
```
|
114
|
+
|
115
|
+
targetを指定するとplc.ymlのplcセクション内の該当するターゲットが対象になります。
|
116
|
+
|
117
|
+
```sh
|
118
|
+
$ rake target=iq-r
|
119
|
+
```
|
120
|
+
|
121
|
+
plc.ymlファイルのdefaultセクションのtargetでデフォルトのターゲトを設定できます。
|
122
|
+
|
123
|
+
```
|
124
|
+
# plc.yml
|
125
|
+
default:
|
126
|
+
target: iq-r
|
127
|
+
```
|
128
|
+
|
129
|
+
この場合に```rake```を行うと```rake target=iq-r```をしたのと同じになります。
|
130
|
+
|
131
|
+
|
132
|
+
転送後プログラムが実行されます。
|
133
|
+
|
134
|
+
```sh
|
135
|
+
$ rake [target=iq-r]
|
136
|
+
uploading build/main.hex ...
|
137
|
+
launching emulator ...
|
138
|
+
done launching
|
139
|
+
done uploading
|
140
|
+
|
141
|
+
LadderDrive is an abstract PLC.
|
142
|
+
This is a console to communicate with PLC.
|
143
|
+
|
144
|
+
>
|
145
|
+
```
|
146
|
+
|
147
|
+
アップロードが完了するとコンソールモードになります。
|
148
|
+
コンソールモードではコマンドを打つ事でデバイスの読み書きができます。
|
149
|
+
|
150
|
+
デバイスの値を読み取るにはrコマンドを使用します。
|
151
|
+
下の例ではm0から8子分のデバイスを読み出します。
|
152
|
+
|
153
|
+
```sh
|
154
|
+
> r m0 8
|
155
|
+
```
|
156
|
+
|
157
|
+
デバイスに値を書き込むにはwコマンドを使用します。
|
158
|
+
下の例ではM0からM7まで書き込んでいます。
|
159
|
+
|
160
|
+
```sh
|
161
|
+
> w m0 0 0 0 1 1 0 1 1
|
162
|
+
```
|
163
|
+
|
164
|
+
ボタンを押した様にパルス状にデバイスをオンにするにはpコマンドを使用します。
|
165
|
+
|
166
|
+
```sh
|
167
|
+
> p m0
|
168
|
+
```
|
169
|
+
|
170
|
+
オンになる時間をデバイスのあとに指定することもできます。単位は秒です。
|
171
|
+
|
172
|
+
```sh
|
173
|
+
> p m0 1.5
|
174
|
+
```
|
175
|
+
|
176
|
+
```
|
177
|
+
# |M0|---(M1)
|
178
|
+
LD M0
|
179
|
+
OUT M1
|
180
|
+
```
|
181
|
+
|
182
|
+
[![https://gyazo.com/565d24a35887503281a46775f6ccd747](https://i.gyazo.com/565d24a35887503281a46775f6ccd747.gif)](https://gyazo.com/565d24a35887503281a46775f6ccd747)
|
183
|
+
|
184
|
+
<!-- [![](http://img.youtube.com/vi/qGbicGLB7Gs/0.jpg)](https://youtu.be/qGbicGLB7Gs) -->
|
185
|
+
|
186
|
+
## エスカレーターに関する情報
|
187
|
+
|
188
|
+
- [一往確認日記 [ladder_drive]](http://diary.itosoft.com/?category=ladder_drive)
|
189
|
+
- [Wiki](https://github.com/ito-soft-design/ladder_drive/wiki/)
|
190
|
+
|
191
|
+
## ライセンス
|
192
|
+
|
193
|
+
MIT
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "ladder_drive"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/exe/ladder_drive
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Copyright (c) 2016 ITO SOFT DESIGN Inc.
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
14
|
+
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
|
26
|
+
require "ladder_drive"
|
27
|
+
|
28
|
+
LadderDrive::CLI.start
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ladder_drive/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ladder_drive"
|
8
|
+
spec.version = LadderDrive::VERSION
|
9
|
+
spec.authors = ["Katsuyoshi Ito"]
|
10
|
+
spec.email = ["kito@itosoft.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{The ladder_drive is a simple abstract ladder for PLC (Programmable Logic Controller). Formerly known as 'escalator'.}
|
13
|
+
spec.description = %q{We aim to design abstraction ladder which is able to run on any PLC with same ladder source or binary and prepare full stack tools.}
|
14
|
+
spec.homepage = "https://github.com/ito-soft-design/ladder_drive"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.add_dependency "thor"
|
18
|
+
spec.add_runtime_dependency "activesupport", ">=4.2.7"
|
19
|
+
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
|
28
|
+
spec.post_install_message = <<-MESSAGE
|
29
|
+
! The 'ladder_drive' gem has been deprecated and has been replaced by 'ladder_drive'.
|
30
|
+
! See: https://rubygems.org/gems/ladder_drive
|
31
|
+
! And: https://github.com/ito-soft-design/ladder_drive
|
32
|
+
MESSAGE
|
33
|
+
end
|