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

读数据程序无响应 #3

Open
easyboot opened this issue Apr 26, 2023 · 2 comments
Open

读数据程序无响应 #3

easyboot opened this issue Apr 26, 2023 · 2 comments

Comments

@easyboot
Copy link

我用工具读很快就可以读出来
image

用下面的代码
mcProtocolTcp = new McProtocolTcp(ip, port, McFrame.MC3E);

        result = await mcProtocolTcp.Open();

    public async Task<int[]> GetBitDevice(string DeviceName, int iSize)
    {
        var bytes = await mcProtocolTcp.GetBitDevice(DeviceName, iSize);
        return bytes;
        // var oDataNew2 = await mcProtocolTcp.GetBitDevice("M85", 10);//以位方式读取10个
        // return oDataNew2
    }

程序没有报错,但是也不会返回数据结果。

@ping9719
Copy link
Owner

1.PMcProtocol是否尝试过其他的McFrame类型
2.可以使用HslCommunication,在某个版本前是开源的免费的。
3.可以尝试试试IotClient,这是开源的,也是实现了'MC'协议。
4.继续等待,我也正在出一款类似于HslCommunication的开源的类库,可能还需要半年或更长的时间。

@easyboot
Copy link
Author

image
原因是PLC设置为二进制码通讯就好了,之前设置的是ascii码通讯,

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