public class MelsecA1EAsciiNet extends NetworkDeviceBase
WordLengthAlienSession, isPersistentConn, IsSocketError, isUseAccountCertificate, LogMsgFormatBinary, simpleHybirdLockCoreSocket, fileCacheSize, LogNet, TokenLogNet| 构造器和说明 |
|---|
MelsecA1EAsciiNet()
实例化三菱的A兼容1E帧协议的通讯对象
|
MelsecA1EAsciiNet(String ipAddress,
int port)
实例化一个三菱的A兼容1E帧协议的通讯对象
|
| 限定符和类型 | 方法和说明 |
|---|---|
static OperateResultExOne<byte[]> |
BuildReadCommand(String address,
short length,
boolean isBit,
byte plcNumber)
根据类型地址长度确认需要读取的指令头
|
static OperateResultExOne<byte[]> |
BuildWriteBoolCommand(String address,
boolean[] value,
byte plcNumber)
根据类型地址以及需要写入的数据来生成指令头
|
static OperateResultExOne<byte[]> |
BuildWriteWordCommand(String address,
byte[] value,
byte plcNumber)
根据类型地址以及需要写入的数据来生成指令头
|
static OperateResult |
CheckResponseLegal(byte[] response)
检测反馈的消息是否合法
|
static OperateResultExOne<byte[]> |
ExtractActualData(byte[] response,
boolean isBit)
从PLC反馈的数据中提取出实际的数据内容,需要传入反馈数据,是否位读取
|
protected INetMessage |
GetNewNetMessage()
获取一个新的消息对象的方法,需要在继承类里面进行重写
The method to get a new message object needs to be overridden in the inheritance class |
byte |
getPLCNumber()
获取PLC编号
|
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)
|
void |
setPLCNumber(byte plcNumber)
设置PLC编号
|
OperateResult |
Write(String address,
boolean[] values)
|
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, InitializationOnConnect, 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 MelsecA1EAsciiNet()
public MelsecA1EAsciiNet(String ipAddress, int port)
ipAddress - PLCd的Ip地址port - PLC的端口protected INetMessage GetNewNetMessage()
NetworkDoubleBaseGetNewNetMessage 在类中 NetworkDoubleBasepublic byte getPLCNumber()
public void setPLCNumber(byte plcNumber)
plcNumber - PLC编号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[] values)
IReadWriteNetWrite 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - 起始地址values - 写入值public static OperateResultExOne<byte[]> BuildReadCommand(String address, short length, boolean isBit, byte plcNumber)
address - 起始地址length - 长度isBit - 指示是否按照位成批的读出plcNumber - PLC编号public static OperateResultExOne<byte[]> BuildWriteWordCommand(String address, byte[] value, byte plcNumber)
address - 起始地址value - 数据值plcNumber - PLC编号public static OperateResultExOne<byte[]> BuildWriteBoolCommand(String address, boolean[] value, byte plcNumber)
address - 起始地址value - 数据值plcNumber - PLC编号public static OperateResult CheckResponseLegal(byte[] response)
response - 接收的报文public static OperateResultExOne<byte[]> ExtractActualData(byte[] response, boolean isBit)
response - 反馈的数据内容isBit - 是否位读取Copyright © 2022. All rights reserved.