Comments (8)
This looks familiar. I was getting some weird error (I think this one) and I think it came down to group reads with a bad tag, but it was a while ago so I canβt be sure.
Iβm in the habit now of always reading tags individually first to check that they work, then only adding them to a group if they were successful on the individual read.
from node-ethernet-ip.
Okay, can you share the snippet of code that seems to be causing the issue. This is a new one so I'd like to gather a little more context.
Thanks π
from node-ethernet-ip.
I don't know where this is coming from exactly. Most of the time everything works great. The error is random and not frequent.
I create a connection and then every three seconds I create a tag, read it, add that number of tags to a tag group, read it, then write to the tag group. Sort of like so:
// client.PLC Controller() and client.group TagGroup() is created the first time before the 3 sec loop
const strLen = new Tag('myTag.LEN', 'myProgram', DINT);
try {
await client.PLC.readTag(strLen);
} catch (err) {
throw err;
}
// first I clean out the old .DATA before adding the new to the group
client.group.forEach((oldTag) => {
if (oldTag.name.includes(`myTag.DATA[`)) {
client.group.remove(oldTag);
}
});
for (let i=0; i<strLen[newTag].value; i++) {
client.group.add(new Tag(`myTag.DATA[${i}]`, 'myProgram'));
}
// there are various other tags added to the group I'm leaving out
try {
await client.PLC.readTagGroup(client.group);
} catch (err) {
throw err;
}
// the writing is much more involved since data is coming from a separate source but for simplicity
const someText = 'Hello';
client.group.forEach((tag) => {
charIndex = parseInt(tag.name.substring(tag.name.indexOf('.DATA[')+6, tag.name.length - 1), 10);
tag.value = someText.charCodeAt(charIndex);
}
try {
await client.PLC.writeTagGroup(client.group);
} catch (err) {
throw err;
}
Sorry I don't have much more. The error could also be coming directly after the connect or shutdown.
from node-ethernet-ip.
@ajcanterbury Did you double to check to make sure every tag in the group read existed? If so, did this help resolve the issue?
from node-ethernet-ip.
I've not been able to link this error to a bad tag, not that this is not the case. There were multiple tests being performed when I saw this uncaught error. The problem is that I believe it would be very inefficient to check each individual tag programmatically since my group can be very large.
from node-ethernet-ip.
hmmmm, so you would prefer an option to let the group fail silently in the case that a bad tag is detected. Possibly auto-remove the bad tag from the group? just thinking out loud
from node-ethernet-ip.
Auto-remove could work if that's possible. Easy fix might be to throw an error for a bad buffer message and allowing the read to fail.
from node-ethernet-ip.
hmmmm, so you would prefer an option to let the group fail silently in the case that a bad tag is detected. Possibly auto-remove the bad tag from the group? just thinking out loud
Something like this might be a good idea. The Node-RED node for this library currently have issues in this case, as if there's a single tag that cannot be read, the whole reading fail. I even have a script to read a list of them individually, so I can check before reading them in a group.
Dropping them out of the group and emitting an event to signalize it would make it much easier :)
from node-ethernet-ip.
Related Issues (20)
- Class1 Implicit message
- TCP connection leaking on closing connection HOT 1
- Add an option to configure the timeout of "Unconnected Send" messages HOT 1
- Changed Event is missed for previously written tags
- Waht is the max Size of a TagGroup? HOT 2
- Decimal precision is not correct HOT 4
- Question: Can I get tag descriptions? HOT 3
- High PLC CPU utilization and large number of connection errors. HOT 14
- Can't Read Tag by using attribute ID HOT 1
- Error: TIMEOUT occurred while reading Controller Props. - Micrologix 1100 HOT 5
- tag.generateReadMessageRequest is not a function
- Error connecting to PLC: Error: TIMEOUT occurred while reading Controller Props. HOT 4
- Is this Project Still Maintained? HOT 4
- Possible for multiple scan rates without creating a "new" controller for each one? HOT 5
- Preferred disconnection or unsubscribe method?
- String Tags in Compact Logix / Control Logix HOT 1
- Micro820 PLC , Error: <SCAN_GROUP> TIMEOUT occurred while writing Reading Tag Group HOT 1
- PLC.foreach() doesn't work HOT 1
- Software name HOT 1
- Micro Queue is already full at size of 100 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-ethernet-ip.