public class NetworkConnectedCip extends NetworkDeviceBase
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
OTConnectionId |
int |
SessionHandle |
protected int |
TOConnectionId |
WordLengthAlienSession, isPersistentConn, IsSocketError, isUseAccountCertificate, LogMsgFormatBinary, simpleHybirdLockCoreSocket, fileCacheSize, LogNet, TokenLogNet| 构造器和说明 |
|---|
NetworkConnectedCip() |
| 限定符和类型 | 方法和说明 |
|---|---|
static OperateResultExThree<byte[],Short,Boolean> |
ExtractActualData(byte[] response,
boolean isRead)
从PLC反馈的数据解析出真实的数据内容,结果内容分别是原始字节数据,数据类型代码,是否有很多的数据
The real data content is parsed from the data fed back by the PLC. |
protected OperateResult |
ExtraOnDisconnect(Socket socket)
根据实际的协议选择是否重写本方法,有些协议在断开连接之前,需要发送一些报文来关闭当前的网络通道
Select whether to rewrite this method according to the actual protocol. |
protected byte[] |
GetLargeForwardClose()
获取数据通信的后置关闭命令,不同的PLC的信息不一样。
|
protected byte[] |
GetLargeForwardOpen(short connectionID)
获取数据通信的前置打开命令,不同的PLC的信息不一样。
|
protected INetMessage |
GetNewNetMessage()
获取一个新的消息对象的方法,需要在继承类里面进行重写
The method to get a new message object needs to be overridden in the inheritance class |
protected OperateResult |
InitializationOnConnect(Socket socket)
根据实际的协议选择是否重写本方法,有些协议在创建连接之后,需要进行一些初始化的信号握手,才能最终建立网络通道。
|
protected byte[] |
PackCommandService(byte[]... cip)
将多个的CIP命令打包成一个服务的命令
|
protected byte[] |
PackCommandWithHeader(byte[] command)
对当前的命令进行打包处理,通常是携带命令头内容,标记当前的命令的长度信息,需要进行重写,否则默认不打包
|
Read, ReadBool, ReadBool, ReadCustomer, ReadDouble, ReadDouble, ReadFloat, ReadFloat, ReadInt16, ReadInt16, ReadInt32, ReadInt32, ReadInt64, ReadInt64, ReadString, ReadString, ReadUInt16, ReadUInt16, ReadUInt32, ReadUInt32, toString, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, WriteCustomer, WriteUnicodeString, WriteUnicodeStringAccountCertificate, ConnectClose, ConnectServer, ConnectServer, ExtraAfterReadFromCoreServer, GetAvailableSocket, getByteTransform, getConnectionId, getConnectTimeOut, getIpAddress, getPort, getReceiveTimeOut, getSleepTime, IpAddressPing, ReadFromCoreServer, ReadFromCoreServer, ReadFromCoreServer, setByteTransform, setConnectionId, setConnectTimeOut, setIpAddress, SetLoginAccount, SetPersistentConnection, setPort, setReceiveTimeOut, setSleepTime, UnpackResponseContentCheckRemoteToken, 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 int SessionHandle
protected int OTConnectionId
protected int TOConnectionId
protected INetMessage GetNewNetMessage()
NetworkDoubleBaseGetNewNetMessage 在类中 NetworkDoubleBaseprotected byte[] PackCommandWithHeader(byte[] command)
NetworkDoubleBasePackCommandWithHeader 在类中 NetworkDoubleBasecommand - 发送的数据命令内容protected OperateResult InitializationOnConnect(Socket socket)
NetworkDoubleBaseInitializationOnConnect 在类中 NetworkDoubleBasesocket - 网络套接字protected OperateResult ExtraOnDisconnect(Socket socket)
NetworkDoubleBaseExtraOnDisconnect 在类中 NetworkDoubleBasesocket - 网络套接字protected byte[] PackCommandService(byte[]... cip)
cip - CIP命令列表protected byte[] GetLargeForwardOpen(short connectionID)
connectionID - 连接的ID信息protected byte[] GetLargeForwardClose()
public static OperateResultExThree<byte[],Short,Boolean> ExtractActualData(byte[] response, boolean isRead)
response - PLC的反馈数据isRead - 是否是返回的操作Copyright © 2022. All rights reserved.