public class OmronFinsNetHelper extends Object
| 构造器和说明 |
|---|
OmronFinsNetHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static OperateResultExOne<ArrayList<byte[]>> |
BuildReadCommand(String[] address)
同时读取多个地址的命令报文信息
|
static OperateResultExOne<byte[][]> |
BuildReadCommand(String address,
short length,
boolean isBit,
int splitLength)
根据读取的地址,长度,是否位读取创建Fins协议的核心报文
According to the read address, length, whether to read the core message that creates the Fins protocol |
static OperateResultExOne<byte[]> |
BuildWriteWordCommand(String address,
byte[] value,
boolean isBit)
根据写入的地址,数据,是否位写入生成Fins协议的核心报文
According to the written address, data, whether the bit is written to generate the core message of the Fins protocol |
static String |
GetStatusDescription(int err)
根据欧姆龙返回的错误码,获取错误信息的字符串描述文本
According to the error code returned by Profinet.Omron, get the string description text of the error message |
static OperateResultExOne<byte[]> |
Read(IReadWriteDevice omron,
String[] address)
从欧姆龙PLC中读取多个地址的数据,返回读取结果,每个地址按照字为单位读取,地址格式为"D100","C100","W100","H100","A100"
|
static OperateResultExOne<byte[]> |
Read(IReadWriteDevice omron,
String address,
short length,
int splits)
从欧姆龙PLC中读取想要的数据,返回读取结果,读取长度的单位为字,地址格式为"D100","C100","W100","H100","A100"
Read the desired data from the Profinet.Omron PLC and return the read result. |
static OperateResultExOne<boolean[]> |
ReadBool(IReadWriteDevice omron,
String address,
short length,
int splits)
从欧姆龙PLC中批量读取位软元件,地址格式为"D100.0","C100.0","W100.0","H100.0","A100.0"
Read bit devices in batches from Profinet.Omron PLC with address format "D100.0", "C100.0", "W100.0", "H100.0", "A100.0" |
static OperateResultExOne<byte[]> |
ResponseValidAnalysis(byte[] response)
验证欧姆龙的Fins-TCP返回的数据是否正确的数据,如果正确的话,并返回所有的数据内容
Verify that the data returned by Profinet.Omron's Fins-TCP is correct data, if correct, and return all data content |
static OperateResultExOne<byte[]> |
UdpResponseValidAnalysis(byte[] response)
验证欧姆龙的Fins-Udp返回的数据是否正确的数据,如果正确的话,并返回所有的数据内容
Verify that the data returned by Profinet.Omron's Fins-Udp is correct data, if correct, and return all data content |
static OperateResult |
Write(IReadWriteDevice omron,
String address,
boolean[] values)
向PLC中位软元件写入bool数组,返回是否写入成功,比如你写入D100,values[0]对应D100.0,地址格式为"D100.0","C100.0","W100.0","H100.0","A100.0"
Write the bool array to the PLC's median device and return whether the write was successful. |
static OperateResult |
Write(IReadWriteDevice omron,
String address,
byte[] value)
向PLC写入数据,数据格式为原始的字节类型,地址格式为"D100","C100","W100","H100","A100"
Write data to PLC, the data format is the original byte type, and the address format is "D100", "C100", "W100", "H100", "A100" |
public static OperateResultExOne<ArrayList<byte[]>> BuildReadCommand(String[] address)
address - 多个地址public static OperateResultExOne<byte[][]> BuildReadCommand(String address, short length, boolean isBit, int splitLength)
address - 地址,具体格式请参照示例说明length - 读取的数据长度isBit - 是否使用位读取public static OperateResultExOne<byte[]> BuildWriteWordCommand(String address, byte[] value, boolean isBit)
address - 地址内容,具体格式请参照示例说明value - 实际的数据isBit - 是否位数据public static OperateResultExOne<byte[]> ResponseValidAnalysis(byte[] response)
response - 来自欧姆龙返回的数据内容public static OperateResultExOne<byte[]> UdpResponseValidAnalysis(byte[] response)
response - 来自欧姆龙返回的数据内容public static String GetStatusDescription(int err)
err - 错误码public static OperateResultExOne<byte[]> Read(IReadWriteDevice omron, String address, short length, int splits)
omron - PLC设备的连接对象address - 读取地址,格式为"D100","C100","W100","H100","A100"length - 读取的数据长度splits - 分割信息public static OperateResultExOne<byte[]> Read(IReadWriteDevice omron, String[] address)
omron - PLC设备的连接对象address - 从欧姆龙PLC中读取多个地址的数据,返回读取结果,每个地址按照字为单位读取,地址格式为"D100","C100","W100","H100","A100"public static OperateResult Write(IReadWriteDevice omron, String address, byte[] value)
omron - PLC设备的连接对象address - 初始地址value - 原始的字节数据public static OperateResultExOne<boolean[]> ReadBool(IReadWriteDevice omron, String address, short length, int splits)
omron - PLC设备的连接对象address - 读取地址,格式为"D100","C100","W100","H100","A100"length - 读取的长度splits - 分割信息public static OperateResult Write(IReadWriteDevice omron, String address, boolean[] values)
omron - PLC设备的连接对象address - 要写入的数据地址values - 要写入的实际数据,可以指定任意的长度Copyright © 2022. All rights reserved.