New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

webscada-client

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webscada-client

webSocket SCADA communication client components

latest
npmnpm
Version
1.2.5
Version published
Weekly downloads
2
-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

WebScadaClient

介绍

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

软件架构

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

安装教程

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

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

  • 下载安装开发脚手架WebPack

  • 安装组件

    npm install --save webscada-client

使用说明

  • 使用TagsEditor插件创建并编辑标签信息。保存后会自动生成对应的定义模块文件"Tags"。(tag定义中,设备如果不指定IP地址,则该设备为内存设备,标记名数据将存储在本地内存)
  • import { app } from "tags"
  • 通过app.tagName来读写设备数据。
        app.tagName1="test";
        console.log(app.tagName1);
    
  • 数据变化事件捕获:
    //单标记名情况。
    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类型的位操作。
  • 点状态非192时为非激活状态,不发送事件。
  • 当点状态激活时,重新发送事件.
  • 当点状态为非激活时更改点的值会导致控制台输出 "Write Tag in unActive status. Tag:TAGNAME"

注意事项

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

Keywords

PLC

FAQs

Package last updated on 14 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts