public class OmronFinsNet extends NetworkDeviceBase
| 限定符和类型 | 字段和说明 |
|---|---|
byte |
DA1
PLC的节点地址,这个值在配置了ip地址之后是默认赋值的,默认为Ip地址的最后一位
PLC node address. |
byte |
DA2
PLC的单元号地址,通常都为0
PLC unit number address, usually 0 |
byte |
DNA
PLC的网络号地址,默认0x00
PLC network number address, default 0x00
|
byte |
GCT
网络层信息,默认0x02,如果有八层消息,就设置为0x07
Network layer information, default is 0x02, if there are eight layers of messages, set to 0x07
|
byte |
ICF
信息控制字段,默认0x80
Information control field, default 0x80
|
int |
ReadSplits
进行字读取的时候对于超长的情况按照本属性进行切割,默认500,如果不是CP1H及扩展模块的,可以设置为999,可以提高一倍的通信速度。
|
byte |
RSV
系统使用的内部信息
Internal information used by the system
|
byte |
SA1
上位机的节点地址,默认是0x01,当连接PLC之后,将由PLC来设定当前的值。
|
byte |
SA2
上位机的单元号地址
Unit number and address of the computer |
byte |
SID
设备的标识号
Device identification number |
byte |
SNA
上位机的网络号地址
Network number and address of the computer |
WordLengthAlienSession, isPersistentConn, IsSocketError, isUseAccountCertificate, LogMsgFormatBinary, simpleHybirdLockCoreSocket, fileCacheSize, LogNet, TokenLogNet| 构造器和说明 |
|---|
OmronFinsNet()
实例化一个欧姆龙Fins帧协议的通讯对象
Instantiate a communication object of Profinet.Omron PLC Fins frame protocol |
OmronFinsNet(String ipAddress,
int port)
指定ip地址和端口号来实例化一个欧姆龙PLC Fins帧协议的通讯对象
Specify the IP address and port number to instantiate a communication object of the Profinet.Omron PLC Fins frame protocol |
| 限定符和类型 | 方法和说明 |
|---|---|
DataFormat |
getDataFormat()
获取多字节数据的反转类型,适用于int,float,double,long类型的数据
|
protected INetMessage |
GetNewNetMessage()
获取一个新的消息对象的方法,需要在继承类里面进行重写
The method to get a new message object needs to be overridden in the inheritance class |
protected OperateResult |
InitializationOnConnect(Socket socket)
根据实际的协议选择是否重写本方法,有些协议在创建连接之后,需要进行一些初始化的信号握手,才能最终建立网络通道。
|
boolean |
isStringReverse()
字符串数据是否发生反转
|
protected byte[] |
PackCommandWithHeader(byte[] command)
对当前的命令进行打包处理,通常是携带命令头内容,标记当前的命令的长度信息,需要进行重写,否则默认不打包
|
OperateResultExOne<byte[]> |
Read(String[] address)
从欧姆龙PLC中读取多个地址的数据,返回读取结果,每个地址按照字为单位读取,地址格式为"D100","C100","W100","H100","A100"
|
OperateResultExOne<byte[]> |
Read(String address,
short length)
从欧姆龙PLC中读取想要的数据,返回读取结果,读取长度的单位为字,地址格式为"D100","C100","W100","H100","A100"
Read the desired data from the Profinet.Omron PLC and return the read result. |
OperateResultExOne<boolean[]> |
ReadBool(String address,
short length)
从欧姆龙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" |
void |
setDataFormat(DataFormat dataFormat)
设置多字节数据的反转类型,适用于int,float,double,long类型的数据
|
void |
setIpAddress(String ipAddress)
重写Ip地址的赋值的实现
|
void |
setStringReverse(boolean stringReverse)
设置字符串数据是否反转
|
String |
toString()
返回表示当前对象的字符串
|
protected OperateResultExOne<byte[]> |
UnpackResponseContent(byte[] send,
byte[] response)
根据对方返回的报文命令,对命令进行基本的拆包,例如各种Modbus协议拆包为统一的核心报文,还支持对报文的验证
|
OperateResult |
Write(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. |
OperateResult |
Write(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" |
ReadBool, ReadCustomer, ReadDouble, ReadDouble, ReadFloat, ReadFloat, ReadInt16, ReadInt16, ReadInt32, ReadInt32, ReadInt64, ReadInt64, ReadString, ReadString, ReadUInt16, ReadUInt16, ReadUInt32, ReadUInt32, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, WriteCustomer, WriteUnicodeString, WriteUnicodeStringAccountCertificate, ConnectClose, ConnectServer, ConnectServer, ExtraAfterReadFromCoreServer, ExtraOnDisconnect, GetAvailableSocket, getByteTransform, getConnectionId, getConnectTimeOut, getIpAddress, getPort, getReceiveTimeOut, getSleepTime, IpAddressPing, ReadFromCoreServer, ReadFromCoreServer, ReadFromCoreServer, setByteTransform, setConnectionId, setConnectTimeOut, SetLoginAccount, SetPersistentConnection, setPort, setReceiveTimeOut, setSleepTimeCheckRemoteToken, CloseSocket, CreateSocketAndConnect, CreateSocketAndConnect, CreateSocketAndConnect, ReadStream, Receive, Receive, Receive, ReceiveAndCheckBytes, ReceiveByMessage, ReceiveByMessage, ReceiveBytesContentFromSocket, ReceiveBytesContentFromSocket, ReceiveCommandLineFromSocket, ReceiveCommandLineFromSocket, ReceiveCommandLineFromSocket, ReceiveCommandLineFromSocket, ReceiveFrameWebSocketPayload, ReceiveHslMessage, ReceiveMqttMessage, ReceiveRedisCommand, ReceiveRedisCommandString, ReceiveStringArrayContentFromSocket, ReceiveStringArrayContentFromSocket, ReceiveStringContentFromSocket, ReceiveStringContentFromSocket, ReceiveWebSocketPayload, Send, Send, SendAccountAndCheckReceive, SendBaseAndCheckReceive, SendBytesAndCheckReceive, SendStreamToSocket, SendStringAndCheckReceive, SendStringAndCheckReceive, ThreadPoolCheckTimeOut, WriteStream, WriteStreamFromSocketclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitReadFromCoreServerConnectClose, getConnectionId, setConnectionIdpublic byte ICF
public byte RSV
public byte GCT
public byte DNA
public byte DA1
public byte DA2
public byte SNA
public byte SA1
public byte SA2
public byte SID
public int ReadSplits
public OmronFinsNet()
public OmronFinsNet(String ipAddress, int port)
ipAddress - PLCd的Ip地址port - PLC的端口protected INetMessage GetNewNetMessage()
NetworkDoubleBaseGetNewNetMessage 在类中 NetworkDoubleBasepublic void setIpAddress(String ipAddress)
setIpAddress 在类中 NetworkDoubleBaseipAddress - IP地址public DataFormat getDataFormat()
public boolean isStringReverse()
public void setDataFormat(DataFormat dataFormat)
dataFormat - 数据类型public void setStringReverse(boolean stringReverse)
stringReverse - bool值protected byte[] PackCommandWithHeader(byte[] command)
NetworkDoubleBasePackCommandWithHeader 在类中 NetworkDoubleBasecommand - 发送的数据命令内容protected OperateResultExOne<byte[]> UnpackResponseContent(byte[] send, byte[] response)
NetworkDoubleBaseUnpackResponseContent 在类中 NetworkDoubleBasesend - 发送的原始报文数据response - 设备方反馈的原始报文内容protected OperateResult InitializationOnConnect(Socket socket)
NetworkDoubleBaseInitializationOnConnect 在类中 NetworkDoubleBasesocket - 网络套接字public OperateResultExOne<byte[]> Read(String address, short length)
Read 在接口中 IReadWriteNetRead 在类中 NetworkDeviceBaseaddress - 读取地址,格式为"D100","C100","W100","H100","A100"length - 读取的数据长度,字最大值960,位最大值7168public OperateResultExOne<byte[]> Read(String[] address)
address - 从欧姆龙PLC中读取多个地址的数据,返回读取结果,每个地址按照字为单位读取,地址格式为"D100","C100","W100","H100","A100"public OperateResult Write(String address, byte[] value)
Write 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - 起始地址value - 原始数据public OperateResultExOne<boolean[]> ReadBool(String address, short length)
ReadBool 在接口中 IReadWriteNetReadBool 在类中 NetworkDeviceBaseaddress - 读取地址,格式为"D100","C100","W100","H100","A100"length - 读取的长度public OperateResult Write(String address, boolean[] values)
Write 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - 要写入的数据地址values - 要写入的实际数据,可以指定任意的长度public String toString()
toString 在类中 NetworkDeviceBaseCopyright © 2022. All rights reserved.