public class GeHelper extends Object
| 构造器和说明 |
|---|
GeHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static OperateResultExOne<byte[]> |
BuildReadCommand(long id,
GeSRTPAddress address)
构建一个读取数据的报文命令,需要指定消息号,读取的 GE 地址信息
To construct a message command to read data, you need to specify the message number and read GE address information |
static OperateResultExOne<byte[]> |
BuildReadCommand(long id,
String address,
short length,
boolean isBit) |
static OperateResultExOne<byte[]> |
BuildReadCoreCommand(long id,
byte code,
byte[] data)
构建一个读取数据的报文信息,需要指定操作的数据代码,读取的参数信息
To construct a message information for reading data, you need to specify the data code of the operation and the parameter information to be read |
static OperateResultExOne<byte[]> |
BuildWriteCommand(long id,
GeSRTPAddress address,
byte[] value) |
static OperateResultExOne<byte[]> |
BuildWriteCommand(long id,
String address,
boolean[] value)
构建一个批量写入 bool 数组变量的报文,需要指定消息号,写入的地址,地址参照
|
static OperateResultExOne<byte[]> |
BuildWriteCommand(long id,
String address,
byte[] value)
构建一个批量写入 byte 数组变量的报文,需要指定消息号,写入的地址,地址参照
|
static OperateResultExOne<Date> |
ExtraDateTime(byte[] content)
从实际的时间的字节数组里解析出C#格式的时间对象,这个时间可能是时区0的时间,需要自行转化本地时间。
|
static OperateResultExOne<String> |
ExtraProgramName(byte[] content)
实际的返回的字节数组里解析出PLC的程序的名称。
|
static OperateResultExOne<byte[]> |
ExtraResponseContent(byte[] content)
从PLC返回的数据中,提取出实际的数据内容,最少6个字节的数据。
|
public static OperateResultExOne<byte[]> BuildReadCoreCommand(long id, byte code, byte[] data)
id - 消息号code - 操作代码data - 数据参数public static OperateResultExOne<byte[]> BuildReadCommand(long id, GeSRTPAddress address)
id - 消息号address - GE 的地址public static OperateResultExOne<byte[]> BuildReadCommand(long id, String address, short length, boolean isBit)
public static OperateResultExOne<byte[]> BuildWriteCommand(long id, GeSRTPAddress address, byte[] value)
public static OperateResultExOne<byte[]> BuildWriteCommand(long id, String address, byte[] value)
id - 消息的序号address - 地址信息value - byte数组的原始数据public static OperateResultExOne<byte[]> BuildWriteCommand(long id, String address, boolean[] value)
id - 消息的序号address - 地址信息value - bool数组public static OperateResultExOne<byte[]> ExtraResponseContent(byte[] content)
content - PLC返回的数据信息public static OperateResultExOne<Date> ExtraDateTime(byte[] content)
content - 字节数组public static OperateResultExOne<String> ExtraProgramName(byte[] content)
content - 字节数组Copyright © 2022. All rights reserved.