Skip to content

使用McPLC,无法成功写入数据到设备 #26

@yangshuyi

Description

@yangshuyi

你好,我使用iot-communication的McPLC模块,往plc的一个地址写数据,没有报错,但是值没有写入成功。读取的还是旧的值。我试了Boolean,UInt等数据类型都是一样的效果。如果使用GX Work3可以正常读写地址。请问可能的原因是什么

    public static void nativeExecute() throws Exception {
        McPLC mcPLC = new McPLC(EMcSeries.IQ_R, ipAddress, 5002);

        mcPLC.writeBoolean(address, true);

        RuntimeUtils.threadSleep(1000);

        boolean result = mcPLC.readBoolean(address);
        System.out.println("result:" + result);
    }

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