I can't write to a tag, that does reads successfully.
Summary:
I want to write to some indexes inside an array in a program scope tag. I'm able to read the tags, but when I attempt to write I get the following error:
Error: TIMEOUT occurred while writing Writing Tag: Program:[program].[tag-name]
Do you guys have a discord server?
Current Behavior:
When attempting to write to a tag array it's rejecting the promise on a TIMEOUT error.
Expected Behavior:
Write to manipulated tag array indexes.
Context
export const sendCommand = async (command: Command) => {
try {
const PLC = new Controller();
await PLC.connect(command.ip, command.slot);
const programName = command.commandTag.split(":")[1].split(".")[0];
const tagName = command.commandTag.split(".")[1];
const tagObj = new Tag(tagName, programName, Types.REAL, 0, 1, 1000);
await PLC.readTag(tagObj);
for (let i = 0; i < command.parameters.length; i++) {
const parameter = command.parameters[i];
tagObj.value[i] = parameter.value;
}
tagObj.value[command.offsetNum] = command.command;
await PLC.writeTag(tagObj); // rejects this promise
await PLC.disconnect();
} catch (error) {
console.log(error);
}
};
Environment:
- Package version (Use
npm list- e.g. 1.0.6): 2.6.7 - Node Version (Use
node --version- e.g. 9.8.0): 18.16.1 - Operating System and version: Ubuntu 23.04
- Controller Type (eg 1756-L83E/B): 1756-L84E
- Controller Firmware (eg 30.11): 32.013
To update this issue, it was being caused by the large array, 1k elements. When I lowered the number of elements the timeouts went away.
Yep. That is a bug / missing implementation. Latest commit should work 59141c7 . pull from repo and try out. Not published to NPM yet.
You will have to run npm run build where it installed to compile the Typescript.