public class MelsecFxSerialHelper extends Object
| 构造器和说明 |
|---|
MelsecFxSerialHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static OperateResult |
ActivePlc(IReadWriteDevice plc) |
static OperateResultExTwo<ArrayList<byte[]>,Integer> |
BuildReadBoolCommand(String address,
short length,
boolean isNewVersion)
根据类型地址长度确认需要读取的指令头
|
static OperateResultExOne<ArrayList<byte[]>> |
BuildReadWordCommand(String address,
short length,
boolean isNewVersion)
根据类型地址长度确认需要读取的指令头
|
static OperateResultExOne<byte[]> |
BuildWriteBoolPacket(String address,
boolean value) |
static OperateResultExOne<byte[]> |
BuildWriteWordCommand(String address,
byte[] value,
boolean isNewVersion) |
static OperateResult |
CheckPlcReadResponse(byte[] ack) |
static OperateResult |
CheckPlcWriteResponse(byte[] ack) |
static OperateResultExOne<boolean[]> |
ExtractActualBoolData(byte[] response,
int start,
int length) |
static OperateResultExOne<byte[]> |
ExtractActualData(byte[] response) |
static OperateResultExOne<byte[]> |
Read(IReadWriteDevice plc,
String address,
short length,
boolean isNewVersion)
根据指定的地址及长度信息从三菱PLC中读取原始的字节数据,根据PLC中实际定义的规则,可以解析出任何类的数据信息
Read the original byte data from the Mitsubishi PLC according to the specified address and length information. |
static OperateResultExOne<boolean[]> |
ReadBool(IReadWriteDevice plc,
String address,
short length,
boolean isNewVersion)
从三菱PLC中批量读取位软元件,返回读取结果,该读取地址最好从0,16,32...等开始读取,这样可以读取比较长的数据数组
Read bit devices in batches from Mitsubishi PLC and return the read results. |
static OperateResult |
Write(IReadWriteDevice plc,
String address,
boolean value) |
static OperateResult |
Write(IReadWriteDevice plc,
String address,
byte[] value,
boolean isNewVersion) |
public static OperateResultExOne<byte[]> Read(IReadWriteDevice plc, String address, short length, boolean isNewVersion)
plc - PLC通信对象address - 读取地址,支持的类型参考文档说明length - 读取的数据长度isNewVersion - 是否是新版的串口访问类public static OperateResultExOne<boolean[]> ReadBool(IReadWriteDevice plc, String address, short length, boolean isNewVersion)
plc - PLC的通信对象address - 起始地址length - 读取的长度isNewVersion - 是否是新版的串口访问类public static OperateResult Write(IReadWriteDevice plc, String address, byte[] value, boolean isNewVersion)
public static OperateResult Write(IReadWriteDevice plc, String address, boolean value)
public static OperateResult ActivePlc(IReadWriteDevice plc)
public static OperateResult CheckPlcReadResponse(byte[] ack)
public static OperateResult CheckPlcWriteResponse(byte[] ack)
public static OperateResultExOne<byte[]> BuildWriteBoolPacket(String address, boolean value)
public static OperateResultExOne<ArrayList<byte[]>> BuildReadWordCommand(String address, short length, boolean isNewVersion)
address - 起始地址length - 长度isNewVersion - 是否是新版的串口访问类public static OperateResultExTwo<ArrayList<byte[]>,Integer> BuildReadBoolCommand(String address, short length, boolean isNewVersion)
address - 起始地址length - bool数组长度isNewVersion - 是否是新版的串口访问类public static OperateResultExOne<byte[]> BuildWriteWordCommand(String address, byte[] value, boolean isNewVersion)
public static OperateResultExOne<byte[]> ExtractActualData(byte[] response)
public static OperateResultExOne<boolean[]> ExtractActualBoolData(byte[] response, int start, int length)
Copyright © 2022. All rights reserved.