Skip to content

Coils go to 0 at start regardless of what the set value is  #58

Open
@Ferryistaken

Description

@Ferryistaken

I have this block of code in my setup(), which should theoretically set all coils to 1, but when I turn on the arduino the coils go to 0, and only go to the correct value when I send a modbus command to the arduino (even a read). Is there something that I am not understanding or is this a bug?

    const bool defaultCoilValue = 1;
    for (int i = startCoilAddress; i <= numberOfCoils; i++) {
        mb.addCoil(i, defaultCoilValue);
        mb.addIsts(i, defaultCoilValue);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions