Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't write to a tag, that does reads successfully. #53

Open
William-Brumble opened this issue Nov 23, 2023 · 2 comments
Open

I can't write to a tag, that does reads successfully. #53

William-Brumble opened this issue Nov 23, 2023 · 2 comments

Comments

@William-Brumble
Copy link

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
@William-Brumble
Copy link
Author

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.

@SerafinTech
Copy link
Owner

SerafinTech commented Dec 18, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants