public class GeSRTPNet extends NetworkDeviceBase
WordLengthAlienSession, isPersistentConn, IsSocketError, isUseAccountCertificate, LogMsgFormatBinary, simpleHybirdLockCoreSocket, fileCacheSize, LogNet, TokenLogNet| 构造器和说明 |
|---|
GeSRTPNet()
实例化一个默认的对象
Instantiate a default object |
GeSRTPNet(String ipAddress)
指定IP地址来实例化一个对象,端口默认 18245
|
GeSRTPNet(String ipAddress,
int port)
指定IP地址和端口号来实例化一个对象
Specify the IP address and port number to instantiate an object |
| 限定符和类型 | 方法和说明 |
|---|---|
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)
批量读取字节数组信息,需要指定地址和长度,返回原始的字节数组,支持 I,Q,M,T,SA,SB,SC,S,G 的位和字节读写,支持 AI,AQ,R 的字读写操作,地址示例:R1,M1
Batch read byte array information, need to specify the address and length, return the original byte array. |
OperateResultExOne<boolean[]> |
ReadBool(String address,
short length)
按照位为单位,批量从指定的地址里读取 bool 数组数据,不支持 AI,AQ,R 地址类型,地址比如从1开始,例如 I1,Q1,M1,T1,SA1,SB1,SC1,S1,G1
R address types are not supported. |
OperateResultExOne<Byte> |
ReadByte(String address)
根据指定的地址来读取一个字节的数据,按照字节为单位,例如 M1 字节,就是指 M1-M8 位组成的字节,M2 字节就是 M9-M16 组成的字节。
|
OperateResultExOne<Date> |
ReadPLCTime()
[商业授权] 读取PLC当前的时间,这个时间可能是不包含时区的,需要自己转换成本地的时间。
|
OperateResultExOne<String> |
ReadProgramName()
[商业授权] 读取PLC当前的程序的名称
[Authorization] Read the name of the current program of the PLC |
String |
toString()
返回当前对象表示的字符串
Returns the string represented by the current object |
OperateResult |
Write(String address,
boolean[] value)
按照位为单位,批量写入 bool 数组到指定的地址里,不支持 AI,AQ,R 地址类型,地址比如从1开始,例如 I1,Q1,M1,T1,SA1,SB1,SC1,S1,G1
In units of bits, write bool arrays in batches to the specified addresses. |
OperateResult |
Write(String address,
byte value)
向PLC中写入byte数据,返回是否写入成功
Write byte data to PLC and return whether the writing is successful |
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, 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 GeSRTPNet()
public GeSRTPNet(String ipAddress)
ipAddress - IP地址信息public GeSRTPNet(String ipAddress, int port)
ipAddress - Ip地址port - 端口号protected INetMessage GetNewNetMessage()
NetworkDoubleBaseGetNewNetMessage 在类中 NetworkDoubleBaseprotected OperateResult InitializationOnConnect(Socket socket)
NetworkDoubleBaseInitializationOnConnect 在类中 NetworkDoubleBasesocket - 网络套接字public OperateResultExOne<byte[]> Read(String address, short length)
Read 在接口中 IReadWriteNetRead 在类中 NetworkDeviceBaseaddress - 数据地址length - 数据长度public OperateResult Write(String address, byte[] value)
IReadWriteNetWrite 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - 起始地址value - 写入值public OperateResultExOne<Byte> ReadByte(String address)
address - 地址信息Byte 数据public OperateResult Write(String address, byte value)
address - 起始地址,格式为I100,M100,Q100,DB20.100 -> Starting address, formatted as I100,mM100,Q100,DB20.100value - byte数据 -> Byte datapublic OperateResultExOne<boolean[]> ReadBool(String address, short length)
ReadBool 在接口中 IReadWriteNetReadBool 在类中 NetworkDeviceBaseaddress - PLC的地址信息,例如 M1, G1length - 读取的长度信息,按照位为单位public OperateResult Write(String address, boolean[] value)
Write 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - PLC的地址信息,例如 M1, G1value - bool 数组public OperateResultExOne<Date> ReadPLCTime()
public OperateResultExOne<String> ReadProgramName()
public String toString()
NetworkBasetoString 在类中 NetworkDeviceBaseCopyright © 2022. All rights reserved.