public class AllenBradleySLCNet extends NetworkDeviceBase
| 限定符和类型 | 字段和说明 |
|---|---|
int |
SessionHandle
The current session handle, which is determined by the PLC when communicating with the PLC handshake
|
WordLengthAlienSession, isPersistentConn, IsSocketError, isUseAccountCertificate, LogMsgFormatBinary, simpleHybirdLockCoreSocket, fileCacheSize, LogNet, TokenLogNet| 构造器和说明 |
|---|
AllenBradleySLCNet()
Instantiate a communication object for a Allenbradley PLC protocol
|
AllenBradleySLCNet(String ipAddress,
int port)
Instantiate a communication object for a Allenbradley PLC protocol, default port is 44818
|
| 限定符和类型 | 方法和说明 |
|---|---|
static OperateResultExThree<Byte,Short,Short> |
AnalysisAddress(String address)
分析当前的地址信息,返回类型代号,区块号,起始地址
nalyze the current address information, return the type code, block number, and actual address |
static OperateResultExTwo<String,Integer> |
AnalysisBitIndex(String address)
分析地址数据信息里的位索引的信息
|
static OperateResultExOne<byte[]> |
BuildReadCommand(String address,
short length)
构建读取的指令信息
|
static OperateResultExOne<byte[]> |
BuildWriteCommand(String address,
boolean value) |
static OperateResultExOne<byte[]> |
BuildWriteCommand(String address,
byte[] value)
构建写入的报文内容,变成实际的数据
|
static OperateResultExOne<byte[]> |
ExtraActualContent(byte[] content)
解析当前的实际报文内容,变成数据内容
|
protected INetMessage |
GetNewNetMessage()
获取一个新的消息对象的方法,需要在继承类里面进行重写
The method to get a new message object needs to be overridden in the inheritance class |
protected OperateResult |
InitializationOnConnect(Socket socket)
根据实际的协议选择是否重写本方法,有些协议在创建连接之后,需要进行一些初始化的信号握手,才能最终建立网络通道。
|
OperateResultExOne<byte[]> |
Read(String address,
short length)
批量读取字节数组信息,需要指定地址和长度,返回原始的字节数组
Batch read byte array information, need to specify the address and length, return the original byte array |
OperateResultExOne<Boolean> |
ReadBool(String address)
|
OperateResult |
Write(String address,
boolean value)
|
OperateResult |
Write(String address,
byte[] value)
写入原始的byte数组数据到指定的地址,返回是否写入成功
Write the original byte array data to the specified address, and return whether the write was successful |
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, WriteCustomer, WriteUnicodeString, WriteUnicodeStringAccountCertificate, ConnectClose, ConnectServer, ConnectServer, ExtraAfterReadFromCoreServer, ExtraOnDisconnect, GetAvailableSocket, getByteTransform, getConnectionId, getConnectTimeOut, getIpAddress, getPort, getReceiveTimeOut, getSleepTime, IpAddressPing, PackCommandWithHeader, 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
public AllenBradleySLCNet()
public AllenBradleySLCNet(String ipAddress, int port)
ipAddress - PLC IpAddressport - PLC Port, default port is 44818protected INetMessage GetNewNetMessage()
NetworkDoubleBaseGetNewNetMessage 在类中 NetworkDoubleBaseprotected OperateResult InitializationOnConnect(Socket socket)
NetworkDoubleBaseInitializationOnConnect 在类中 NetworkDoubleBasesocket - 网络套接字public OperateResultExOne<byte[]> Read(String address, short length)
IReadWriteNetRead 在接口中 IReadWriteNetRead 在类中 NetworkDeviceBaseaddress - 数据地址length - 数据长度public OperateResult Write(String address, byte[] value)
IReadWriteNetWrite 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - 起始地址value - 写入值public OperateResultExOne<Boolean> ReadBool(String address)
IReadWriteNetReadBool 在接口中 IReadWriteNetReadBool 在类中 NetworkDeviceBaseaddress - 数据地址public OperateResult Write(String address, boolean value)
IReadWriteNetWrite 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - 起始地址value - 写入值public static OperateResultExTwo<String,Integer> AnalysisBitIndex(String address)
address - 数据地址public static OperateResultExThree<Byte,Short,Short> AnalysisAddress(String address)
address - 地址信息public static OperateResultExOne<byte[]> BuildReadCommand(String address, short length)
address - 地址信息,举例:A9:0length - 读取的长度信息public static OperateResultExOne<byte[]> BuildWriteCommand(String address, byte[] value)
address - 地址信息value - 数据值public static OperateResultExOne<byte[]> BuildWriteCommand(String address, boolean value)
public static OperateResultExOne<byte[]> ExtraActualContent(byte[] content)
content - 报文内容Copyright © 2022. All rights reserved.