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

webscada-client

v1.2.5

Published

webSocket SCADA communication client components

Downloads

6

Readme

WebScadaClient

介绍

这个组件是基于浏览器实现SCADA的前端插件。通过WEBSocket实现与后端服务器的实时通信,实现各种设备数据的采集与变化响应。

软件架构

后端服务器是使用C++语言编写,并采用IOCP技术实现高并发支持的WEBSocket服务器。WEBSocket服务器又通过COM技术与OPCServer连接,以实现与所有PLC型号良好兼容的服务能力。

安装教程

  1. 在VSCode上安装 TagsEditor插件。以实现设备标记名的配置,并自动生成类型定义文件。(通过这个插件定义的标记名可以在代码编写中实现更好的智能提示) 安装方法为在VSCode商店搜索TagsEditor并安装。

  2. 下载并安装服务器端程序OPCWebServer,安装方法请参照该项目说明

  3. 下载安装开发脚手架WebPack

  4. 安装组件

    npm install --save webscada-client

使用说明

  1. 使用TagsEditor插件创建并编辑标签信息。保存后会自动生成对应的定义模块文件"Tags"。(tag定义中,设备如果不指定IP地址,则该设备为内存设备,标记名数据将存储在本地内存)
  2. import { app } from "tags"
  3. 通过app.tagName来读写设备数据。
        app.tagName1="test";
        console.log(app.tagName1);
  4. 数据变化事件捕获:
    //单标记名情况。
    app.on(
        "tagName",
        e=>{
            e.sender 触发事件的TAG对象
            e.type: 触发事件的类型
            e.tagName: 触发事件的标记名
            e.tagAddr?: 触发事件的
            e.devValue: any;
            e.tagValue: any;
        },
        //是否只触发一次,默认为false
        false,
        //事件处理程序的this指针。
        app
    )
    //多标记名情况。
    app.on(["tagName1","tagName2"],e=>{
        
    })
    //条件判断情况。
    app.on((e)=>{
        if (e.tagName1>20) return false;
        return true;
    },{
        //为真时触发
        onTrue(e){

        },
        //为真时延时时间。
        onTrueDelay:1,
        //为真时间隔时间。
        onTrueInterval:5,
        //为假时
        onFalse(e){

        },
        //为假时延时时间
        onFalseDelay:1,
        //为假时间隔时间
        onFalseInterval:5
    })

版本说明

1.2.1 增加Number类型的位操作。
console.log(app.tagName_bit2);
app.tagName_bit2=1;
1.2.5 增加Number类型的位操作。
  1. 点状态非192时为非激活状态,不发送事件。
  2. 当点状态激活时,重新发送事件.
  3. 当点状态为非激活时更改点的值会导致控制台输出 "Write Tag in unActive status. Tag:TAGNAME"

注意事项

OPCWebServer及脚手架为非免费软件,如有需要,可电话联系我:13120118297。另外,如有好的工作机会,也可与我联系。