@teamcymbeline/node-red-contrib-mcprotocol 0.0.0-stage → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -2
- package/connection_pool.js +161 -0
- package/examples/demo.json +1 -0
- package/mcprotocol/LICENSE +22 -0
- package/mcprotocol/README.md +192 -0
- package/mcprotocol/mcprotocol.js +3980 -0
- package/nodes/connection.html +155 -0
- package/nodes/connection.js +59 -0
- package/nodes/icons/connection.png +0 -0
- package/nodes/icons/read.png +0 -0
- package/nodes/icons/read2.png +0 -0
- package/nodes/icons/write.png +0 -0
- package/nodes/read.html +179 -0
- package/nodes/read.js +307 -0
- package/nodes/write.html +185 -0
- package/nodes/write.js +284 -0
- package/package.json +29 -4
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2019, 2020 Steve-Mcl
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
-->
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
.mc-protocol-form > .form-row > label:first-of-type {
|
|
27
|
+
width: 130px !important;
|
|
28
|
+
}
|
|
29
|
+
.mc-protocol-form > .form-row > input {
|
|
30
|
+
width: calc(70% - 30px) !important;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
33
|
+
|
|
34
|
+
<script type="text/html" data-template-name="MC Protocol Connection">
|
|
35
|
+
<div class="mc-protocol-form">
|
|
36
|
+
<div class="form-row">
|
|
37
|
+
<label for="node-input-name"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.name">Name</span></label>
|
|
38
|
+
<input type="text" id="node-config-input-name" placeholder="Name">
|
|
39
|
+
</div>
|
|
40
|
+
<div class="form-row">
|
|
41
|
+
<label for="node-input-host"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.host">Host</span></label>
|
|
42
|
+
<input type="text" id="node-config-input-host" placeholder="192.168.x.x">
|
|
43
|
+
</div>
|
|
44
|
+
<div class="form-row">
|
|
45
|
+
<label for="node-input-port"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.port">Port</span></label>
|
|
46
|
+
<input type="text" id="node-config-input-port" placeholder="9600">
|
|
47
|
+
</div>
|
|
48
|
+
<div class="form-row">
|
|
49
|
+
<label for="node-config-input-frame"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.frame">frame</span></label>
|
|
50
|
+
<select id="node-config-input-frame">
|
|
51
|
+
<option value="1E">1E</option>
|
|
52
|
+
<option value="3E">3E</option>
|
|
53
|
+
<option value="4E">4E</option>
|
|
54
|
+
</select>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="form-row">
|
|
57
|
+
<label for="node-config-input-protocol"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.protocol">protocol</span></label>
|
|
58
|
+
<select id="node-config-input-protocol">
|
|
59
|
+
<option value="TCP">TCP</option>
|
|
60
|
+
<option value="UDP">UDP</option>
|
|
61
|
+
</select>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="form-row">
|
|
64
|
+
<label for="node-config-input-plcType"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.plcType">PLC Type</span></label>
|
|
65
|
+
<select id="node-config-input-plcType">
|
|
66
|
+
<option value="A">A</option>
|
|
67
|
+
<option value="QnA">QnA</option>
|
|
68
|
+
<option value="Q">Q</option>
|
|
69
|
+
<option value="L">L</option>
|
|
70
|
+
<option value="R">R</option>
|
|
71
|
+
</select>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div class="form-row">
|
|
75
|
+
<label for="node-config-input-ascii"> </label>
|
|
76
|
+
<label for="node-config-input-ascii" style="width:70%">
|
|
77
|
+
<input type="checkbox" id="node-config-input-ascii" style="display:inline-block; width:22px; vertical-align:baseline;"><span data-i18n="mcprotocol-read.label.ascii">ascii mode</span>
|
|
78
|
+
</label>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="form-row">
|
|
82
|
+
<label for="node-input-network"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.network">Network No</span></label>
|
|
83
|
+
<input type="text" id="node-config-input-network" placeholder="Default 0 (for 3E / 4E only)">
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div class="form-row">
|
|
87
|
+
<label for="node-input-PCStation"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.PCStation">PC No</span></label>
|
|
88
|
+
<input type="text" id="node-config-input-PCStation" placeholder="0xff">
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="form-row">
|
|
92
|
+
<label for="node-input-PLCModuleNo"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.PLCModuleNo">Dest Module No</span></label>
|
|
93
|
+
<input type="text" id="node-config-input-PLCModuleNo" placeholder="Default 0x3ff (for 3E / 4E only)">
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div class="form-row">
|
|
97
|
+
<label for="node-input-PLCStation"><i class="icon-tag"></i> <span data-i18n="mcprotocol-read.label.PLCStation">Dest Module Stn No</span></label>
|
|
98
|
+
<input type="text" id="node-config-input-PLCStation" placeholder="0x0 for connected station (host station).">
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div class="form-row">
|
|
102
|
+
<label for="node-config-input-octalInputOutput"> </label>
|
|
103
|
+
<label for="node-config-input-octalInputOutput" style="width:70% !important">
|
|
104
|
+
<input type="checkbox" id="node-config-input-octalInputOutput" style="display:inline-block; width:22px; vertical-align:baseline;"><span data-i18n="mcprotocol-read.label.octalInputOutput">Octal Input/Output</span>
|
|
105
|
+
</label>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div class="form-row">
|
|
109
|
+
<label for="node-input-timeout"><i class="fa fa-clock-o"></i> <span data-i18n="mcprotocol-read.label.timeout">Timeout MS</span></label>
|
|
110
|
+
<input type="text" id="node-config-input-timeout" placeholder="1000 ms is recommended timeout">
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
<script type="text/javascript">
|
|
117
|
+
RED.nodes.registerType('MC Protocol Connection', {
|
|
118
|
+
category: 'config',
|
|
119
|
+
color: '#3FADB5',
|
|
120
|
+
icon: "connection.png",
|
|
121
|
+
defaults: {
|
|
122
|
+
name: { value: "" },
|
|
123
|
+
host: { value: "192.168.0.1", required: true },
|
|
124
|
+
port: { value: 5001, required: true, validate: RED.validators.number() },
|
|
125
|
+
protocol: { value: "TCP"},
|
|
126
|
+
frame: { value: "3E"},
|
|
127
|
+
plcType: { value: "Q"},
|
|
128
|
+
ascii: { value: false},
|
|
129
|
+
PLCStation : { value: 0},
|
|
130
|
+
PCStation : { value: undefined},
|
|
131
|
+
PLCModuleNo : { value: undefined},
|
|
132
|
+
network : { value: undefined},
|
|
133
|
+
octalInputOutput : { value: false},
|
|
134
|
+
timeout : { value: 1000},
|
|
135
|
+
|
|
136
|
+
},
|
|
137
|
+
label: function () {
|
|
138
|
+
return this.name || this.host + ":" + this.port || "MC Protocol Connection";
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
</script>
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
<script type="text/html" data-help-name="MC Protocol Connection">
|
|
145
|
+
<p>Configuration for a connection to a Mitsubishi PLC.</p>
|
|
146
|
+
<p>This configuration will create a single connection to the PLC which can
|
|
147
|
+
then be reused by <code>MC Read</code> and <code>MC Read</code> nodes.</p>
|
|
148
|
+
<p></p>
|
|
149
|
+
<h4>NOTES</h4>
|
|
150
|
+
<ul>
|
|
151
|
+
<li>ASCII mode is currently not supported for frames 3E and 4E</li>
|
|
152
|
+
<li>For A series PLC, only 1E frames are supported</li>
|
|
153
|
+
</ul>
|
|
154
|
+
|
|
155
|
+
</script>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2019, 2020 Steve-Mcl
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
function isNumeric(n) {
|
|
26
|
+
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function safeInt(int, def) {
|
|
30
|
+
try {
|
|
31
|
+
if(typeof int == "number") return parseInt(int);
|
|
32
|
+
if(isNumeric(int)) return parseInt(int);
|
|
33
|
+
} catch (e) { }
|
|
34
|
+
return def
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
module.exports = function(RED) {
|
|
38
|
+
function mcConnection(config) {
|
|
39
|
+
RED.nodes.createNode(this, config);
|
|
40
|
+
|
|
41
|
+
this.name = config.name;
|
|
42
|
+
this.host = config.host;
|
|
43
|
+
this.port = config.port;
|
|
44
|
+
this.options = {};
|
|
45
|
+
this.options.protocol = config.protocol ? config.protocol : "TCP";
|
|
46
|
+
this.options.plcType = config.plcType ? config.plcType : "Q";
|
|
47
|
+
this.options.frame = config.frame ? config.frame : "3E";
|
|
48
|
+
this.options.ascii = config.ascii ? config.ascii : false;
|
|
49
|
+
this.options.PLCStation = safeInt(config.PLCStation, 0);
|
|
50
|
+
this.options.PCStation = safeInt(config.PCStation, 0xff);
|
|
51
|
+
this.options.PLCModuleNo = safeInt(config.PLCModuleNo, 0x3ff);
|
|
52
|
+
this.options.network = safeInt(config.network, 0);
|
|
53
|
+
this.options.timeout = safeInt(config.timeout, 1000);
|
|
54
|
+
this.options.octalInputOutput = config.octalInputOutput
|
|
55
|
+
? config.octalInputOutput
|
|
56
|
+
: false;
|
|
57
|
+
}
|
|
58
|
+
RED.nodes.registerType("MC Protocol Connection", mcConnection);
|
|
59
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/nodes/read.html
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2019, 2020 Steve-Mcl
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
-->
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript">
|
|
26
|
+
function setupTypedInput(varName, types, def) {
|
|
27
|
+
let varSel = '#node-input-' + varName;
|
|
28
|
+
let typeSel = varSel + 'Type';
|
|
29
|
+
let varVal = this[varName];
|
|
30
|
+
let typeVal = this[varName + 'Type'];
|
|
31
|
+
|
|
32
|
+
if (typeVal == null || typeVal === 'none') {
|
|
33
|
+
typeVal = def;
|
|
34
|
+
} else if (typeVal === 'string') {
|
|
35
|
+
typeVal = "str";
|
|
36
|
+
} else if (typeVal === 'number') {
|
|
37
|
+
typeVal = "num";
|
|
38
|
+
}
|
|
39
|
+
$(typeSel).val(typeVal);
|
|
40
|
+
$(varSel).typedInput({
|
|
41
|
+
default: def,
|
|
42
|
+
typeField: $(typeSel),
|
|
43
|
+
types: types
|
|
44
|
+
});
|
|
45
|
+
$(varSel).typedInput('type', typeVal);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
RED.nodes.registerType('MC Read', {
|
|
49
|
+
category: 'MITSUBISHI',
|
|
50
|
+
color: '#0090d4',
|
|
51
|
+
defaults: {
|
|
52
|
+
name: { value: "" },
|
|
53
|
+
topic: { value: "" },
|
|
54
|
+
connection: { type: "MC Protocol Connection", required: true },
|
|
55
|
+
address: { value: "", validate: RED.validators.typedInput("addressType") },
|
|
56
|
+
addressType: { value: "str" },
|
|
57
|
+
outputFormat: { value: 0 },
|
|
58
|
+
errorHandling: { value: "throw" },
|
|
59
|
+
outputs: { value: 1 }
|
|
60
|
+
},
|
|
61
|
+
inputs: 1,
|
|
62
|
+
outputs: 1,
|
|
63
|
+
inputLabels: "Trigger request",
|
|
64
|
+
outputLabels: "Returned values",
|
|
65
|
+
align: "left",
|
|
66
|
+
icon: "read.png",
|
|
67
|
+
label: function () {
|
|
68
|
+
return this.name || 'MC Read';
|
|
69
|
+
},
|
|
70
|
+
oneditprepare: function () {
|
|
71
|
+
var sti = setupTypedInput.bind(this);
|
|
72
|
+
sti('address', ['msg', 'flow', 'global', 'str', 'env'], 'str');//addr
|
|
73
|
+
},
|
|
74
|
+
oneditsave: function () {
|
|
75
|
+
var errH = $("#node-input-errorHandling").val();
|
|
76
|
+
this.outputs = errH === "output2" ? 2 : 1;//1 output pins if throw or msg.error, 2 outputs if errors to go to seperate output pin
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style>
|
|
83
|
+
.mc-protocol-form > .form-row > label {
|
|
84
|
+
width: 120px !important;
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
87
|
+
|
|
88
|
+
<script type="text/html" data-template-name="MC Read">
|
|
89
|
+
<div class="mc-protocol-form">
|
|
90
|
+
<div class="form-row">
|
|
91
|
+
<label for="node-input-name"><i class="icon-tag"></i> <span data-i18n="read.label.name"> Name</span></label>
|
|
92
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
|
93
|
+
</div>
|
|
94
|
+
<div class="form-row">
|
|
95
|
+
<label for="node-input-connection"><i class="icon-globe"></i><span data-i18n="read.label.connection"> Connection</span></label>
|
|
96
|
+
<input type="text" id="node-input-connection">
|
|
97
|
+
</div>
|
|
98
|
+
<div class="form-row">
|
|
99
|
+
<label for="node-input-address"><i class="fa fa-envelope"></i><span data-i18n="ab-df1-read.label.address"> Address</span></label>
|
|
100
|
+
<input type="hidden" id="node-input-addressType">
|
|
101
|
+
<input style="width: 70%" type="text" id="node-input-address" placeholder="D0">
|
|
102
|
+
</div>
|
|
103
|
+
<div class="form-row">
|
|
104
|
+
<label for="node-input-outputFormat"><i class="fa fa-sign-out"></i><span data-i18n="ab-df1-read.label.outputFormat"> Output format</span></label>
|
|
105
|
+
<select style="width: 70%" id="node-input-outputFormat">
|
|
106
|
+
<option value="0">JSON Object</option>
|
|
107
|
+
<option value="1">Array</option>
|
|
108
|
+
</select>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="form-row">
|
|
111
|
+
<label for="node-input-errorHandling"><i class="fa fa-exclamation"></i><span data-i18n="ab-df1-read.label.errors"> Errors</span></label>
|
|
112
|
+
<select style="width: 70%" id="node-input-errorHandling">
|
|
113
|
+
<option value="throw">Throw (default)</option>
|
|
114
|
+
<option value="msg">Output to msg.error</option>
|
|
115
|
+
<option value="output2">Send to seperate output</option>
|
|
116
|
+
</select>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<script type="text/html" data-help-name="MC Read">
|
|
123
|
+
<p>Read data from an MITSUBISHI PLCs using MC Protocol</p>
|
|
124
|
+
<h3>Inputs</h3>
|
|
125
|
+
<dl class="message-properties">
|
|
126
|
+
<dt class="required">Connection<span class="property-type">DF1 Connection</span></dt>
|
|
127
|
+
<dd>The PLC connection</dd>
|
|
128
|
+
<dt class="required">Address<span class="property-type">number | string | payload</span></dt>
|
|
129
|
+
<dd>PLC Memory Address</dd>
|
|
130
|
+
<p><i>INFO: To open / close the MC Protocol connection, send boolean <code>true</code> in <code>msg.connect</code> , <code>msg.disconnect</code> or <code>msg.reinitialize</code>. Alternatively, send string <code>connect</code>, <code>disconnect</code> or <code>reinitialize</code> in <code>msg.topic</code> to the any mc read / mc write node.</i></p>
|
|
131
|
+
</dl>
|
|
132
|
+
<h3>Outputs</h3>
|
|
133
|
+
<dl class="message-properties">
|
|
134
|
+
<dt>payload <span class="property-type">array | object</span></dt>
|
|
135
|
+
<dd>the values read from the PLC.</dd>
|
|
136
|
+
<i>To view additional details of the PLC read result, use a debug node to inspect the data</i>
|
|
137
|
+
</dl>
|
|
138
|
+
<h3>Details</h3>
|
|
139
|
+
<p>
|
|
140
|
+
If an error occurs the output of this node may still be triggered.
|
|
141
|
+
In this case, the payload will be <code>null</code> but the <code>mcWriteDetails</code> will contain additional information about the problem.
|
|
142
|
+
</p>
|
|
143
|
+
<p>Address format [DS] DEV [DT] DN [.BIT] [,CNT] [:OPTS]...
|
|
144
|
+
<ol>
|
|
145
|
+
<li>[1] DS - {string} Digit specifier (e.g. K4) [optional]</li>
|
|
146
|
+
<li>[2] DEV - {string} Device (Y|X|D|F|W|B|R|etc)</li>
|
|
147
|
+
<li>[3] DT - {string} Data type (REAL|FLOAT|STR|WORD|DWORD|DINT|UINT) [optional]</li>
|
|
148
|
+
<li>[4] DN - {int} Device number</li>
|
|
149
|
+
<li>[5] BIT - {int} Bit number [optional]</li>
|
|
150
|
+
<li>[6] CNT - {int} Count of items [optional]</li>
|
|
151
|
+
<li>[7] OPTS - {JSON} Options for specifying network and station e.g. {N:2,S:3} would attempt to route the message to station 3 on network 2 [optional]</li>
|
|
152
|
+
</ol>
|
|
153
|
+
<i>Notes...<br>DS and DT should not be used together. <br>if CNT is omitted, then <code>1</code> is assumed. <br>DN may be DEC or HEX depending on the notation of the Device e.g. YA, X1E, WBA4, B3D </i>
|
|
154
|
+
</p>
|
|
155
|
+
<p>data returned will match the address specified e.g...
|
|
156
|
+
<table>
|
|
157
|
+
<tr>
|
|
158
|
+
<td>Address Example</td>
|
|
159
|
+
<td>Data Type</td>
|
|
160
|
+
<td>Notes</td>
|
|
161
|
+
</tr>
|
|
162
|
+
<tr>
|
|
163
|
+
<td>K4Y0</td>
|
|
164
|
+
<td>int</td>
|
|
165
|
+
<td>−32,768 to 32,767</td>
|
|
166
|
+
</tr>
|
|
167
|
+
<tr>
|
|
168
|
+
<td>DSTR0,10</td>
|
|
169
|
+
<td>string</td>
|
|
170
|
+
<td>Up to 10 chars long</td>
|
|
171
|
+
</tr>
|
|
172
|
+
<tr>
|
|
173
|
+
<td>DUINT0,10</td>
|
|
174
|
+
<td>UINT[10]</td>
|
|
175
|
+
<td>10 WD array containing values 0 to 65535</td>
|
|
176
|
+
</tr>
|
|
177
|
+
</table>
|
|
178
|
+
</p>
|
|
179
|
+
</script>
|