Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@st-one-io/nodes7

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@st-one-io/nodes7 - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

package.json
{
"name": "@st-one-io/nodes7",
"description": "A javascript library to communicate with Siemens S7 PLCs",
"version": "1.0.1",
"version": "1.1.0",
"author": "Guilherme Francescon <guilherme@st-one.io>",

@@ -6,0 +6,0 @@ "keywords": [

@@ -99,2 +99,7 @@ //@ts-check

case "REAL":
case "RINT":
case "RDINT":
case "RWORD":
case "RDWORD":
case "RREAL":
case "DT":

@@ -131,2 +136,18 @@ case "DTZ":

break;
case "RI":
dataType = "RINT";
break;
case "RDI":
dataType = "RDINT";
break;
case "RW":
dataType = "RWORD";
break;
case "RD":
case "RDW":
dataType = "RDWORD";
break;
case "RR":
dataType = "RREAL";
break;
default:

@@ -194,2 +215,18 @@ throw new NodeS7Error('ERR_PARSE_DB_DATATYPE', `Unknown DB data type "${match_area}" for address "${address}"`, { item: address });

break;
case "RI":
dataType = "RINT";
break;
case "RDI":
dataType = "RDINT";
break;
case "RW":
dataType = "RWORD";
break;
case "RD":
case "RDW":
dataType = "RDWORD";
break;
case "RR":
dataType = "RREAL";
break;
default:

@@ -262,2 +299,5 @@ throw new NodeS7Error('ERR_PARSE_DATATYPE', `Unknown data type "${dataType}" for address "${address}"`, { item: address });

case "DINT":
case "RREAL":
case "RDWORD":
case "RDINT":
dataTypeLength = 4;

@@ -267,2 +307,4 @@ break;

case "WORD":
case "RINT":
case "RWORD":
case "TIMER":

@@ -269,0 +311,0 @@ case "COUNTER":

@@ -343,2 +343,13 @@ //@ts-check

return new Date(Date.UTC(year, month - 1, day, hour, min, sec, ns / 1e6));
/** Reversed datatypes (little-endian) */
case "RREAL":
return buffer.readFloatLE(offset);
case "RDWORD":
return buffer.readUInt32LE(offset);
case "RWORD":
return buffer.readUInt16LE(offset);
case "RDINT":
return buffer.readInt32LE(offset);
case "RINT":
return buffer.readInt16LE(offset);
default:

@@ -369,2 +380,7 @@ throw new Error(`Cannot parse data of unknown type "${this._props.datatype}" for item "${this._string}"`);

case "WORD":
case "RREAL":
case "RDWORD":
case "RDINT":
case "RINT":
case "RWORD":
case "BYTE":

@@ -473,2 +489,13 @@ if (typeof data !== 'number') throw new NodeS7Error('ERR_INVALID_ARGUMENT', `Data for item of type '${type}' must be a number`);

break;
/** Reversed datatypes (little-endian) */
case "RREAL":
return buffer.writeFloatLE(data, offset);
case "RDWORD":
return buffer.writeUInt32LE(data, offset);
case "RDINT":
return buffer.writeInt32LE(data, offset);
case "RINT":
return buffer.writeInt16LE(data, offset);
case "RWORD":
return buffer.writeUInt16LE(data, offset);
default:

@@ -475,0 +502,0 @@ throw new Error(`Cannot parse data of unknown type "${this._props.datatype}" for item "${this._string}"`);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc