npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-arc-modbus-puls

v0.0.2

Published

a powerful modbus tool for node-red

Downloads

24

Readme

README

感谢原作者,在原来基础上增加轮询地址可输功能

0.02 新增规则由msg.rules传入,方便集成使用

node-red-node-arc-modbus

This is a modbus polling tool base on Modbus RTU protocol. The node were able to send modbus requests according to the established rule table. And collects responses to make the final result. It can be switched polling behavior by input msg.poll. It can send "write request" command by input msg.write. It can handle modbus exception code. The modbus function code 01 02 03 04 05 06 15 16 has been implementation.

arc modbus polling

1.Example

example

[{"id":"c1839961.6e41c8","type":"arc-modbus-polling","z":"e7ca081.068c0f8","timeouts":"1000","interval":"50","rules":[{"access":"RW_Regs","regs_addr":"0","regs_num":"10"},{"access":"RW_Regs","regs_addr":"10","regs_num":"150"},{"access":"RW_Bits","regs_addr":"0","regs_num":"50"}],"disable_polling":false,"name":"","x":690,"y":900,"wires":[["da916d29.d84b9"],["18eb5449.277f0c","b24d29f.d9fbcd8"],["332103d3.e913dc"]]},{"id":"da916d29.d84b9","type":"tcp request","z":"e7ca081.068c0f8","server":"127.0.0.1","port":"502","out":"sit","splitc":" ","name":"","x":580,"y":780,"wires":[["3ec5564f.e1c79a"]]},{"id":"3ec5564f.e1c79a","type":"change","z":"e7ca081.068c0f8","name":"payload -> response","rules":[{"t":"move","p":"payload","pt":"msg","to":"response","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":780,"wires":[["c1839961.6e41c8","7a33efc8.fa863"]]},{"id":"7a33efc8.fa863","type":"debug","z":"e7ca081.068c0f8","name":"response","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"response","x":1030,"y":780,"wires":[]},{"id":"18eb5449.277f0c","type":"debug","z":"e7ca081.068c0f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":890,"y":900,"wires":[]},{"id":"b24d29f.d9fbcd8","type":"debug","z":"e7ca081.068c0f8","name":"result","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.result","x":870,"y":940,"wires":[]},{"id":"6adecef4.800db","type":"inject","z":"e7ca081.068c0f8","name":"write bits (FC15)","topic":"","payload":"{\"address\":20,\"data\":[false,true,true,true]}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":820,"wires":[["506aa932.aba248"]]},{"id":"faf8573b.97de28","type":"inject","z":"e7ca081.068c0f8","name":"write value (FC16)","topic":"","payload":"{\"address\":40,\"data\":[99,88,77,666]}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":900,"wires":[["506aa932.aba248"]]},{"id":"229804ec.da124c","type":"inject","z":"e7ca081.068c0f8","name":"write value (FC06)","topic":"","payload":"{\"address\":30,\"data\":123}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":860,"wires":[["506aa932.aba248"]]},{"id":"506aa932.aba248","type":"change","z":"e7ca081.068c0f8","name":"payload -> write","rules":[{"t":"move","p":"payload","pt":"msg","to":"write","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":900,"wires":[["c1839961.6e41c8"]]},{"id":"96e684f0.cb0ed8","type":"inject","z":"e7ca081.068c0f8","name":"write bit (FC05)","topic":"","payload":"{\"address\":10,\"data\":false}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":780,"wires":[["506aa932.aba248"]]},{"id":"332103d3.e913dc","type":"debug","z":"e7ca081.068c0f8","name":"exception msg","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":900,"y":980,"wires":[]},{"id":"1c6edf03.18e9f1","type":"inject","z":"e7ca081.068c0f8","name":"once","topic":"","payload":"once","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":1080,"wires":[["dbd3c9e3.d8f368"]]},{"id":"dbd3c9e3.d8f368","type":"change","z":"e7ca081.068c0f8","name":"","rules":[{"t":"set","p":"poll","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":1040,"wires":[["c1839961.6e41c8"]]},{"id":"5a924938.8a75e8","type":"inject","z":"e7ca081.068c0f8","name":"","topic":"","payload":"start","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":1120,"wires":[["dbd3c9e3.d8f368"]]},{"id":"dbd1d4b7.418cc8","type":"inject","z":"e7ca081.068c0f8","name":"","topic":"","payload":"stop","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":1040,"wires":[["dbd3c9e3.d8f368"]]},{"id":"3c69506.230b3b","type":"comment","z":"e7ca081.068c0f8","name":"example of write","info":"","x":230,"y":740,"wires":[]},{"id":"53f259b3.c6c3d8","type":"comment","z":"e7ca081.068c0f8","name":"example of control polling behavior","info":"","x":160,"y":1000,"wires":[]}]

2. Node msg

2.1 Outputs

Output 1 (buffer) Request packets

  • payload The request of modbus packets.

Output 2 (JSON) Result

  • payload.result The infomation of modbus slave response result.
  • payload.rule The rule of this result.
  • payload.pkg Request and response of this result.

Output 3 (JSON) Exception

  • payload.result The infomation of exception (e.g. exception code).
  • payload.rule The rule of this exception.
  • payload.pkg Request and response of this exception.

2.2 Inputs

msg.response (buffer)

  • Packets response from the Modbus device.

msg.write (JSON)

  • This command can be used to trigger a write request. Please refer to the example region example of write.

msg.poll (string)

  • You can switch to continue or stop polling by string ("start", "stop", "once"). As long as msg contains this property, it node will trigger to poll once.

2.3 Parameters

para

Timeouts (millisecond)

  • The timeout for waiting receive response.

Interval (millisecond)

  • The waiting time before next request.

Polling Disable (checkbox)

  • This can set the initial polling behavior of the node. It also can be changed by msg.poll during process is running.

Rules (table)

2.4 References

arc modbus slave

It is still in chaos...