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

dlt645

v1.0.1

Published

dlt645响应解析

Downloads

14

Readme

dlt645协议响应解析

Demo

Usage


ES Module

import DLT645 from 'dlt645'
let result=DLT645('68 60 64 02 09 22 04 68 91 0a 33 32 34 35 47 56 33 33 33 33 97 16')
// {
//     data: ['68','60','64','02','09','22','04','68','91','0a','33','33','33','33','56','47','97','16'],
//     id: ['04', '22', '09', '02', '64', '60'],
//     no: '0422-09026460',
//     valid: true,
//     fulfill: true,
//     req_success: true,
//     len: 10,
//     ctrl_bcd: '10010001',
//     type: '读数据应答帧',
//     res_desc: '电压数据块(V)',
//     res_val: 231.4,
//   }

//字符串转数组
DLT645.parseArray('68910a333234')//['68', '91', '0a', '33', '32', '34']
//16进制相加
DLT645.sum_hex(['68', '91', '0a', '33', '32', '34'])//412

Browser

<script src="./node_modules/dlt645/index.js">
DLT645('68 60 64 02 09 22 04 68 91 0a 33 32 34 35 47 56 33 33 33 33 97 16')

可解析的数据类型


'00000000': '(当前)组合有功总电能'
'00010000': '(当前)正向有功总电能'
'00020000': '(当前)反向有功总电能'
'00030000': '(当前)组合无功1总电能'
'00040000': '(当前)组合无功2总电能'
'00050000': '(当前)第一象限无功总电能'
'00060000': '(当前)第二象限无功总电能'
'00070000': '(当前)第三象限无功总电能'
'00080000': '(当前)第四象限无功总电能'
'02010100': 'A相电压'
'02010200': 'B相电压'
'02010300': 'C相电压'
'0201ff00': '电压数据块'
'02020100': 'A相电流'
'02020200': 'B相电流'
'02020300': 'C相电流'
'0202ff00': '电流数据块'
'02030000': '瞬时有功功率'
'02030100': '瞬时A相有功功率'
'02030200': '瞬时B相有功功率'
'02030300': '瞬时C相有功功率'
'02040000': '瞬时无功功率'
'02040100': '瞬时A相总无功功率'
'02040200': '瞬时B相总无功功率'
'02040300': '瞬时C相总无功功率'
'02050000': '瞬时视在功率'
'02050100': 'A相视在功率'
'02050200': 'B相视在功率'
'02050300': 'C相视在功率'
'02060000': '总功率因数'
'02060100': 'A相功率因数'
'02060200': 'B相功率因数'
'02060300': 'C相功率因数'