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

goovplc

v0.8.0

Published

a nodejs-based Virtual S7 PLC CPU provide flow data through S7.

Downloads

1

Readme

GooVPLC

实现一个虚拟S7 PLC

  • 模拟一个S7 CPU,可虚拟出 DB MK CT TM PE PA 等区域
  • 可建立 S7Memory 与地址的双向绑定,通过 S7Memory 读写对应的区域地址
  • 可通过设置文件完成区域和 S7Memory 的配置
  • S7设备可通过S7协议读写虚拟PLC值
  • 软件客户端可通过http(JSON API)读写tag
  • 提供 TCP Server 和 Client,传送指定区域(原始二进制形式)

install

npm install goovplc

S7PLC

example:

import { S7PLC, S7TcpClient, S7WSServer } from "./src/index.js";

// create a VPLC server
const plc = new S7PLC({
    "host": "127.0.0.1", //S7server address
    "areas": [ // you can set up multiple data areas
        { // DB8 begin
            "name": "nodeGD8", // also can use "DB8" instead of symbol name
            "type": "DB", // DB type
            "DBNO": 8, // DB number
            "bytes": 50, // DB length
            "tags": [ //define Tags in data area
                { // Tag:nodeID
                    "name": "nodeID",
                    "type": "INT",
                    "value": 8078, //初始值
                },
                { // Tag:workOK
                    "name": "workOK",
                    "type": "BOOL",
                    "value": false, //初始值
                },
            ]
        },
    ]
});
plc.on("event", (event) => {
    console.log(plc.EventText(event));
});
plc.on("read", (tagObj, buffer) => {
    console.log("read ret: ", buffer);
})
plc.on("write", (tagObj, buffer) => {
    console.log("write: ", buffer);
})
plc.start_serve();