├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
├── red
├── locales
│ ├── de
│ │ └── s7.json
│ └── en-US
│ │ └── s7.json
├── s7.html
└── s7.js
├── src
└── tools.js
└── test
└── flow_writeTest.json
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | ### Describe the bug
11 | A clear and concise description of what the bug is.
12 |
13 | ### To Reproduce
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | ### Expected behavior
21 | A clear and concise description of what you expected to happen.
22 |
23 | ### Screenshots
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | ### Logs
27 | If applicable, attach the Node-RED logs with the "Verbose" option on the configuration node set to "On"
28 |
29 | ### Flow
30 | Please attach your flow either as a file or properly formatted as JSON
31 |
32 | ### Environment
33 | - **Version** of this node: [e.g. 2.1.1]
34 | - **Node-RED version**: [e.g. 1.0.3]
35 | - **PLC Part Number**: [e.g. 6E57-... ]
36 | - **OS**: [e.g. Windows 10, Ubuntu]
37 | - **Browser**: [e.g. chrome, safari]
38 |
39 | ### Additional context
40 | Add any other context about the problem here.
41 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Directory for instrumented libs generated by jscoverage/JSCover
11 | lib-cov
12 |
13 | # Coverage directory used by tools like istanbul
14 | coverage
15 |
16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17 | .grunt
18 |
19 | # Compiled binary addons (http://nodejs.org/api/addons.html)
20 | build/Release
21 |
22 | # Dependency directory
23 | # Deployed apps should consider commenting this line out:
24 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
25 | node_modules
26 |
27 | # out temp folder
28 | temp/
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | Version: 3.0.0
2 | ------------
3 | - Migrate underlying library to @st-one-io/node-s7
4 | - Remove optional dependency on mpi-s7 (project is now split into this and `node-red-contrib-mpi-s7`)
5 | - Added tag validation on the editor
6 |
7 | Version: 2.2.1
8 | ------------
9 | - Fixes and improve PLC discovery UI
10 |
11 | Version: 2.2.0
12 | ------------
13 | - Adds support to `DT`, `DTZ`, `DTL` and `DTLZ` data types
14 |
15 | Version: 2.1.1
16 | ------------
17 | - Updates dependency of nodes7 - fixes sequence collision bug
18 |
19 | Version: 2.1.0
20 | ------------
21 | - Adds support for Node-RED 1.0 API
22 | - Changes node's category to "plc"
23 | - Implements discovery of ethernet PLCs
24 |
25 | Version: 2.0.2
26 | ------------
27 | - Fixes #49 - fixes regression introduced in 2.0.1 that prevented writing to array of vars
28 |
29 | Version: 2.0.1
30 | ------------
31 | - Fixes #48 - prevents exception being thrown when writing to unknown variables
32 |
33 | Version: 2.0.0
34 | ------------
35 | - Adds support for MPI-USB adapters as transport for connecting to PLCs
36 |
37 | Version: 1.6.3
38 | ------------
39 | - l10n - Fix translation code for German
40 |
41 | Version: 1.6.2
42 | ------------
43 | - l10n - Add translations to German
44 |
45 | Version: 1.6.1
46 | ------------
47 | - Bumps dependency of nodes7
48 |
49 | Version: 1.6.0
50 | ------------
51 | - Implements "s7 control" node, currently for manual control of the cycle time
52 |
53 | Version: 1.5.3
54 | ------------
55 | - Fixes #33: handle diff of array types, so they're emitted only when an item changes
56 |
57 | Version: 1.5.2
58 | ------------
59 | - Skip cyclic reading of variables if there's none configured
60 |
61 | Version: 1.5.1
62 | ------------
63 | - Avoids trying to connect again after closing the node
64 |
65 | Version: 1.5.0
66 | ------------
67 | - Enables errors to be catch by the "catch" node (#17)
68 | - Implements "connecting" status - thanks @CarstenMaul (#19)
69 | - Fixes connection leak introduced on 1.3.1
70 |
71 | Version: 1.4.1
72 | ------------
73 | - Fixes #11: Correctly parses tsap values and improve validation
74 |
75 | Version: 1.4.0
76 | ------------
77 | - Implements configuration option to set library's debug independently from Node-RED
78 | - Sets timeout and TSAP defaults to old configs without them
79 |
80 | Version: 1.3.1
81 | ------------
82 | - Force a connection restart if we receive no callback response within 10 tries
83 | - Retry to connect to PLC if failing to connect on flow deploy
84 | - Improve logging
85 |
86 | Version: 1.3.0
87 | ------------
88 | - Implements ability to connect to PLC using local/remote TSAP instead of rack and slot only
89 |
90 | Version: 1.2.0
91 | ------------
92 | - Implements buttons to import and export the variable list in the S7 Eenpoint node
93 |
94 | Version: 1.1.2
95 | ------------
96 | - Fixes #4: Avoid EventEmitter warnings when lots of S7In nodes are used
97 |
98 | Version: 1.1.1
99 | ------------
100 | - Fix default value of new timeout configuration
101 |
102 | Version: 1.1.0
103 | ------------
104 | - Implement timeout parameter, as we may have higher delays than the default one in unstable networks
105 |
106 | Version: 1.0.1
107 | ------------
108 | - Fixes alignment of s7 write node
109 |
110 | Version: 1.0.0
111 | ------------
112 | Major Release
113 | - Implements s7 write node
114 |
115 | Version: 0.2.4
116 | ------------
117 | - Enable underlying nodes7's logging when NodeRED is run in verbose mode (either with -v or at settings.js)
118 |
119 | Version: 0.2.3
120 | ------------
121 | - [BUGFIX] - memory leak on __STATUS__ event that was registered on the endpoint node but never removed
122 | - [BUGFIX] - show the endpoint label if mode:single but no variable configured, label was empty
123 | - Defer the reading cycle if the previous reading hasn't returned yet. This prevents queuing a lot of read requests in the stack
124 | - Displays the variable's address in the config of the S7 In node for information purposes only
125 |
126 | Version: 0.2.2
127 | ------------
128 | - Replace arrow founction with standard function, so we're backwards compatible with previous versions of Node.JS
129 |
130 | Version: 0.2.1
131 | ------------
132 | - Add repository/bugs information to package.json
133 |
134 | Version: 0.2.0
135 | ------------
136 | - Implements new reading mode "All variables, one per message"
137 | - Help text of the in node rewritten
138 | - s7 endpoint now stores the variable as an array, not as stringified JSON. Backwards compatible.
139 |
140 | Version: 0.1.1
141 | ------------
142 | - [BUGFIX] Fix require of EventEmitter (#1)
143 |
144 | Version: 0.1.0
145 | ------------
146 | - Initial release
147 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # node-red-contrib-s7
2 | A Node-RED node to interact with Siemens S7 PLCs.
3 |
4 | This node was created as part of the [ST-One](https://st-one.io) project.
5 |
6 |
7 | ## Install
8 |
9 | You can install this node directly from the "Manage Palette" menu in the Node-RED interface.
10 |
11 | Alternatively, run the following command in your Node-RED user directory - typically `~/.node-red` on Linux or `%HOMEPATH%\.nodered` on Windows
12 |
13 | npm install node-red-contrib-s7
14 |
15 | NodeJS version 10 or greater and Node-RED version 1.0 or greater is required.
16 |
17 |
18 | ## Usage
19 |
20 | Each connection to a PLC is represented by the **S7 Endpoint** configuration node. You can configure the PLC's Address, the variables available and their addresses, and the cycle time for reading the variables.
21 |
22 | The **S7 In** node makes the variable's values available in a flow in three different modes:
23 |
24 | * **Single variable:** A single variable can be selected from the configured variables, and a message is sent every cycle, or only when it changes if _diff_ is checked. `msg.payload` contains the variable's value and `msg.topic` has the variable's name.
25 | * **All variables, one per message:** Like the _Single variable_ mode, but for all variables configured. If _diff_ is checked, a message is sent everytime any variable changes. If _diff_ is unchecked, one message is sent for every variable, in every cycle. Care must be taken about the number of messages per second in this mode.
26 | * **All variables:** In this mode, `msg.payload` contains an object with all configured variables and their values. If _diff_ is checked, a message is sent if at least one of the variables changes its value.
27 |
28 |
29 | ### Variable addressing
30 |
31 | The variables and their addresses configured on the **S7 Endpoint** follow a slightly different scheme than used on Step 7 or TIA Portal. Here are some examples that may guide you on addressing your variables:
32 |
33 | | Address | Step7 equivalent | JS Data type | Description |
34 | | ----------------------------- | --------------------- | ------------- | ----------- |
35 | | `DB5,X0.1` | `DB5.DBX0.1` | Boolean | Bit 1 of byte 0 of DB 5 |
36 | | `DB23,B1` or `DB23,BYTE1` | `DB23.DBB1` | Number | Byte 1 (0-255) of DB 23 |
37 | | `DB100,C2` or `DB100,CHAR2` | `DB100.DBB2` | String | Byte 2 of DB 100 as a Char |
38 | | `DB42,I3` or `DB42,INT3` | `DB42.DBW3` | Number | Signed 16-bit number at byte 3 of DB 42 |
39 | | `DB57,WORD4` | `DB57.DBW4` | Number | Unsigned 16-bit number at byte 4 of DB 57 |
40 | | `DB13,DI5` or `DB13,DINT5` | `DB13.DBD5` | Number | Signed 32-bit number at byte 5 of DB 13 |
41 | | `DB19,DW6` or `DB19,DWORD6` | `DB19.DBD6` | Number | Unsigned 32-bit number at byte 6 of DB 19 |
42 | | `DB21,R7` or `DB21,REAL7` | `DB21.DBD7` | Number | Floating point 32-bit number at byte 7 of DB 21 |
43 | | `DB2,S7.10`* | - | String | String of length 10 starting at byte 7 of DB 2 |
44 | | `I1.0` or `E1.0` | `I1.0` or `E1.0` | Boolean | Bit 0 of byte 1 of input area |
45 | | `Q2.1` or `A2.1` | `Q2.1` or `A2.1` | Boolean | Bit 1 of byte 2 of output area |
46 | | `M3.2` | `M3.2` | Boolean | Bit 2 of byte 3 of memory area |
47 | | `IB4` or `EB4` | `IB4` or `EB4` | Number | Byte 4 (0 -255) of input area |
48 | | `QB5` or `AB5` | `QB5` or `AB5` | Number | Byte 5 (0 -255) of output area |
49 | | `MB6` | `MB6` | Number | Byte 6 (0 -255) of memory area |
50 | | `IC7` or `EC7` | `IB7` or `EB7` | String | Byte 7 of input area as a Char |
51 | | `QC8` or `AC8` | `QB8` or `AB8` | String | Byte 8 of output area as a Char |
52 | | `MC9` | `MB9` | String | Byte 9 of memory area as a Char |
53 | | `II10` or `EI10` | `IW10` or `EW10` | Number | Signed 16-bit number at byte 10 of input area |
54 | | `QI12` or `AI12` | `QW12` or `AW12` | Number | Signed 16-bit number at byte 12 of output area |
55 | | `MI14` | `MW14` | Number | Signed 16-bit number at byte 14 of memory area |
56 | | `IW16` or `EW16` | `IW16` or `EW16` | Number | Unsigned 16-bit number at byte 16 of input area |
57 | | `QW18` or `AW18` | `QW18` or `AW18` | Number | Unsigned 16-bit number at byte 18 of output area |
58 | | `MW20` | `MW20` | Number | Unsigned 16-bit number at byte 20 of memory area |
59 | | `IDI22` or `EDI22` | `ID22` or `ED22` | Number | Signed 32-bit number at byte 22 of input area |
60 | | `QDI24` or `ADI24` | `QD24` or `AD24` | Number | Signed 32-bit number at byte 24 of output area |
61 | | `MDI26` | `MD26` | Number | Signed 32-bit number at byte 26 of memory area |
62 | | `ID28` or `ED28` | `ID28` or `ED28` | Number | Unsigned 32-bit number at byte 28 of input area |
63 | | `QD30` or `AD30` | `QD30` or `AD30` | Number | Unsigned 32-bit number at byte 30 of output area |
64 | | `MD32` | `MD32` | Number | Unsigned 32-bit number at byte 32 of memory area |
65 | | `IR34` or `ER34` | `IR34` or `ER34` | Number | Floating point 32-bit number at byte 34 of input area |
66 | | `QR36` or `AR36` | `QR36` or `AR36` | Number | Floating point 32-bit number at byte 36 of output area |
67 | | `MR38` | `MR38` | Number | Floating point 32-bit number at byte 38 of memory area |
68 | | `DB1,DT0` | - | Date** | A timestamp in the DATE_AND_TIME format |
69 | | `DB1,DTZ10` | - | Date** | A timestamp in the DATE_AND_TIME format, in UTC |
70 | | `DB2,DTL2` | - | Date** | A timestamp in the DTL format |
71 | | `DB2,DTLZ12` | - | Date** | A timestamp in the DTL format, in UTC |
72 | | `DB57,RWORD4` | `DB57.DBW4` | Number | Unsigned 16-bit number at byte 4 of DB 57, interpreted as Little-Endian |
73 | | `DB13,RDI5` or `DB13,RDINT5` | `DB13.DBD5` | Number | Signed 32-bit number at byte 5 of DB 13, interpreted as Little-Endian |
74 | | `MRW20` | `MW20` | Number | Unsigned 16-bit number at byte 20 of memory area, interpreted as Little-Endian |
75 |
76 |
77 | - *) Note that strings on the PLC uses 2 extra bytes at start for size/length of the string
78 | - **) Note that javascript's `Date` are _always_ represented in UTC. Please use other nodes like [node-red-contrib-moment](https://flows.nodered.org/node/node-red-contrib-moment) to properly handle type conversions
79 |
80 |
81 | ### Notes on S7-1200/1500
82 |
83 | These newer PLCs offer an "extended" version of the S7 Protocol, while we have only a "basic" version of it.
84 |
85 | Therefore, some additional configuration steps on the PLC are necessary:
86 | - "Optimized block access" must be disabled for the DBs we want to access ([image](http://snap7.sourceforge.net/snap7_client_file/db_1500.bmp))
87 | - In the "Protection" section of the CPU Properties, enable the "Permit access with PUT/GET" checkbox ([image](http://snap7.sourceforge.net/snap7_client_file/cpu_1500.bmp))
88 |
89 |
90 | ### Notes on Logo! 8
91 |
92 | On the newest Logo! 8.FS4 (and possibly 0BA8) Logic modules there is no need to set the Mode to TSAP any more, instead the default Rack/Slot value of 0/2 works just fine.
93 |
94 | The following table shows memory areas accessible without additional settings in the controller program:
95 |
96 | *Note: These memory areas seem to be read-only from outside the controller, as they are directly used by the function blocks listed in "Logo Block" of the table*
97 |
98 | | Logo Block | Logo VM Range | example Node-RED address | Description |
99 | |------------|---------------|---------------------------------------------------|-------------|
100 | | `I` | `1024 - 1031` | `DB1,BYTE1024` or `DB1,X1024.5` or `DB1,WORD1024` | Reads input terminals 1...8 or 6 or 1...16 |
101 | | `AI` | `1032 - 1063` | `DB1,WORD1032` | Reads analog input terminal 1. Always word sized. |
102 | | `Q` | `1064 - 1071` | `DB1,BYTE1064` or `DB1,X1064.5` or `DB1,WORD1064` | Reads output terminals 1...8 or 6 or 1...16 |
103 | | `AQ` | `1072 - 1103` | `DB1,WORD1072` | Reads analog output terminal 1. Always word sized. |
104 | | `M` | `1104 - 1117` | `DB1,BYTE1104` or `DB1,X1104.5` or `DB1,WORD1104` | Reads bit flags M1...M8 or M6 or M1...16 |
105 | | `AM` | `1118 - 1245` | `DB1,WORD1118` | Reads analog flag 1. Always word sized. |
106 | | `NI` | `1246 - 1061` | `DB1,BYTE1246` or `DB1,X1246.5` or `DB1,WORD1246` | Reads network input 1...8 or 6 or 1...16 |
107 | | `NAI` | `1262 - 1389` | `DB1,WORD1262` | Reads analog network input 1. Always word sized. |
108 | | `NQ` | `1390 - 1405` | `DB1,BYTE1390` or `DB1,X1390.5` or `DB1,WORD1390` | Reads network output 1...8 or 6 or 1...16 |
109 | | `NAQ` | `1406 - 1469` | `DB1,WORD1406` | Reads network output 1. Always word sized. |
110 |
111 | On the other hand, Logo memory areas VM 0-849 are mutable from outside the controller, but they need to be mapped into the Logo program. Without mapping, data written into these addresses will have no effect on program execution. Used VM addresses in the range mentioned above can be read/written from/into in the Logo program using the "Network" function blocks (in the function block setup use the *"Local variable memory (VM)"* option to map VMs to the function block).
112 |
113 | Some addressing examples:
114 |
115 | | Logo VM | Example Node-RED address | Description |
116 | |---------|--------------------------|-------------|
117 | | `0` | `DB1,BYTE0` | R/W access |
118 | | `1` | `DB1,X1.3` | R/W access Note: use booleans |
119 | | `2..3` | `DB1,WORD2` | R/W access |
120 | | `4..7` | `DB1,DWORD4` | R/W access |
121 |
122 |
123 | ## Bugs and enhancements
124 |
125 | Please share your ideas and experiences on the [Node-RED forum](https://discourse.nodered.org/), or open an issue on the [page of the project on GitHub](https://github.com/st-one-io/node-red-contrib-s7)
126 |
127 |
128 | ## Support
129 |
130 | Community support is offered on a best-effort basis via GitHub Issues. For commercial support, please contact us by sending an e-mail to [st-one@st-one.io](mailto:st-one@st-one.io).
131 |
132 |
133 | ## License
134 | Copyright: (c) 2016-2022, ST-One Ltda., Guilherme Francescon Cittolin
135 |
136 | GNU General Public License v3.0+ (see [LICENSE](LICENSE) or https://www.gnu.org/licenses/gpl-3.0.txt)
137 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "node-red-contrib-s7",
3 | "version": "3.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@st-one-io/nodes7": {
8 | "version": "1.0.0-beta.1",
9 | "resolved": "https://registry.npmjs.org/@st-one-io/nodes7/-/nodes7-1.0.0-beta.1.tgz",
10 | "integrity": "sha512-efz2Mvt1S7PYjBYAcr5Z8E1WvOLfuvF28Dgh15i67xVFdYWo95yQrydANadjUPR8REBaHPyDYOutbCKkzyyCeA==",
11 | "requires": {
12 | "iso-on-tcp": "^0.1.0"
13 | }
14 | },
15 | "iso-on-tcp": {
16 | "version": "0.1.0",
17 | "resolved": "https://registry.npmjs.org/iso-on-tcp/-/iso-on-tcp-0.1.0.tgz",
18 | "integrity": "sha512-ty4/0A+4qW35QoPE74GfUiMtIBtTN4ZENNqfD0+5GQIoOnjLvmzCC1pCRWwlhopdSGZGmza9bBxdOuVmzlpN7g=="
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "node-red-contrib-s7",
3 | "version": "3.1.0",
4 | "description": "A Node-RED node to interact with Siemens S7 PLCs",
5 | "main": "index.js",
6 | "dependencies": {
7 | "@st-one-io/nodes7": "1.1.0"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/st-one-io/node-red-contrib-s7.git"
12 | },
13 | "bugs": {
14 | "url": "https://github.com/st-one-io/node-red-contrib-s7/issues"
15 | },
16 | "scripts": {
17 | "test": "echo \"Error: no test specified\" && exit 1"
18 | },
19 | "keywords": [
20 | "hardware",
21 | "s7",
22 | "logo",
23 | "siemens",
24 | "plc",
25 | "profinet",
26 | "node-red"
27 | ],
28 | "node-red": {
29 | "nodes": {
30 | "s7": "red/s7.js"
31 | }
32 | },
33 | "author": "ST-One Ltda.",
34 | "license": "GPL-3.0-or-later"
35 | }
36 |
--------------------------------------------------------------------------------
/red/locales/de/s7.json:
--------------------------------------------------------------------------------
1 | {
2 | "s7": {
3 | "in": {
4 | "label": {
5 | "name": "s7 in",
6 | "endpoint": "SPS",
7 | "mode": "Modus",
8 | "variable": "Variable",
9 | "diff": "Sende nur bei Wertänderung (diff)",
10 | "variable-select": "Variable auswählen",
11 | "variable-novar": "Keine Variablen"
12 | },
13 | "mode": {
14 | "single": "Einzelne Variable",
15 | "all-split": "Alle Variablen, eine pro Nachricht",
16 | "all": "Alle Variablen"
17 | }
18 | },
19 | "out": {
20 | "label": {
21 | "name": "s7 out",
22 | "endpoint": "SPS",
23 | "variable": "Variable",
24 | "variable-select": "Variable auswählen"
25 | },
26 | "disclaimer": "Vorsicht beim Schreiben auf produktiven Steuerungen!"
27 | },
28 | "control": {
29 | "label": {
30 | "name": "s7 Steuerung",
31 | "function": "Funktion",
32 | "endpoint": "SPS"
33 | },
34 | "function": {
35 | "cycletime": "Zykluszeit",
36 | "trigger": "Lesen auslösen"
37 | }
38 | },
39 | "endpoint": {
40 | "label": {
41 | "transport": "Transport",
42 | "address": "IP Adresse",
43 | "port": "Port",
44 | "connmode": "Modus",
45 | "rack": "Rack",
46 | "slot": "Slot",
47 | "tsap-local": "Local TSAP",
48 | "tsap-remote": "Remote TSAP",
49 | "cycletime": "Zykluszeit",
50 | "timeout": "Timeout",
51 | "verbose": "Debug",
52 | "adapter": "Adapter",
53 | "adapterplaceholder": "Bitte 'node-red-contrib-mpi-s7' installieren",
54 | "busaddr": "Adresse",
55 | "search": "Suchen",
56 | "flash-led": "LED Blinken",
57 | "tabs": {
58 | "connection": "Verbindung",
59 | "variables": "Variablen"
60 | },
61 | "variables": {
62 | "list": "Variablen Liste",
63 | "add": "Hinzufügen",
64 | "clean": "Alle Entfernen",
65 | "del": "Entfernen",
66 | "name": "Name",
67 | "addr": "Adresse",
68 | "export": "Export",
69 | "import": "Import"
70 | }
71 | },
72 | "placeholder": {
73 | "address": "IP Adresse oder FQDN (plc01.example.com)"
74 | },
75 | "transport": {
76 | "iso-on-tcp": "Ethernet (ISO-on-TCP)",
77 | "mpi-s7": "MPI/PPI/DP Adapter"
78 | },
79 | "connmode": {
80 | "rack-slot": "Rack/Slot",
81 | "tsap": "TSAP"
82 | },
83 | "status": {
84 | "online": "online",
85 | "badvalues": "fehlerhaft",
86 | "offline": "offline",
87 | "unknown": "unbekannt",
88 | "connecting": "verbinde"
89 | }
90 | },
91 | "label": {
92 | "name": "Name",
93 | "select": "Gerät wählen"
94 | },
95 | "error": {
96 | "onconnect": "Fehler beim Verbinden: ",
97 | "missingconfig": "Fehlende Konfiguration",
98 | "varunknown": "Unbekannte Variable '__var__'",
99 | "valmismatch": "Anzahl von Daten und Variablen passen nicht",
100 | "noresponse": "Keine Antwort, Neustart der Kommunikation",
101 | "invalidconntype": "Ungültiger Konfigurationstyp \"__connmode__\"",
102 | "invalidtransport": "Ungültiger Transport \"__transport__\"",
103 | "invalidtsap": "Ungültige TSAP Konfiguration",
104 | "invalidtimeinterval": "Ungültige Zeitspanne für Zykluszeit von \"__interval__\"",
105 | "invalidcontrolfunction": "Ungültige Kontrollfunktion \"__function__\""
106 | },
107 | "info": {
108 | "connect": "Initialisiere Verbindung zur SPS",
109 | "disconnect": "Schließe Verbindung zur SPS",
110 | "novars": "Keine Variablen konfiguriert, überspringe Lesezyklus",
111 | "cycletimetooshort": "Zykluszeit zu kurz, erzwinge Minimum von __min__ ms"
112 | },
113 | "validation": {
114 | "ERR_PARSE_EMPTY": "Adresse kann nich leer sein",
115 | "ERR_PARSE_UNKNOWN_FORMAT": "Unbekanntes Format, bitte Hilfetext überprüfen",
116 | "ERR_PARSE_ADDR_OFFSET": "Byte offset ist ungültig",
117 | "ERR_PARSE_DB_NUMBER": "DB nummer ist unbekannt oder ungültig",
118 | "ERR_PARSE_DB_DATATYPE": "Datatyp von DB Bereich ist unbekannt oder ungültig",
119 | "ERR_PARSE_AREA": "Bereich ist unbekannt oder ungültig",
120 | "ERR_PARSE_DATATYPE": "Datatyp ist unbekannt oder ungültig",
121 | "ERR_PARSE_BIT_OFFSET": "Bit offset fehlt oder ist ungültig",
122 | "ERR_PARSE_STRING_LEN": "String Länge fehlt oder ist ungültig",
123 | "ERR_PARSE_INVALID_BIT_OFFSET": "Bit offset bei Datentyp nicht unterstützt",
124 | "ERR_PARSE_INVALID_ARR_LEN": "Ungülgige Array Länge"
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/red/locales/en-US/s7.json:
--------------------------------------------------------------------------------
1 | {
2 | "s7": {
3 | "in": {
4 | "label": {
5 | "name": "s7 in",
6 | "endpoint": "PLC",
7 | "mode": "Mode",
8 | "variable": "Variable",
9 | "diff": "Emit only when value changes (diff)",
10 | "variable-select": "Select a variable",
11 | "variable-novar": "No variables"
12 | },
13 | "mode": {
14 | "single": "Single variable",
15 | "all-split": "All variables, one per message",
16 | "all": "All variables"
17 | }
18 | },
19 | "out": {
20 | "label": {
21 | "name": "s7 out",
22 | "endpoint": "PLC",
23 | "variable": "Variable",
24 | "variable-select": "Select a variable"
25 | },
26 | "disclaimer": "Caution when writing data to production PLCs!"
27 | },
28 | "control": {
29 | "label": {
30 | "name": "s7 control",
31 | "function": "Function",
32 | "endpoint": "PLC"
33 | },
34 | "function": {
35 | "cycletime": "Cycle time",
36 | "trigger": "Trigger read"
37 | }
38 | },
39 | "endpoint": {
40 | "label": {
41 | "transport": "Transport",
42 | "address": "Address",
43 | "port": "Port",
44 | "connmode": "Mode",
45 | "rack": "Rack",
46 | "slot": "Slot",
47 | "tsap-local": "Local TSAP",
48 | "tsap-remote": "Remote TSAP",
49 | "cycletime": "Cycle time",
50 | "timeout": "Timeout",
51 | "verbose": "Debug",
52 | "adapter": "Adapter",
53 | "adapterplaceholder": "Please install 'node-red-contrib-mpi-s7' for MPI/PPI/DP support",
54 | "busaddr": "Address",
55 | "search": "Search",
56 | "flash-led": "Flash LED",
57 | "tabs": {
58 | "connection": "Connection",
59 | "variables": "Variables"
60 | },
61 | "variables": {
62 | "list": "Variable list",
63 | "add": "Add",
64 | "clean": "Remove all",
65 | "del": "Remove",
66 | "name": "Name",
67 | "addr": "Address",
68 | "export": "Export",
69 | "import": "Import"
70 | }
71 | },
72 | "placeholder": {
73 | "address": "IP Address or FQDN (plc01.example.com)"
74 | },
75 | "transport": {
76 | "iso-on-tcp": "Ethernet (ISO-on-TCP)",
77 | "mpi-s7": "MPI/PPI/DP Adapter"
78 | },
79 | "connmode": {
80 | "rack-slot": "Rack/Slot",
81 | "tsap": "TSAP"
82 | },
83 | "status": {
84 | "online": "online",
85 | "badvalues": "failure",
86 | "offline": "offline",
87 | "unknown": "unknown",
88 | "connecting": "connecting"
89 | }
90 | },
91 | "label": {
92 | "name": "Name",
93 | "select": "Select a device"
94 | },
95 | "error": {
96 | "onconnect": "Error connecting to PLC: ",
97 | "missingconfig": "Missing configuration",
98 | "varunknown": "Unknown variable '__var__'",
99 | "valmismatch": "Amount of variables and data mismatch",
100 | "noresponse": "No response from PLC, restarting communication",
101 | "invalidconntype": "Invalid configuration type \"__connmode__\"",
102 | "invalidtransport": "Invalid transport \"__transport__\"",
103 | "invalidtsap": "Invalid TSAP configuration",
104 | "invalidtimeinterval": "Invalid time interval for cycle time of \"__interval__\"",
105 | "invalidcontrolfunction": "Invalid control function \"__function__\""
106 | },
107 | "info": {
108 | "connect": "Initiating connection to PLC",
109 | "disconnect": "Closing connection to PLC",
110 | "novars": "No variables configured, skipping cyclic reading",
111 | "cycletimetooshort": "Cycle time too short, enforcing minimum of __min__ ms"
112 | },
113 | "validation": {
114 | "ERR_PARSE_EMPTY": "Address cannot be empty",
115 | "ERR_PARSE_UNKNOWN_FORMAT": "Unknown address format, check node's help section",
116 | "ERR_PARSE_ADDR_OFFSET": "Byte offset is invalid",
117 | "ERR_PARSE_DB_NUMBER": "Number of DB is unknown or invalid",
118 | "ERR_PARSE_DB_DATATYPE": "Data type of DB area is unknown or invalid",
119 | "ERR_PARSE_AREA": "Area addressed is unknown or invalid",
120 | "ERR_PARSE_DATATYPE": "Data type is unknown or invalid",
121 | "ERR_PARSE_BIT_OFFSET": "Bit offset is missing or is invalid",
122 | "ERR_PARSE_STRING_LEN": "String length is missing or is invalid",
123 | "ERR_PARSE_INVALID_BIT_OFFSET": "Bit offset not supported for this type",
124 | "ERR_PARSE_INVALID_ARR_LEN": "Array length specified is invalid"
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/red/s7.html:
--------------------------------------------------------------------------------
1 |
5 |
6 |
93 |
94 |
449 |
450 |
454 |
455 |
1026 |
1027 |
1028 |
1029 |
1058 |
1059 |
1105 |
1106 |
1206 |
1207 |
1208 |
1209 |
1226 |
1227 |
1266 |
1267 |
1354 |
1355 |
1356 |
1357 |
1375 |
1376 |
1404 |
1405 |
1445 |
--------------------------------------------------------------------------------
/red/s7.js:
--------------------------------------------------------------------------------
1 | //@ts-check
2 | /*
3 | Copyright: (c) 2016-2020, St-One Ltda., Guilherme Francescon Cittolin
4 | GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
5 | */
6 |
7 | function nrInputShim(node, fn) {
8 | node.on('input', function (msg, send, done) {
9 | send = send || node.send;
10 | done = done || (err => err && node.error(err, msg));
11 | fn(msg, send, done);
12 | });
13 | }
14 |
15 | /**
16 | * Compares values for equality, includes special handling for arrays. Fixes #33
17 | * @param {number|string|Array|Date} a
18 | * @param {number|string|Array|Date} b
19 | */
20 | function equals(a, b) {
21 | if (a === b) return true;
22 | if (a == null || b == null) return false;
23 | if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();
24 | if (Array.isArray(a) && Array.isArray(b)) {
25 | if (a.length != b.length) return false;
26 |
27 | for (var i = 0; i < a.length; ++i) {
28 | if (a[i] !== b[i]) return false;
29 | }
30 | return true;
31 | }
32 | return false;
33 | }
34 |
35 | var MIN_CYCLE_TIME = 50;
36 |
37 | var tools = require('../src/tools.js');
38 |
39 | module.exports = function (RED) {
40 | "use strict";
41 |
42 | var nodes7 = require('@st-one-io/nodes7');
43 | var EventEmitter = require('events').EventEmitter;
44 |
45 | // ---------- Discovery Endpoints ----------
46 |
47 | RED.httpAdmin.get('/__node-red-contrib-s7/discover/available/iso-on-tcp', RED.auth.needsPermission('s7.discover'), function (req, res) {
48 | tools.isPnToolsAvailable().then(function (available) {
49 | res.json(available).end();
50 | }).catch(() => {
51 | res.status(500).end();
52 | });
53 | });
54 |
55 | RED.httpAdmin.get('/__node-red-contrib-s7/discover/iso-on-tcp', RED.auth.needsPermission('s7.discover'), function (req, res) {
56 | tools.listDevicesPN().then(function (devices) {
57 | res.json(devices).end();
58 | }).catch(() => {
59 | res.status(500).end();
60 | });
61 | });
62 |
63 | RED.httpAdmin.get('/__node-red-contrib-s7/flashled/iso-on-tcp/:mac', RED.auth.needsPermission('s7.discover'), function (req, res) {
64 | let mac_addr = (req.params.mac || '').replace(/-/g, ':');
65 | if (!/^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$/.test(mac_addr)) {
66 | res.status(400).end();
67 | return;
68 | }
69 |
70 | tools.flashLedPN(mac_addr).then(function () {
71 | res.status(204).end();
72 | }).catch(() => {
73 | res.status(500).end();
74 | });
75 | });
76 |
77 | // ---------- S7 Endpoint ----------
78 |
79 | function createTranslationTable(vars) {
80 | var res = {};
81 |
82 | vars.forEach(function (elm) {
83 | if (!elm.name || !elm.addr) {
84 | //skip incomplete entries
85 | return;
86 | }
87 | res[elm.name] = elm.addr;
88 | });
89 |
90 | return res;
91 | }
92 |
93 | function generateStatus(status, val) {
94 | var obj;
95 |
96 | if (typeof val != 'string' && typeof val != 'number' && typeof val != 'boolean') {
97 | val = RED._("s7.endpoint.status.online");
98 | }
99 |
100 | switch (status) {
101 | case 'online':
102 | obj = {
103 | fill: 'green',
104 | shape: 'dot',
105 | text: val.toString()
106 | };
107 | break;
108 | case 'badvalues':
109 | obj = {
110 | fill: 'yellow',
111 | shape: 'dot',
112 | text: RED._("s7.endpoint.status.badvalues")
113 | };
114 | break;
115 | case 'offline':
116 | obj = {
117 | fill: 'red',
118 | shape: 'dot',
119 | text: RED._("s7.endpoint.status.offline")
120 | };
121 | break;
122 | case 'connecting':
123 | obj = {
124 | fill: 'yellow',
125 | shape: 'dot',
126 | text: RED._("s7.endpoint.status.connecting")
127 | };
128 | break;
129 | default:
130 | obj = {
131 | fill: 'grey',
132 | shape: 'dot',
133 | text: RED._("s7.endpoint.status.unknown")
134 | };
135 | }
136 | return obj;
137 | }
138 |
139 | function validateTSAP(num) {
140 | num = num.toString();
141 | if (num.length != 2) return false;
142 | if (!(/^[0-9a-fA-F]+$/.test(num))) return false;
143 | var i = parseInt(num, 16);
144 | if (isNaN(i) || i < 0 || i > 0xff) return false;
145 | return true;
146 | }
147 |
148 | function S7Endpoint(config) {
149 | EventEmitter.call(this);
150 | var node = this;
151 | var oldValues = {};
152 | var status;
153 | var readInProgress = false;
154 | var readDeferred = 0;
155 | var connected = false;
156 | var currentCycleTime = config.cycletime;
157 | var transport = config.transport || 'iso-on-tcp';
158 |
159 | RED.nodes.createNode(this, config);
160 |
161 | //avoids warnings when we have a lot of S7In nodes
162 | this.setMaxListeners(0);
163 |
164 | node.endpoint = null;
165 | let connOpts;
166 | let itemGroup;
167 | let s7ConnOpts = { timeout: parseInt(config.timeout) }
168 |
169 | if (transport === 'mpi-s7') {
170 |
171 | node.adapter = RED.nodes.getNode(config.adapter);
172 | if (!node.adapter) {
173 | return node.error(RED._("s7.error.missingconfig"));
174 | }
175 |
176 | s7ConnOpts.maxJobs = 1;
177 |
178 | connOpts = {
179 | customTransport: async () => node.adapter.getStream(config.busaddr),
180 | s7ConnOpts
181 | }
182 |
183 | } else if (transport === 'iso-on-tcp') {
184 |
185 | switch (config.connmode) {
186 | case "rack-slot":
187 | connOpts = {
188 | host: config.address,
189 | port: Number(config.port),
190 | rack: Number(config.rack),
191 | slot: Number(config.slot),
192 | s7ConnOpts: s7ConnOpts
193 | }
194 | break;
195 | case "tsap":
196 | if (!validateTSAP(config.localtsaphi) ||
197 | !validateTSAP(config.localtsaplo) ||
198 | !validateTSAP(config.remotetsaphi) ||
199 | !validateTSAP(config.remotetsaplo)) {
200 | node.error(RED._("s7.error.invalidtsap", config));
201 | return;
202 | }
203 |
204 | let localTSAP = parseInt(config.localtsaphi, 16) << 8;
205 | localTSAP += parseInt(config.localtsaplo, 16);
206 | let remoteTSAP = parseInt(config.remotetsaphi, 16) << 8;
207 | remoteTSAP += parseInt(config.remotetsaplo, 16);
208 |
209 | connOpts = {
210 | host: config.address,
211 | port: config.port,
212 | srcTSAP: localTSAP,
213 | dstTSAP: remoteTSAP,
214 | s7ConnOpts: s7ConnOpts
215 | }
216 | break;
217 | default:
218 | node.error(RED._("s7.error.invalidconntype", config));
219 | return;
220 | }
221 | } else {
222 | node.error(RED._("s7.error.invalidconntype", config));
223 | return;
224 | }
225 |
226 | node._vars = createTranslationTable(config.vartable);
227 |
228 | node.getStatus = function getStatus() {
229 | return status;
230 | };
231 |
232 | node.writeVar = function writeVar(obj) {
233 | itemGroup.writeItems(obj.name, obj.val)
234 | .then(() => obj.done())
235 | .catch(e => obj.done(e))
236 | };
237 |
238 | /**
239 | * updates the current cycle time on the fly. A value of 0
240 | * disables the cyclic reading of variables, and for positive values
241 | * a minimum of 50 ms is enforced
242 | *
243 | * @param {number} interval the cycle time interval, in ms
244 | * @returns {string|undefined} an string with the error if any, or undefined
245 | */
246 | node.updateCycleTime = function updateCycleTime(interval) {
247 | let time = parseInt(interval);
248 |
249 | if (isNaN(time) || time < 0) {
250 | return RED._("s7.error.invalidtimeinterval", { interval: interval });
251 | }
252 |
253 | clearInterval(node._td);
254 |
255 | // don't set a new timer if value is zero
256 | if (!time) return;
257 |
258 | if (time < MIN_CYCLE_TIME) {
259 | node.warn(RED._("s7.info.cycletimetooshort", { min: MIN_CYCLE_TIME }), {});
260 | time = MIN_CYCLE_TIME;
261 | }
262 |
263 | currentCycleTime = time;
264 | node._td = setInterval(doCycle, time);
265 | }
266 |
267 | function manageStatus(newStatus) {
268 | if (status == newStatus) return;
269 |
270 | status = newStatus;
271 | node.emit('__STATUS__', {
272 | status: status
273 | });
274 | }
275 |
276 | function cycleCallback(values) {
277 | readInProgress = false;
278 |
279 | if (readDeferred && connected) {
280 | doCycle();
281 | readDeferred = 0;
282 | }
283 |
284 | manageStatus('online');
285 |
286 | var changed = false;
287 | node.emit('__ALL__', values);
288 | Object.keys(values).forEach(function (key) {
289 | if (!equals(oldValues[key], values[key])) {
290 | changed = true;
291 | node.emit(key, values[key]);
292 | node.emit('__CHANGED__', {
293 | key: key,
294 | value: values[key]
295 | });
296 | oldValues[key] = values[key];
297 | }
298 | });
299 | if (changed) node.emit('__ALL_CHANGED__', values);
300 | }
301 |
302 | function doCycle() {
303 | if (!readInProgress && connected) {
304 | itemGroup.readAllItems().then(cycleCallback).catch(e => {
305 | node.error(e, {});
306 | readInProgress = false;
307 | });
308 | readInProgress = true;
309 | } else {
310 | readDeferred++;
311 | }
312 | }
313 | node.doCycle = doCycle;
314 |
315 | function onConnect() {
316 | readInProgress = false;
317 | readDeferred = 0;
318 | connected = true;
319 |
320 | manageStatus('online');
321 |
322 | node.updateCycleTime(currentCycleTime);
323 | }
324 |
325 | function onDisconnect() {
326 | manageStatus('offline');
327 | connected = false;
328 | }
329 |
330 | node.on('close', done => {
331 | manageStatus('offline');
332 | if (!node.endpoint) done();
333 |
334 | node.endpoint.disconnect().then(done).catch(e => {
335 | node.error(e);
336 | });
337 | });
338 |
339 | manageStatus('offline');
340 |
341 | node.endpoint = new nodes7.S7Endpoint(connOpts);
342 | node.endpoint.on('connecting', () => manageStatus('connecting'));
343 | node.endpoint.on('connect', onConnect);
344 | node.endpoint.on('disconnect', onDisconnect);
345 | node.endpoint.on('error', (e => {
346 | manageStatus('offline');
347 | node.error(e && e.toString(), {});
348 | }));
349 |
350 | itemGroup = new nodes7.S7ItemGroup(node.endpoint);
351 | itemGroup.setTranslationCB(k => node._vars[k]);
352 |
353 | let varKeys = Object.keys(node._vars)
354 | if (!varKeys || !varKeys.length) {
355 | node.warn(RED._("s7.info.novars"), {});
356 | return;
357 | } else {
358 | itemGroup.addItems(varKeys);
359 | }
360 |
361 | }
362 | RED.nodes.registerType("s7 endpoint", S7Endpoint);
363 |
364 | // ---------- S7 In ----------
365 |
366 | function S7In(config) {
367 | var node = this;
368 | var statusVal;
369 | RED.nodes.createNode(this, config);
370 |
371 | node.endpoint = RED.nodes.getNode(config.endpoint);
372 | if (!node.endpoint) {
373 | return node.error(RED._("s7.error.missingconfig"));
374 | }
375 |
376 | function sendMsg(data, key, status) {
377 | if (key === undefined) key = '';
378 | if (data instanceof Date) data = data.getTime();
379 | var msg = {
380 | payload: data,
381 | topic: key
382 | };
383 | statusVal = status !== undefined ? status : data;
384 | node.send(msg);
385 | node.status(generateStatus(node.endpoint.getStatus(), statusVal));
386 | }
387 |
388 | function onChanged(variable) {
389 | sendMsg(variable.value, variable.key, null);
390 | }
391 |
392 | function onDataSplit(data) {
393 | Object.keys(data).forEach(function (key) {
394 | sendMsg(data[key], key, null);
395 | });
396 | }
397 |
398 | function onData(data) {
399 | sendMsg(data, config.mode == 'single' ? config.variable : '');
400 | }
401 |
402 | function onDataSelect(data) {
403 | onData(data[config.variable]);
404 | }
405 |
406 | function onEndpointStatus(s) {
407 | node.status(generateStatus(s.status, statusVal));
408 | }
409 |
410 | node.status(generateStatus(node.endpoint.getStatus(), statusVal));
411 | node.endpoint.on('__STATUS__', onEndpointStatus);
412 |
413 | if (config.diff) {
414 | switch (config.mode) {
415 | case 'all-split':
416 | node.endpoint.on('__CHANGED__', onChanged);
417 | break;
418 | case 'single':
419 | node.endpoint.on(config.variable, onData);
420 | break;
421 | case 'all':
422 | default:
423 | node.endpoint.on('__ALL_CHANGED__', onData);
424 | }
425 | } else {
426 | switch (config.mode) {
427 | case 'all-split':
428 | node.endpoint.on('__ALL__', onDataSplit);
429 | break;
430 | case 'single':
431 | node.endpoint.on('__ALL__', onDataSelect);
432 | break;
433 | case 'all':
434 | default:
435 | node.endpoint.on('__ALL__', onData);
436 | }
437 | }
438 |
439 | node.on('close', function (done) {
440 | node.endpoint.removeListener('__ALL__', onDataSelect);
441 | node.endpoint.removeListener('__ALL__', onDataSplit);
442 | node.endpoint.removeListener('__ALL__', onData);
443 | node.endpoint.removeListener('__ALL_CHANGED__', onData);
444 | node.endpoint.removeListener('__CHANGED__', onChanged);
445 | node.endpoint.removeListener('__STATUS__', onEndpointStatus);
446 | node.endpoint.removeListener(config.variable, onData);
447 | done();
448 | });
449 | }
450 | RED.nodes.registerType("s7 in", S7In);
451 |
452 | // ---------- S7 Out ----------
453 |
454 | function S7Out(config) {
455 | var node = this;
456 | var statusVal;
457 | RED.nodes.createNode(this, config);
458 |
459 | node.endpoint = RED.nodes.getNode(config.endpoint);
460 | if (!node.endpoint) {
461 | return node.error(RED._("s7.error.missingconfig"));
462 | }
463 |
464 | function onEndpointStatus(s) {
465 | node.status(generateStatus(s.status, statusVal));
466 | }
467 |
468 | function onNewMsg(msg, send, done) {
469 | var writeObj = {
470 | name: config.variable || msg.variable,
471 | val: msg.payload,
472 | done: done
473 | };
474 |
475 | // Test for the case we're writing multiple vars
476 | if (Array.isArray(writeObj.name)) {
477 |
478 | if (!Array.isArray(writeObj.val) || writeObj.val.length !== writeObj.name.length) {
479 | node.error(RED._("s7.error.valmismatch"));
480 | node.status(generateStatus('badvalues', statusVal));
481 | return;
482 | }
483 |
484 | for (const elm of writeObj.name) {
485 | if (!node.endpoint._vars[elm]) {
486 | node.error(RED._("s7.error.varunknown", { var: elm }));
487 | node.status(generateStatus('badvalues', statusVal));
488 | return;
489 | }
490 | }
491 |
492 | } else if (!node.endpoint._vars[writeObj.name]) {
493 | node.error(RED._("s7.error.varunknown", { var: writeObj.name }));
494 | node.status(generateStatus('badvalues', statusVal));
495 | return;
496 | }
497 |
498 | statusVal = writeObj.val;
499 | node.endpoint.writeVar(writeObj);
500 | node.status(generateStatus(node.endpoint.getStatus(), statusVal));
501 | }
502 |
503 | nrInputShim(node, onNewMsg);
504 |
505 | node.status(generateStatus(node.endpoint.getStatus(), statusVal));
506 | node.endpoint.on('__STATUS__', onEndpointStatus);
507 |
508 | node.on('close', function (done) {
509 | node.endpoint.removeListener('__STATUS__', onEndpointStatus);
510 | done();
511 | });
512 |
513 | }
514 | RED.nodes.registerType("s7 out", S7Out);
515 |
516 |
517 | // ---------- S7 Control ----------
518 |
519 | function S7Control(config) {
520 | var node = this;
521 | var statusVal;
522 | RED.nodes.createNode(this, config);
523 |
524 | node.endpoint = RED.nodes.getNode(config.endpoint);
525 | if (!node.endpoint) {
526 | return node.error(RED._("s7.error.missingconfig"));
527 | }
528 |
529 | function onEndpointStatus(s) {
530 | node.status(generateStatus(s.status, statusVal));
531 | }
532 |
533 | function onMessage(msg, send, done) {
534 | var res;
535 | let func = config.function || msg.function;
536 | switch (func) {
537 | case 'cycletime':
538 | res = node.endpoint.updateCycleTime(msg.payload);
539 | if (res) {
540 | done(res);
541 | } else {
542 | send(msg);
543 | done();
544 | }
545 | break;
546 | case 'trigger':
547 | node.endpoint.doCycle();
548 | send(msg);
549 | done();
550 | break;
551 |
552 | case 'ssl':
553 | node.endpoint.endpoint
554 | .getSSL(Number(msg && msg.payload && msg.payload.id || 0), Number(msg && msg.payload && msg.payload.index || 0)).then(res => {
555 | msg.payload = res;
556 | send(msg);
557 | done();
558 | }).catch(e => {
559 | done(e);
560 | })
561 | break;
562 |
563 | case 'list-blocks':
564 | node.endpoint.endpoint
565 | .listAllBlocks().then(res => {
566 | msg.payload = res;
567 | send(msg);
568 | done();
569 | }).catch(e => {
570 | done(e);
571 | })
572 | break;
573 |
574 | case 'upload-block':
575 | node.endpoint.endpoint
576 | .uploadBlock(msg && msg.payload && msg.payload.type, Number(msg && msg.payload && msg.payload.number)).then(res => {
577 | msg.payload = res;
578 | send(msg);
579 | done();
580 | }).catch(e => {
581 | done(e);
582 | })
583 | break;
584 |
585 | case 'upload-all-blocks':
586 | node.endpoint.endpoint
587 | .uploadAllBlocks().then(res => {
588 | msg.payload = res;
589 | send(msg);
590 | done();
591 | }).catch(e => {
592 | done(e);
593 | })
594 | break;
595 |
596 | case 'all-block-info':
597 | node.endpoint.endpoint
598 | .getAllBlockInfo().then(res => {
599 | msg.payload = res;
600 | send(msg);
601 | done();
602 | }).catch(e => {
603 | done(e);
604 | })
605 | break;
606 |
607 | default:
608 | node.error(RED._("s7.error.invalidcontrolfunction", { function: config.function }), msg);
609 | }
610 | }
611 |
612 | node.status(generateStatus(node.endpoint.getStatus(), statusVal));
613 |
614 | nrInputShim(node, onMessage);
615 | node.endpoint.on('__STATUS__', onEndpointStatus);
616 |
617 | node.on('close', function (done) {
618 | node.endpoint.removeListener('__STATUS__', onEndpointStatus);
619 | done();
620 | });
621 |
622 | }
623 | RED.nodes.registerType("s7 control", S7Control);
624 | };
625 |
--------------------------------------------------------------------------------
/src/tools.js:
--------------------------------------------------------------------------------
1 | //@ts-check
2 | /*
3 | Copyright: (c) 2016-2020, ST-One Ltda., Guilherme Francescon Cittolin
4 | GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
5 | */
6 |
7 | const path = require('path');
8 | const util = require('util');
9 | const os = require('os');
10 | const exec = util.promisify(require('child_process').exec);
11 |
12 | const pnToolsPath = 'pn-tools';
13 | const pnDevRoleMask = 0x02;
14 |
15 | class Tools {
16 |
17 | constructor() {
18 | this.pnToolsAvailable = null;
19 | this.ifaceCache = new Map();
20 | }
21 |
22 | async isPnToolsAvailable() {
23 | if (this.pnToolsAvailable === null) {
24 | try {
25 | await exec(`${pnToolsPath} version`);
26 | this.pnToolsAvailable = true;
27 | } catch (e) {
28 | this.pnToolsAvailable = false;
29 | }
30 | }
31 |
32 | return this.pnToolsAvailable;
33 | }
34 |
35 | getIfaces() {
36 | let ifaces = os.networkInterfaces();
37 | return Object.keys(ifaces).filter(v => ifaces[v][0] && !ifaces[v][0].internal)
38 | }
39 |
40 | async listDevicesPN() {
41 | if (!await this.isPnToolsAvailable()) return [];
42 |
43 | let proms = [];
44 | for (const iface of this.getIfaces()) {
45 | proms.push(exec(`${pnToolsPath} discovery -o -i "${iface}"`).then(res => {return {iface, res};}));
46 | }
47 |
48 | let devs = [];
49 | let results = await Promise.all(proms);
50 |
51 | for (const elm of results) {
52 | let iface = elm.iface;
53 | let out = elm.res.stdout.trim().split('\n');
54 | if (out.length < 2) continue;
55 |
56 | let keys = out.shift().split('\t');
57 | for (const row of out) {
58 | let dev = {};
59 | let elms = row.split('\t');
60 | for (const i in elms) {
61 | dev[keys[i]] = elms[i];
62 | }
63 |
64 | this.ifaceCache.set(dev['MAC Address'], iface);
65 | devs.push(dev);
66 | }
67 | }
68 |
69 | // filters out devices that don't have the "IO-Controller" (0x02) bit set
70 | return devs.filter(val => (parseInt(val['Device Role']) & pnDevRoleMask));
71 | }
72 |
73 | async flashLedPN(mac_addr, iface) {
74 | if (!await this.isPnToolsAvailable()) return;
75 |
76 | iface = iface || this.ifaceCache.get(mac_addr);
77 | if (!iface) {
78 | throw new Error(`Could not determine interface for [${mac_addr}]`);
79 | }
80 |
81 | await exec(`${pnToolsPath} flashled -i "${iface}" -t "${mac_addr}"`);
82 | }
83 | }
84 |
85 | module.exports = new Tools();
--------------------------------------------------------------------------------
/test/flow_writeTest.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": "488414d1.cd8a0c",
4 | "type": "tab",
5 | "label": "Flow 1"
6 | },
7 | {
8 | "id": "23ab1009.ea28",
9 | "type": "s7 endpoint",
10 | "z": "",
11 | "address": "127.0.0.1",
12 | "port": "102",
13 | "rack": "0",
14 | "slot": "2",
15 | "cycletime": "500",
16 | "name": "Local SNAP7",
17 | "vartable": [
18 | {
19 | "addr": "DB1,X0.0",
20 | "name": "DB1_BOOL1"
21 | },
22 | {
23 | "addr": "DB1,X0.1",
24 | "name": "DB1_BOOL2"
25 | },
26 | {
27 | "addr": "DB1,INT2",
28 | "name": "DB1_INT1"
29 | },
30 | {
31 | "addr": "DB1,REAL4",
32 | "name": "DB1_REAL1"
33 | },
34 | {
35 | "addr": "DB1.WORD8",
36 | "name": "DB1_WORD1"
37 | },
38 | {
39 | "addr": "DB1.C12.6",
40 | "name": "DB1_CHAR1"
41 | }
42 | ]
43 | },
44 | {
45 | "id": "90b84b7c.460d98",
46 | "type": "s7 in",
47 | "z": "488414d1.cd8a0c",
48 | "endpoint": "23ab1009.ea28",
49 | "mode": "all-split",
50 | "variable": "DB1_TEST",
51 | "diff": true,
52 | "name": "",
53 | "x": 140,
54 | "y": 80,
55 | "wires": [
56 | [
57 | "db0d79a2.9283e8"
58 | ]
59 | ]
60 | },
61 | {
62 | "id": "db0d79a2.9283e8",
63 | "type": "debug",
64 | "z": "488414d1.cd8a0c",
65 | "name": "",
66 | "active": true,
67 | "console": "false",
68 | "complete": "true",
69 | "x": 430,
70 | "y": 80,
71 | "wires": []
72 | },
73 | {
74 | "id": "1b98ad9d.f27f22",
75 | "type": "s7 out",
76 | "z": "488414d1.cd8a0c",
77 | "endpoint": "23ab1009.ea28",
78 | "variable": "DB1_BOOL1",
79 | "name": "",
80 | "x": 110,
81 | "y": 160,
82 | "wires": []
83 | },
84 | {
85 | "id": "5cae9d4b.c4b264",
86 | "type": "inject",
87 | "z": "488414d1.cd8a0c",
88 | "name": "",
89 | "topic": "",
90 | "payload": "true",
91 | "payloadType": "bool",
92 | "repeat": "",
93 | "crontab": "",
94 | "once": false,
95 | "x": 130,
96 | "y": 200,
97 | "wires": [
98 | [
99 | "1b98ad9d.f27f22"
100 | ]
101 | ]
102 | },
103 | {
104 | "id": "244a97ab.33c268",
105 | "type": "inject",
106 | "z": "488414d1.cd8a0c",
107 | "name": "",
108 | "topic": "",
109 | "payload": "false",
110 | "payloadType": "bool",
111 | "repeat": "",
112 | "crontab": "",
113 | "once": false,
114 | "x": 130,
115 | "y": 240,
116 | "wires": [
117 | [
118 | "1b98ad9d.f27f22"
119 | ]
120 | ]
121 | },
122 | {
123 | "id": "4db54f0e.8289a",
124 | "type": "inject",
125 | "z": "488414d1.cd8a0c",
126 | "name": "",
127 | "topic": "",
128 | "payload": "1",
129 | "payloadType": "num",
130 | "repeat": "",
131 | "crontab": "",
132 | "once": false,
133 | "x": 130,
134 | "y": 280,
135 | "wires": [
136 | [
137 | "1b98ad9d.f27f22"
138 | ]
139 | ]
140 | },
141 | {
142 | "id": "c13289cc.ba7368",
143 | "type": "inject",
144 | "z": "488414d1.cd8a0c",
145 | "name": "",
146 | "topic": "",
147 | "payload": "0",
148 | "payloadType": "num",
149 | "repeat": "",
150 | "crontab": "",
151 | "once": false,
152 | "x": 130,
153 | "y": 320,
154 | "wires": [
155 | [
156 | "1b98ad9d.f27f22"
157 | ]
158 | ]
159 | },
160 | {
161 | "id": "591ff3c1.a2451c",
162 | "type": "inject",
163 | "z": "488414d1.cd8a0c",
164 | "name": "",
165 | "topic": "",
166 | "payload": "1.1",
167 | "payloadType": "num",
168 | "repeat": "",
169 | "crontab": "",
170 | "once": false,
171 | "x": 130,
172 | "y": 360,
173 | "wires": [
174 | [
175 | "1b98ad9d.f27f22"
176 | ]
177 | ]
178 | },
179 | {
180 | "id": "2d1d09a6.a1b946",
181 | "type": "inject",
182 | "z": "488414d1.cd8a0c",
183 | "name": "",
184 | "topic": "",
185 | "payload": "1.4849",
186 | "payloadType": "num",
187 | "repeat": "",
188 | "crontab": "",
189 | "once": false,
190 | "x": 130,
191 | "y": 480,
192 | "wires": [
193 | [
194 | "1b98ad9d.f27f22"
195 | ]
196 | ]
197 | },
198 | {
199 | "id": "bb3f09e.27cfff8",
200 | "type": "inject",
201 | "z": "488414d1.cd8a0c",
202 | "name": "",
203 | "topic": "",
204 | "payload": "72123",
205 | "payloadType": "num",
206 | "repeat": "",
207 | "crontab": "",
208 | "once": false,
209 | "x": 130,
210 | "y": 520,
211 | "wires": [
212 | [
213 | "1b98ad9d.f27f22"
214 | ]
215 | ]
216 | },
217 | {
218 | "id": "114cf79c.c705c8",
219 | "type": "inject",
220 | "z": "488414d1.cd8a0c",
221 | "name": "",
222 | "topic": "",
223 | "payload": "HELLO",
224 | "payloadType": "str",
225 | "repeat": "",
226 | "crontab": "",
227 | "once": false,
228 | "x": 130,
229 | "y": 560,
230 | "wires": [
231 | [
232 | "1b98ad9d.f27f22"
233 | ]
234 | ]
235 | },
236 | {
237 | "id": "36f2bda6.2b5f82",
238 | "type": "inject",
239 | "z": "488414d1.cd8a0c",
240 | "name": "",
241 | "topic": "",
242 | "payload": "HELLOWORLD",
243 | "payloadType": "str",
244 | "repeat": "",
245 | "crontab": "",
246 | "once": false,
247 | "x": 100,
248 | "y": 600,
249 | "wires": [
250 | [
251 | "1b98ad9d.f27f22"
252 | ]
253 | ]
254 | },
255 | {
256 | "id": "ba7754a4.73ce18",
257 | "type": "s7 out",
258 | "z": "488414d1.cd8a0c",
259 | "endpoint": "23ab1009.ea28",
260 | "variable": "DB1_BOOL2",
261 | "name": "",
262 | "x": 330,
263 | "y": 160,
264 | "wires": []
265 | },
266 | {
267 | "id": "b4f8fa0.b072208",
268 | "type": "inject",
269 | "z": "488414d1.cd8a0c",
270 | "name": "",
271 | "topic": "",
272 | "payload": "true",
273 | "payloadType": "bool",
274 | "repeat": "",
275 | "crontab": "",
276 | "once": false,
277 | "x": 350,
278 | "y": 200,
279 | "wires": [
280 | [
281 | "ba7754a4.73ce18"
282 | ]
283 | ]
284 | },
285 | {
286 | "id": "3f91e01f.fe3bf",
287 | "type": "inject",
288 | "z": "488414d1.cd8a0c",
289 | "name": "",
290 | "topic": "",
291 | "payload": "false",
292 | "payloadType": "bool",
293 | "repeat": "",
294 | "crontab": "",
295 | "once": false,
296 | "x": 350,
297 | "y": 240,
298 | "wires": [
299 | [
300 | "ba7754a4.73ce18"
301 | ]
302 | ]
303 | },
304 | {
305 | "id": "d19b06d5.2e9198",
306 | "type": "inject",
307 | "z": "488414d1.cd8a0c",
308 | "name": "",
309 | "topic": "",
310 | "payload": "1",
311 | "payloadType": "num",
312 | "repeat": "",
313 | "crontab": "",
314 | "once": false,
315 | "x": 350,
316 | "y": 280,
317 | "wires": [
318 | [
319 | "ba7754a4.73ce18"
320 | ]
321 | ]
322 | },
323 | {
324 | "id": "7c8505af.8cafec",
325 | "type": "inject",
326 | "z": "488414d1.cd8a0c",
327 | "name": "",
328 | "topic": "",
329 | "payload": "0",
330 | "payloadType": "num",
331 | "repeat": "",
332 | "crontab": "",
333 | "once": false,
334 | "x": 350,
335 | "y": 320,
336 | "wires": [
337 | [
338 | "ba7754a4.73ce18"
339 | ]
340 | ]
341 | },
342 | {
343 | "id": "a275e7ec.969d18",
344 | "type": "inject",
345 | "z": "488414d1.cd8a0c",
346 | "name": "",
347 | "topic": "",
348 | "payload": "1.1",
349 | "payloadType": "num",
350 | "repeat": "",
351 | "crontab": "",
352 | "once": false,
353 | "x": 350,
354 | "y": 360,
355 | "wires": [
356 | [
357 | "ba7754a4.73ce18"
358 | ]
359 | ]
360 | },
361 | {
362 | "id": "45a23d6.685c3c4",
363 | "type": "inject",
364 | "z": "488414d1.cd8a0c",
365 | "name": "",
366 | "topic": "",
367 | "payload": "1.4849",
368 | "payloadType": "num",
369 | "repeat": "",
370 | "crontab": "",
371 | "once": false,
372 | "x": 350,
373 | "y": 480,
374 | "wires": [
375 | [
376 | "ba7754a4.73ce18"
377 | ]
378 | ]
379 | },
380 | {
381 | "id": "2e76347d.3e036c",
382 | "type": "inject",
383 | "z": "488414d1.cd8a0c",
384 | "name": "",
385 | "topic": "",
386 | "payload": "72123",
387 | "payloadType": "num",
388 | "repeat": "",
389 | "crontab": "",
390 | "once": false,
391 | "x": 350,
392 | "y": 520,
393 | "wires": [
394 | [
395 | "ba7754a4.73ce18"
396 | ]
397 | ]
398 | },
399 | {
400 | "id": "35c9b5d8.a459ba",
401 | "type": "inject",
402 | "z": "488414d1.cd8a0c",
403 | "name": "",
404 | "topic": "",
405 | "payload": "HELLO",
406 | "payloadType": "str",
407 | "repeat": "",
408 | "crontab": "",
409 | "once": false,
410 | "x": 350,
411 | "y": 560,
412 | "wires": [
413 | [
414 | "ba7754a4.73ce18"
415 | ]
416 | ]
417 | },
418 | {
419 | "id": "1a5cc028.3e816",
420 | "type": "inject",
421 | "z": "488414d1.cd8a0c",
422 | "name": "",
423 | "topic": "",
424 | "payload": "HELLOWORLD",
425 | "payloadType": "str",
426 | "repeat": "",
427 | "crontab": "",
428 | "once": false,
429 | "x": 320,
430 | "y": 600,
431 | "wires": [
432 | [
433 | "ba7754a4.73ce18"
434 | ]
435 | ]
436 | },
437 | {
438 | "id": "1614be22.392022",
439 | "type": "s7 out",
440 | "z": "488414d1.cd8a0c",
441 | "endpoint": "23ab1009.ea28",
442 | "variable": "DB1_INT1",
443 | "name": "",
444 | "x": 550,
445 | "y": 160,
446 | "wires": []
447 | },
448 | {
449 | "id": "3c40f574.b414aa",
450 | "type": "inject",
451 | "z": "488414d1.cd8a0c",
452 | "name": "",
453 | "topic": "",
454 | "payload": "true",
455 | "payloadType": "bool",
456 | "repeat": "",
457 | "crontab": "",
458 | "once": false,
459 | "x": 570,
460 | "y": 200,
461 | "wires": [
462 | [
463 | "1614be22.392022"
464 | ]
465 | ]
466 | },
467 | {
468 | "id": "62015679.c5a898",
469 | "type": "inject",
470 | "z": "488414d1.cd8a0c",
471 | "name": "",
472 | "topic": "",
473 | "payload": "false",
474 | "payloadType": "bool",
475 | "repeat": "",
476 | "crontab": "",
477 | "once": false,
478 | "x": 570,
479 | "y": 240,
480 | "wires": [
481 | [
482 | "1614be22.392022"
483 | ]
484 | ]
485 | },
486 | {
487 | "id": "168e72a0.933f8d",
488 | "type": "inject",
489 | "z": "488414d1.cd8a0c",
490 | "name": "",
491 | "topic": "",
492 | "payload": "1",
493 | "payloadType": "num",
494 | "repeat": "",
495 | "crontab": "",
496 | "once": false,
497 | "x": 570,
498 | "y": 280,
499 | "wires": [
500 | [
501 | "1614be22.392022"
502 | ]
503 | ]
504 | },
505 | {
506 | "id": "76e8f28e.c3b3ec",
507 | "type": "inject",
508 | "z": "488414d1.cd8a0c",
509 | "name": "",
510 | "topic": "",
511 | "payload": "0",
512 | "payloadType": "num",
513 | "repeat": "",
514 | "crontab": "",
515 | "once": false,
516 | "x": 570,
517 | "y": 320,
518 | "wires": [
519 | [
520 | "1614be22.392022"
521 | ]
522 | ]
523 | },
524 | {
525 | "id": "bce984c2.e8efa8",
526 | "type": "inject",
527 | "z": "488414d1.cd8a0c",
528 | "name": "",
529 | "topic": "",
530 | "payload": "1.1",
531 | "payloadType": "num",
532 | "repeat": "",
533 | "crontab": "",
534 | "once": false,
535 | "x": 570,
536 | "y": 360,
537 | "wires": [
538 | [
539 | "1614be22.392022"
540 | ]
541 | ]
542 | },
543 | {
544 | "id": "b6229426.419418",
545 | "type": "inject",
546 | "z": "488414d1.cd8a0c",
547 | "name": "",
548 | "topic": "",
549 | "payload": "1.4849",
550 | "payloadType": "num",
551 | "repeat": "",
552 | "crontab": "",
553 | "once": false,
554 | "x": 570,
555 | "y": 480,
556 | "wires": [
557 | [
558 | "1614be22.392022"
559 | ]
560 | ]
561 | },
562 | {
563 | "id": "d176c178.6f4f1",
564 | "type": "inject",
565 | "z": "488414d1.cd8a0c",
566 | "name": "",
567 | "topic": "",
568 | "payload": "72123",
569 | "payloadType": "num",
570 | "repeat": "",
571 | "crontab": "",
572 | "once": false,
573 | "x": 570,
574 | "y": 520,
575 | "wires": [
576 | [
577 | "1614be22.392022"
578 | ]
579 | ]
580 | },
581 | {
582 | "id": "12ea7c14.a04ea4",
583 | "type": "inject",
584 | "z": "488414d1.cd8a0c",
585 | "name": "",
586 | "topic": "",
587 | "payload": "HELLO",
588 | "payloadType": "str",
589 | "repeat": "",
590 | "crontab": "",
591 | "once": false,
592 | "x": 570,
593 | "y": 560,
594 | "wires": [
595 | [
596 | "1614be22.392022"
597 | ]
598 | ]
599 | },
600 | {
601 | "id": "1164e77.f4f9a19",
602 | "type": "inject",
603 | "z": "488414d1.cd8a0c",
604 | "name": "",
605 | "topic": "",
606 | "payload": "HELLOWORLD",
607 | "payloadType": "str",
608 | "repeat": "",
609 | "crontab": "",
610 | "once": false,
611 | "x": 540,
612 | "y": 600,
613 | "wires": [
614 | [
615 | "1614be22.392022"
616 | ]
617 | ]
618 | },
619 | {
620 | "id": "5dad0f16.f3689",
621 | "type": "s7 out",
622 | "z": "488414d1.cd8a0c",
623 | "endpoint": "23ab1009.ea28",
624 | "variable": "DB1_REAL1",
625 | "name": "",
626 | "x": 770,
627 | "y": 160,
628 | "wires": []
629 | },
630 | {
631 | "id": "cf8c1b9e.86cc78",
632 | "type": "inject",
633 | "z": "488414d1.cd8a0c",
634 | "name": "",
635 | "topic": "",
636 | "payload": "true",
637 | "payloadType": "bool",
638 | "repeat": "",
639 | "crontab": "",
640 | "once": false,
641 | "x": 790,
642 | "y": 200,
643 | "wires": [
644 | [
645 | "5dad0f16.f3689"
646 | ]
647 | ]
648 | },
649 | {
650 | "id": "e9656ad9.b1e8c8",
651 | "type": "inject",
652 | "z": "488414d1.cd8a0c",
653 | "name": "",
654 | "topic": "",
655 | "payload": "false",
656 | "payloadType": "bool",
657 | "repeat": "",
658 | "crontab": "",
659 | "once": false,
660 | "x": 790,
661 | "y": 240,
662 | "wires": [
663 | [
664 | "5dad0f16.f3689"
665 | ]
666 | ]
667 | },
668 | {
669 | "id": "24f227eb.9e6ef8",
670 | "type": "inject",
671 | "z": "488414d1.cd8a0c",
672 | "name": "",
673 | "topic": "",
674 | "payload": "1",
675 | "payloadType": "num",
676 | "repeat": "",
677 | "crontab": "",
678 | "once": false,
679 | "x": 790,
680 | "y": 280,
681 | "wires": [
682 | [
683 | "5dad0f16.f3689"
684 | ]
685 | ]
686 | },
687 | {
688 | "id": "814cc385.94acb",
689 | "type": "inject",
690 | "z": "488414d1.cd8a0c",
691 | "name": "",
692 | "topic": "",
693 | "payload": "0",
694 | "payloadType": "num",
695 | "repeat": "",
696 | "crontab": "",
697 | "once": false,
698 | "x": 790,
699 | "y": 320,
700 | "wires": [
701 | [
702 | "5dad0f16.f3689"
703 | ]
704 | ]
705 | },
706 | {
707 | "id": "4374b231.27762c",
708 | "type": "inject",
709 | "z": "488414d1.cd8a0c",
710 | "name": "",
711 | "topic": "",
712 | "payload": "1.1",
713 | "payloadType": "num",
714 | "repeat": "",
715 | "crontab": "",
716 | "once": false,
717 | "x": 790,
718 | "y": 360,
719 | "wires": [
720 | [
721 | "5dad0f16.f3689"
722 | ]
723 | ]
724 | },
725 | {
726 | "id": "3c0d6a12.5d2606",
727 | "type": "inject",
728 | "z": "488414d1.cd8a0c",
729 | "name": "",
730 | "topic": "",
731 | "payload": "1.4849",
732 | "payloadType": "num",
733 | "repeat": "",
734 | "crontab": "",
735 | "once": false,
736 | "x": 790,
737 | "y": 480,
738 | "wires": [
739 | [
740 | "5dad0f16.f3689"
741 | ]
742 | ]
743 | },
744 | {
745 | "id": "296cd15f.13e10e",
746 | "type": "inject",
747 | "z": "488414d1.cd8a0c",
748 | "name": "",
749 | "topic": "",
750 | "payload": "72123",
751 | "payloadType": "num",
752 | "repeat": "",
753 | "crontab": "",
754 | "once": false,
755 | "x": 790,
756 | "y": 520,
757 | "wires": [
758 | [
759 | "5dad0f16.f3689"
760 | ]
761 | ]
762 | },
763 | {
764 | "id": "eda357fc.83d4b8",
765 | "type": "inject",
766 | "z": "488414d1.cd8a0c",
767 | "name": "",
768 | "topic": "",
769 | "payload": "HELLO",
770 | "payloadType": "str",
771 | "repeat": "",
772 | "crontab": "",
773 | "once": false,
774 | "x": 790,
775 | "y": 560,
776 | "wires": [
777 | [
778 | "5dad0f16.f3689"
779 | ]
780 | ]
781 | },
782 | {
783 | "id": "15c235a7.d3679a",
784 | "type": "inject",
785 | "z": "488414d1.cd8a0c",
786 | "name": "",
787 | "topic": "",
788 | "payload": "HELLOWORLD",
789 | "payloadType": "str",
790 | "repeat": "",
791 | "crontab": "",
792 | "once": false,
793 | "x": 760,
794 | "y": 600,
795 | "wires": [
796 | [
797 | "5dad0f16.f3689"
798 | ]
799 | ]
800 | },
801 | {
802 | "id": "15c8d822.7f62f8",
803 | "type": "s7 out",
804 | "z": "488414d1.cd8a0c",
805 | "endpoint": "23ab1009.ea28",
806 | "variable": "DB1_WORD1",
807 | "name": "",
808 | "x": 1000,
809 | "y": 160,
810 | "wires": []
811 | },
812 | {
813 | "id": "14f08c25.dd3574",
814 | "type": "inject",
815 | "z": "488414d1.cd8a0c",
816 | "name": "",
817 | "topic": "",
818 | "payload": "true",
819 | "payloadType": "bool",
820 | "repeat": "",
821 | "crontab": "",
822 | "once": false,
823 | "x": 1010,
824 | "y": 200,
825 | "wires": [
826 | [
827 | "15c8d822.7f62f8"
828 | ]
829 | ]
830 | },
831 | {
832 | "id": "6f5e7699.afec78",
833 | "type": "inject",
834 | "z": "488414d1.cd8a0c",
835 | "name": "",
836 | "topic": "",
837 | "payload": "false",
838 | "payloadType": "bool",
839 | "repeat": "",
840 | "crontab": "",
841 | "once": false,
842 | "x": 1010,
843 | "y": 240,
844 | "wires": [
845 | [
846 | "15c8d822.7f62f8"
847 | ]
848 | ]
849 | },
850 | {
851 | "id": "28492f9d.c74fa",
852 | "type": "inject",
853 | "z": "488414d1.cd8a0c",
854 | "name": "",
855 | "topic": "",
856 | "payload": "1",
857 | "payloadType": "num",
858 | "repeat": "",
859 | "crontab": "",
860 | "once": false,
861 | "x": 1010,
862 | "y": 280,
863 | "wires": [
864 | [
865 | "15c8d822.7f62f8"
866 | ]
867 | ]
868 | },
869 | {
870 | "id": "8ce9b1b2.e02b9",
871 | "type": "inject",
872 | "z": "488414d1.cd8a0c",
873 | "name": "",
874 | "topic": "",
875 | "payload": "0",
876 | "payloadType": "num",
877 | "repeat": "",
878 | "crontab": "",
879 | "once": false,
880 | "x": 1010,
881 | "y": 320,
882 | "wires": [
883 | [
884 | "15c8d822.7f62f8"
885 | ]
886 | ]
887 | },
888 | {
889 | "id": "1e625b5e.0a6275",
890 | "type": "inject",
891 | "z": "488414d1.cd8a0c",
892 | "name": "",
893 | "topic": "",
894 | "payload": "1.1",
895 | "payloadType": "num",
896 | "repeat": "",
897 | "crontab": "",
898 | "once": false,
899 | "x": 1010,
900 | "y": 360,
901 | "wires": [
902 | [
903 | "15c8d822.7f62f8"
904 | ]
905 | ]
906 | },
907 | {
908 | "id": "10e9f908.7e9907",
909 | "type": "inject",
910 | "z": "488414d1.cd8a0c",
911 | "name": "",
912 | "topic": "",
913 | "payload": "1.4849",
914 | "payloadType": "num",
915 | "repeat": "",
916 | "crontab": "",
917 | "once": false,
918 | "x": 1010,
919 | "y": 480,
920 | "wires": [
921 | [
922 | "15c8d822.7f62f8"
923 | ]
924 | ]
925 | },
926 | {
927 | "id": "789f88b6.90de28",
928 | "type": "inject",
929 | "z": "488414d1.cd8a0c",
930 | "name": "",
931 | "topic": "",
932 | "payload": "72123",
933 | "payloadType": "num",
934 | "repeat": "",
935 | "crontab": "",
936 | "once": false,
937 | "x": 1010,
938 | "y": 520,
939 | "wires": [
940 | [
941 | "15c8d822.7f62f8"
942 | ]
943 | ]
944 | },
945 | {
946 | "id": "f5fbb2e1.2e2fc",
947 | "type": "inject",
948 | "z": "488414d1.cd8a0c",
949 | "name": "",
950 | "topic": "",
951 | "payload": "HELLO",
952 | "payloadType": "str",
953 | "repeat": "",
954 | "crontab": "",
955 | "once": false,
956 | "x": 1010,
957 | "y": 560,
958 | "wires": [
959 | [
960 | "15c8d822.7f62f8"
961 | ]
962 | ]
963 | },
964 | {
965 | "id": "26bff288.588f6e",
966 | "type": "inject",
967 | "z": "488414d1.cd8a0c",
968 | "name": "",
969 | "topic": "",
970 | "payload": "HELLOWORLD",
971 | "payloadType": "str",
972 | "repeat": "",
973 | "crontab": "",
974 | "once": false,
975 | "x": 980,
976 | "y": 600,
977 | "wires": [
978 | [
979 | "15c8d822.7f62f8"
980 | ]
981 | ]
982 | },
983 | {
984 | "id": "47fd2728.3cd898",
985 | "type": "s7 out",
986 | "z": "488414d1.cd8a0c",
987 | "endpoint": "23ab1009.ea28",
988 | "variable": "DB1_CHAR1",
989 | "name": "",
990 | "x": 1210,
991 | "y": 160,
992 | "wires": []
993 | },
994 | {
995 | "id": "2e772a20.7d5b76",
996 | "type": "inject",
997 | "z": "488414d1.cd8a0c",
998 | "name": "",
999 | "topic": "",
1000 | "payload": "true",
1001 | "payloadType": "bool",
1002 | "repeat": "",
1003 | "crontab": "",
1004 | "once": false,
1005 | "x": 1230,
1006 | "y": 200,
1007 | "wires": [
1008 | [
1009 | "47fd2728.3cd898"
1010 | ]
1011 | ]
1012 | },
1013 | {
1014 | "id": "f52a0427.a2d8a8",
1015 | "type": "inject",
1016 | "z": "488414d1.cd8a0c",
1017 | "name": "",
1018 | "topic": "",
1019 | "payload": "false",
1020 | "payloadType": "bool",
1021 | "repeat": "",
1022 | "crontab": "",
1023 | "once": false,
1024 | "x": 1230,
1025 | "y": 240,
1026 | "wires": [
1027 | [
1028 | "47fd2728.3cd898"
1029 | ]
1030 | ]
1031 | },
1032 | {
1033 | "id": "56a8e522.2243cc",
1034 | "type": "inject",
1035 | "z": "488414d1.cd8a0c",
1036 | "name": "",
1037 | "topic": "",
1038 | "payload": "1",
1039 | "payloadType": "num",
1040 | "repeat": "",
1041 | "crontab": "",
1042 | "once": false,
1043 | "x": 1230,
1044 | "y": 280,
1045 | "wires": [
1046 | [
1047 | "47fd2728.3cd898"
1048 | ]
1049 | ]
1050 | },
1051 | {
1052 | "id": "64600ffb.411f2",
1053 | "type": "inject",
1054 | "z": "488414d1.cd8a0c",
1055 | "name": "",
1056 | "topic": "",
1057 | "payload": "0",
1058 | "payloadType": "num",
1059 | "repeat": "",
1060 | "crontab": "",
1061 | "once": false,
1062 | "x": 1230,
1063 | "y": 320,
1064 | "wires": [
1065 | [
1066 | "47fd2728.3cd898"
1067 | ]
1068 | ]
1069 | },
1070 | {
1071 | "id": "180947d5.eeeab8",
1072 | "type": "inject",
1073 | "z": "488414d1.cd8a0c",
1074 | "name": "",
1075 | "topic": "",
1076 | "payload": "1.1",
1077 | "payloadType": "num",
1078 | "repeat": "",
1079 | "crontab": "",
1080 | "once": false,
1081 | "x": 1230,
1082 | "y": 360,
1083 | "wires": [
1084 | [
1085 | "47fd2728.3cd898"
1086 | ]
1087 | ]
1088 | },
1089 | {
1090 | "id": "8bfffe6c.d4134",
1091 | "type": "inject",
1092 | "z": "488414d1.cd8a0c",
1093 | "name": "",
1094 | "topic": "",
1095 | "payload": "1.4849",
1096 | "payloadType": "num",
1097 | "repeat": "",
1098 | "crontab": "",
1099 | "once": false,
1100 | "x": 1230,
1101 | "y": 480,
1102 | "wires": [
1103 | [
1104 | "47fd2728.3cd898"
1105 | ]
1106 | ]
1107 | },
1108 | {
1109 | "id": "563fb644.f22588",
1110 | "type": "inject",
1111 | "z": "488414d1.cd8a0c",
1112 | "name": "",
1113 | "topic": "",
1114 | "payload": "72123",
1115 | "payloadType": "num",
1116 | "repeat": "",
1117 | "crontab": "",
1118 | "once": false,
1119 | "x": 1230,
1120 | "y": 520,
1121 | "wires": [
1122 | [
1123 | "47fd2728.3cd898"
1124 | ]
1125 | ]
1126 | },
1127 | {
1128 | "id": "abb4d94f.163bf8",
1129 | "type": "inject",
1130 | "z": "488414d1.cd8a0c",
1131 | "name": "",
1132 | "topic": "",
1133 | "payload": "HELLO",
1134 | "payloadType": "str",
1135 | "repeat": "",
1136 | "crontab": "",
1137 | "once": false,
1138 | "x": 1230,
1139 | "y": 560,
1140 | "wires": [
1141 | [
1142 | "47fd2728.3cd898"
1143 | ]
1144 | ]
1145 | },
1146 | {
1147 | "id": "10146655.ebd4da",
1148 | "type": "inject",
1149 | "z": "488414d1.cd8a0c",
1150 | "name": "",
1151 | "topic": "",
1152 | "payload": "HELLOWORLD",
1153 | "payloadType": "str",
1154 | "repeat": "",
1155 | "crontab": "",
1156 | "once": false,
1157 | "x": 1200,
1158 | "y": 600,
1159 | "wires": [
1160 | [
1161 | "47fd2728.3cd898"
1162 | ]
1163 | ]
1164 | },
1165 | {
1166 | "id": "77200814.4ae378",
1167 | "type": "inject",
1168 | "z": "488414d1.cd8a0c",
1169 | "name": "empty str",
1170 | "topic": "",
1171 | "payload": "",
1172 | "payloadType": "str",
1173 | "repeat": "",
1174 | "crontab": "",
1175 | "once": false,
1176 | "x": 120,
1177 | "y": 640,
1178 | "wires": [
1179 | [
1180 | "1b98ad9d.f27f22"
1181 | ]
1182 | ]
1183 | },
1184 | {
1185 | "id": "5feba5e9.16bdfc",
1186 | "type": "inject",
1187 | "z": "488414d1.cd8a0c",
1188 | "name": "empty str",
1189 | "topic": "",
1190 | "payload": "",
1191 | "payloadType": "str",
1192 | "repeat": "",
1193 | "crontab": "",
1194 | "once": false,
1195 | "x": 340,
1196 | "y": 640,
1197 | "wires": [
1198 | [
1199 | "ba7754a4.73ce18"
1200 | ]
1201 | ]
1202 | },
1203 | {
1204 | "id": "a5786c0a.ff716",
1205 | "type": "inject",
1206 | "z": "488414d1.cd8a0c",
1207 | "name": "empty str",
1208 | "topic": "",
1209 | "payload": "",
1210 | "payloadType": "str",
1211 | "repeat": "",
1212 | "crontab": "",
1213 | "once": false,
1214 | "x": 560,
1215 | "y": 640,
1216 | "wires": [
1217 | [
1218 | "1614be22.392022"
1219 | ]
1220 | ]
1221 | },
1222 | {
1223 | "id": "c5704f00.5c7f8",
1224 | "type": "inject",
1225 | "z": "488414d1.cd8a0c",
1226 | "name": "empty str",
1227 | "topic": "",
1228 | "payload": "",
1229 | "payloadType": "str",
1230 | "repeat": "",
1231 | "crontab": "",
1232 | "once": false,
1233 | "x": 780,
1234 | "y": 640,
1235 | "wires": [
1236 | [
1237 | "5dad0f16.f3689"
1238 | ]
1239 | ]
1240 | },
1241 | {
1242 | "id": "3a8cced1.3c5552",
1243 | "type": "inject",
1244 | "z": "488414d1.cd8a0c",
1245 | "name": "empty str",
1246 | "topic": "",
1247 | "payload": "",
1248 | "payloadType": "str",
1249 | "repeat": "",
1250 | "crontab": "",
1251 | "once": false,
1252 | "x": 1000,
1253 | "y": 640,
1254 | "wires": [
1255 | [
1256 | "15c8d822.7f62f8"
1257 | ]
1258 | ]
1259 | },
1260 | {
1261 | "id": "f90932fb.b503",
1262 | "type": "inject",
1263 | "z": "488414d1.cd8a0c",
1264 | "name": "empty str",
1265 | "topic": "",
1266 | "payload": "",
1267 | "payloadType": "str",
1268 | "repeat": "",
1269 | "crontab": "",
1270 | "once": false,
1271 | "x": 1220,
1272 | "y": 640,
1273 | "wires": [
1274 | [
1275 | "47fd2728.3cd898"
1276 | ]
1277 | ]
1278 | },
1279 | {
1280 | "id": "c2ac29f8.2aa458",
1281 | "type": "inject",
1282 | "z": "488414d1.cd8a0c",
1283 | "name": "",
1284 | "topic": "",
1285 | "payload": "200",
1286 | "payloadType": "num",
1287 | "repeat": "",
1288 | "crontab": "",
1289 | "once": false,
1290 | "x": 130,
1291 | "y": 400,
1292 | "wires": [
1293 | [
1294 | "1b98ad9d.f27f22"
1295 | ]
1296 | ]
1297 | },
1298 | {
1299 | "id": "3d614304.7edccc",
1300 | "type": "inject",
1301 | "z": "488414d1.cd8a0c",
1302 | "name": "",
1303 | "topic": "",
1304 | "payload": "1000",
1305 | "payloadType": "num",
1306 | "repeat": "",
1307 | "crontab": "",
1308 | "once": false,
1309 | "x": 130,
1310 | "y": 440,
1311 | "wires": [
1312 | [
1313 | "1b98ad9d.f27f22"
1314 | ]
1315 | ]
1316 | },
1317 | {
1318 | "id": "574b2eb.9ebd4d",
1319 | "type": "inject",
1320 | "z": "488414d1.cd8a0c",
1321 | "name": "",
1322 | "topic": "",
1323 | "payload": "1000",
1324 | "payloadType": "num",
1325 | "repeat": "",
1326 | "crontab": "",
1327 | "once": false,
1328 | "x": 350,
1329 | "y": 440,
1330 | "wires": [
1331 | [
1332 | "ba7754a4.73ce18"
1333 | ]
1334 | ]
1335 | },
1336 | {
1337 | "id": "12a01d3a.5d09c3",
1338 | "type": "inject",
1339 | "z": "488414d1.cd8a0c",
1340 | "name": "",
1341 | "topic": "",
1342 | "payload": "200",
1343 | "payloadType": "num",
1344 | "repeat": "",
1345 | "crontab": "",
1346 | "once": false,
1347 | "x": 350,
1348 | "y": 400,
1349 | "wires": [
1350 | [
1351 | "ba7754a4.73ce18"
1352 | ]
1353 | ]
1354 | },
1355 | {
1356 | "id": "bed14df9.22a06",
1357 | "type": "inject",
1358 | "z": "488414d1.cd8a0c",
1359 | "name": "",
1360 | "topic": "",
1361 | "payload": "1000",
1362 | "payloadType": "num",
1363 | "repeat": "",
1364 | "crontab": "",
1365 | "once": false,
1366 | "x": 570,
1367 | "y": 440,
1368 | "wires": [
1369 | [
1370 | "1614be22.392022"
1371 | ]
1372 | ]
1373 | },
1374 | {
1375 | "id": "4246ccd5.19db34",
1376 | "type": "inject",
1377 | "z": "488414d1.cd8a0c",
1378 | "name": "",
1379 | "topic": "",
1380 | "payload": "200",
1381 | "payloadType": "num",
1382 | "repeat": "",
1383 | "crontab": "",
1384 | "once": false,
1385 | "x": 570,
1386 | "y": 400,
1387 | "wires": [
1388 | [
1389 | "1614be22.392022"
1390 | ]
1391 | ]
1392 | },
1393 | {
1394 | "id": "4d598ec.047bf7",
1395 | "type": "inject",
1396 | "z": "488414d1.cd8a0c",
1397 | "name": "",
1398 | "topic": "",
1399 | "payload": "1000",
1400 | "payloadType": "num",
1401 | "repeat": "",
1402 | "crontab": "",
1403 | "once": false,
1404 | "x": 790,
1405 | "y": 440,
1406 | "wires": [
1407 | [
1408 | "5dad0f16.f3689"
1409 | ]
1410 | ]
1411 | },
1412 | {
1413 | "id": "ae85b210.3afef",
1414 | "type": "inject",
1415 | "z": "488414d1.cd8a0c",
1416 | "name": "",
1417 | "topic": "",
1418 | "payload": "200",
1419 | "payloadType": "num",
1420 | "repeat": "",
1421 | "crontab": "",
1422 | "once": false,
1423 | "x": 790,
1424 | "y": 400,
1425 | "wires": [
1426 | [
1427 | "5dad0f16.f3689"
1428 | ]
1429 | ]
1430 | },
1431 | {
1432 | "id": "41d19515.af0e1c",
1433 | "type": "inject",
1434 | "z": "488414d1.cd8a0c",
1435 | "name": "",
1436 | "topic": "",
1437 | "payload": "1000",
1438 | "payloadType": "num",
1439 | "repeat": "",
1440 | "crontab": "",
1441 | "once": false,
1442 | "x": 1010,
1443 | "y": 440,
1444 | "wires": [
1445 | [
1446 | "15c8d822.7f62f8"
1447 | ]
1448 | ]
1449 | },
1450 | {
1451 | "id": "8b7830c.19a42d",
1452 | "type": "inject",
1453 | "z": "488414d1.cd8a0c",
1454 | "name": "",
1455 | "topic": "",
1456 | "payload": "200",
1457 | "payloadType": "num",
1458 | "repeat": "",
1459 | "crontab": "",
1460 | "once": false,
1461 | "x": 1010,
1462 | "y": 400,
1463 | "wires": [
1464 | [
1465 | "15c8d822.7f62f8"
1466 | ]
1467 | ]
1468 | },
1469 | {
1470 | "id": "7783fc9b.742184",
1471 | "type": "inject",
1472 | "z": "488414d1.cd8a0c",
1473 | "name": "",
1474 | "topic": "",
1475 | "payload": "1000",
1476 | "payloadType": "num",
1477 | "repeat": "",
1478 | "crontab": "",
1479 | "once": false,
1480 | "x": 1230,
1481 | "y": 440,
1482 | "wires": [
1483 | [
1484 | "47fd2728.3cd898"
1485 | ]
1486 | ]
1487 | },
1488 | {
1489 | "id": "443c44b3.cd18bc",
1490 | "type": "inject",
1491 | "z": "488414d1.cd8a0c",
1492 | "name": "",
1493 | "topic": "",
1494 | "payload": "200",
1495 | "payloadType": "num",
1496 | "repeat": "",
1497 | "crontab": "",
1498 | "once": false,
1499 | "x": 1230,
1500 | "y": 400,
1501 | "wires": [
1502 | [
1503 | "47fd2728.3cd898"
1504 | ]
1505 | ]
1506 | }
1507 | ]
1508 |
--------------------------------------------------------------------------------