Skip to content

Commit 4e6acbe

Browse files
committed
Finished for now
1 parent c4d7941 commit 4e6acbe

13 files changed

Lines changed: 892 additions & 599 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Changelog
22

33
## 2.0.0-beta.2 (2019-11-30)
4-
- Added `PCCCLayer.echo()`
4+
- Logix5000 CAN NOW READ STRUCTURES 🔥
5+
- TCP layer automatically handles reconnects
6+
- Logix5000 listTags now accepts a scope (e.g. Program:SymbolName)
7+
- Logix5000 added data types Program, Map, Routine, Task, Cxn
8+
- Removed `Logix5000.readTagFragmented()`, it is now called automatically when needed
59
- Fixed `PCCCLayer.typedWrite()` type/data parameter encoding
6-
- TCPLayer automatically handles reconnects
10+
- Added `PCCCLayer.echo()`
11+
- CIP ConnectionManager can now send unconnected messages - API still a work in progress
12+
713

814

915
## 2.0.0-beta.1 (2019-11-15)

src/layers/Layer.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Layer extends EventEmitter {
8787
await this.disconnect();
8888

8989
/** Do not bubble up since close has already bubbled up */
90-
internalDestroy(this);
90+
internalDestroy(this, 'Close');
9191

9292
resolver.resolve();
9393
});
@@ -104,14 +104,19 @@ class Layer extends EventEmitter {
104104

105105
forward(data, info, context) {
106106
if (this.upperLayer != null) {
107-
this.forwardTo(this.upperLayer, data, info, context);
107+
return this.forwardTo(this.upperLayer, data, info, context);
108108
}
109109
}
110110

111111
forwardTo(layer, data, info, context) {
112-
// console.log('emitting data');
113-
// console.log(data);
114-
internalHandleData(layer, data, info, context);
112+
if (layer._defragger != null) {
113+
data = layer._defragger.defrag(data);
114+
if (data == null) return;
115+
}
116+
layer.emit('data', data, info, context);
117+
return layer.handleData(data, info, context);
118+
119+
// return internalHandleData(layer, data, info, context);
115120
}
116121

117122
send(message, info, priority, context) {
@@ -227,14 +232,14 @@ function incrementContext(self) {
227232
}
228233

229234

230-
function internalHandleData(self, data, info, context) {
231-
if (self._defragger != null) {
232-
data = self._defragger.defrag(data);
233-
if (data == null) return;
234-
}
235-
self.emit('data', data, info, context);
236-
self.handleData(data, info, context);
237-
}
235+
// function internalHandleData(self, data, info, context) {
236+
// if (self._defragger != null) {
237+
// data = self._defragger.defrag(data);
238+
// if (data == null) return;
239+
// }
240+
// self.emit('data', data, info, context);
241+
// return self.handleData(data, info, context);
242+
// }
238243

239244

240245
function internalDestroy(layer, error) {

src/layers/cip/Logix5000/constants.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ const {
77
} = require('../../../utils');
88

99

10+
const LDataTypeCodes = {
11+
Program: 0x68,
12+
Map: 0x69,
13+
Routine: 0x6D,
14+
Task: 0x70,
15+
Cxn: 0x7E
16+
};
17+
18+
const LDatatypeNames = InvertKeyValues(LDataTypeCodes);
19+
1020

1121
const ClassCodes = {
1222
Symbol: 0x6B,
@@ -154,6 +164,8 @@ const GenericServiceStatusDescriptions = {
154164

155165

156166
module.exports = {
167+
LDataTypeCodes,
168+
LDatatypeNames,
157169
ClassCodes,
158170
SymbolServiceCodes,
159171
SymbolServiceNames,

0 commit comments

Comments
 (0)