All Downloads are FREE. Search and download functionalities are using the official Maven repository.

HslCommunication.Core.IMessage.FujiSPBMessage Maven / Gradle / Ivy

Go to download

一个工业物联网的底层架构框架,专注于底层的技术通信及跨平台,跨语言通信功能,实现各种主流的PLC数据读写,实现modbus的各种协议读写等等

There is a newer version: 3.7.0
Show newest version
package HslCommunication.Core.IMessage;

import HslCommunication.BasicFramework.SoftBasic;
import HslCommunication.Utilities;

import java.nio.charset.StandardCharsets;

/**
 * 富士SPB的消息内容
 */
public class FujiSPBMessage extends NetMessageBase implements INetMessage {
    public int ProtocolHeadBytesLength() {
        return 5;
    }

    public int GetContentLengthByHeadBytes() {
        byte[] HeadBytes = getHeadBytes();
        byte[] SendBytes = getSendBytes();
        if (HeadBytes == null) return 0;
        return Integer.parseInt(new String(HeadBytes, 3, 2, StandardCharsets.US_ASCII), 16) * 2 + 2;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy