public class McBinaryHelper extends Object
| 构造器和说明 |
|---|
McBinaryHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
BuildReadMcCoreCommand(McAddressData addressData,
boolean isBit)
从三菱地址,是否位读取进行创建读取的MC的核心报文
From the Mitsubishi address, whether to read the core message of the MC for creating and reading |
static byte[] |
BuildReadMcCoreExtendCommand(McAddressData addressData,
short extend,
boolean isBit)
从三菱扩展地址,是否位读取进行创建读取的MC的核心报文
|
static OperateResultExOne<byte[]> |
BuildReadMemoryCommand(String address,
short length)
读取本站缓冲寄存器的数据信息,需要指定寄存器的地址,和读取的长度
|
static byte[] |
BuildReadRandomCommand(McAddressData[] address)
随机读取的指令创建
|
static byte[] |
BuildReadRandomWordCommand(McAddressData[] address)
按字为单位随机读取的指令创建
|
static OperateResultExOne<byte[]> |
BuildReadSmartModule(short module,
String address,
short length)
构建读取智能模块的命令,需要指定模块编号,起始地址,读取的长度,注意,该长度以字节为单位。
|
static byte[] |
BuildReadTag(String[] tags,
short[] lengths)
创建批量读取标签的报文数据信息
|
static byte[] |
BuildWriteBitCoreCommand(McAddressData addressData,
boolean[] value)
以位为单位,创建数据写入的核心报文
|
static byte[] |
BuildWriteWordCoreCommand(McAddressData addressData,
byte[] value)
以字为单位,创建数据写入的核心报文
|
static OperateResult |
CheckResponseContentHelper(byte[] content)
检查从MC返回的数据是否是合法的。
|
static byte[] |
ExtractActualDataHelper(byte[] response,
boolean isBit) |
static OperateResultExOne<byte[]> |
ExtraTagData(byte[] content)
解析出标签读取的数据内容
|
static byte[] |
PackMcCommand(byte[] mcCore,
byte networkNumber,
byte networkStationNumber)
将MC协议的核心报文打包成一个可以直接对PLC进行发送的原始报文
|
static OperateResultExOne<byte[]> |
ReadTags(IReadWriteMc mc,
String[] tags,
short[] length)
读取PLC的标签信息,需要传入标签的名称,读取的字长度,标签举例:A; label[1]; bbb[10,10,10]
To read the label information of the PLC, you need to pass in the name of the label, the length of the word read, and an example of the label: A; label [1]; bbb [10,10,10] |
public static byte[] PackMcCommand(byte[] mcCore,
byte networkNumber,
byte networkStationNumber)
mcCore - MC协议的核心报文networkNumber - 网络号networkStationNumber - 网络站号public static OperateResult CheckResponseContentHelper(byte[] content)
content - 数据内容public static byte[] BuildReadMcCoreCommand(McAddressData addressData, boolean isBit)
addressData - 三菱Mc协议的数据地址isBit - 是否进行了位读取操作public static byte[] BuildWriteWordCoreCommand(McAddressData addressData, byte[] value)
addressData - 三菱Mc协议的数据地址value - 实际的原始数据信息public static byte[] BuildWriteBitCoreCommand(McAddressData addressData, boolean[] value)
addressData - 三菱Mc协议的数据地址value - 原始的bool数组数据public static byte[] BuildReadMcCoreExtendCommand(McAddressData addressData, short extend, boolean isBit)
addressData - 是否进行了位读取操作extend - 扩展指定isBit - 三菱Mc协议的数据地址public static byte[] BuildReadRandomWordCommand(McAddressData[] address)
address - 地址数组public static byte[] BuildReadRandomCommand(McAddressData[] address)
address - 地址数组public static byte[] BuildReadTag(String[] tags, short[] lengths) throws Exception
tags - 标签名lengths - 长度信息Exception - 异常信息public static OperateResultExOne<byte[]> BuildReadMemoryCommand(String address, short length)
address - 寄存器的地址length - 数据长度public static OperateResultExOne<byte[]> BuildReadSmartModule(short module, String address, short length)
module - 模块编号address - 智能模块的起始地址length - 读取的字长度public static OperateResultExOne<byte[]> ExtraTagData(byte[] content)
content - 返回的数据信息public static OperateResultExOne<byte[]> ReadTags(IReadWriteMc mc, String[] tags, short[] length)
tags - 标签名length - 读取长度public static byte[] ExtractActualDataHelper(byte[] response,
boolean isBit)
Copyright © 2022. All rights reserved.