public class MelsecFxSerialOverTcp extends NetworkDeviceBase
| 限定符和类型 | 字段和说明 |
|---|---|
boolean |
IsNewVersion |
WordLengthAlienSession, isPersistentConn, IsSocketError, isUseAccountCertificate, LogMsgFormatBinary, simpleHybirdLockCoreSocket, fileCacheSize, LogNet, TokenLogNet| 构造器和说明 |
|---|
MelsecFxSerialOverTcp()
实例化网络版的三菱的串口协议的通讯对象
Instantiate the communication object of Mitsubishi's serial protocol on the network |
MelsecFxSerialOverTcp(String ipAddress,
int port)
指定ip地址及端口号来实例化三菱的串口协议的通讯对象
Specify the IP address and port number to instantiate the communication object of Mitsubishi's serial protocol |
| 限定符和类型 | 方法和说明 |
|---|---|
OperateResult |
ActivePlc() |
protected OperateResult |
InitializationOnConnect(Socket socket)
根据实际的协议选择是否重写本方法,有些协议在创建连接之后,需要进行一些初始化的信号握手,才能最终建立网络通道。
|
boolean |
isUseGot()
获取是否使用GOT连接三菱的PLC,当使用了GOT连接到
|
byte[] |
PackCommandWithHeader(byte[] command)
对当前的命令进行打包处理,通常是携带命令头内容,标记当前的命令的长度信息,需要进行重写,否则默认不打包
|
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,
short length)
|
OperateResultExOne<byte[]> |
ReadFromCoreServer(Socket socket,
byte[] send,
boolean hasResponseData,
boolean usePackAndUnpack)
将数据报文发送指定的网络通道上,根据当前指定的
INetMessage 类型,返回一条完整的数据指令Sends a data message to the specified network channel, and returns a complete data command according to the currently specified |
void |
setUseGot(boolean useGot)
设置是否使用GOT连接三菱的PLC,当使用了GOT连接到
|
String |
toString()
返回当前对象表示的字符串
Returns the string represented by the current object |
OperateResultExOne<byte[]> |
UnpackResponseContent(byte[] send,
byte[] response)
根据对方返回的报文命令,对命令进行基本的拆包,例如各种Modbus协议拆包为统一的核心报文,还支持对报文的验证
|
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, 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, GetNewNetMessage, getPort, getReceiveTimeOut, getSleepTime, IpAddressPing, ReadFromCoreServer, ReadFromCoreServer, setByteTransform, setConnectionId, setConnectTimeOut, setIpAddress, 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 MelsecFxSerialOverTcp()
public MelsecFxSerialOverTcp(String ipAddress, int port)
ipAddress - Ip地址port - 端口号public boolean isUseGot()
public void setUseGot(boolean useGot)
useGot - 是否使用的值public byte[] PackCommandWithHeader(byte[] command)
NetworkDoubleBasePackCommandWithHeader 在类中 NetworkDoubleBasecommand - 发送的数据命令内容public OperateResultExOne<byte[]> UnpackResponseContent(byte[] send, byte[] response)
NetworkDoubleBaseUnpackResponseContent 在类中 NetworkDoubleBasesend - 发送的原始报文数据response - 设备方反馈的原始报文内容protected OperateResult InitializationOnConnect(Socket socket)
NetworkDoubleBaseInitializationOnConnect 在类中 NetworkDoubleBasesocket - 网络套接字public OperateResultExOne<byte[]> ReadFromCoreServer(Socket socket, byte[] send, boolean hasResponseData, boolean usePackAndUnpack)
NetworkDoubleBaseINetMessage 类型,返回一条完整的数据指令ReadFromCoreServer 在类中 NetworkDoubleBasesocket - 指定的套接字send - 发送的完整的报文信息hasResponseData - 是否有等待的数据返回usePackAndUnpack - 是否需要对命令重新打包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, short length)
IReadWriteNetBoolean 数组信息,需要指定地址和长度,返回 Boolean 数组Boolean array information, need to specify the address and length, return Boolean arrayReadBool 在接口中 IReadWriteNetReadBool 在类中 NetworkDeviceBaseaddress - 数据地址length - 数据长度public OperateResult Write(String address, boolean value)
IReadWriteNetWrite 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - 起始地址value - 写入值public OperateResult ActivePlc()
public String toString()
NetworkBasetoString 在类中 NetworkDeviceBaseCopyright © 2022. All rights reserved.