public class MelsecMcUdp extends NetworkUdpDeviceBase implements IReadWriteMc
WordLengthsimpleHybirdLockCoreSocket, fileCacheSize, LogNet, TokenLogNet| 构造器和说明 |
|---|
MelsecMcUdp() |
MelsecMcUdp(String ipAddress,
int port) |
| 限定符和类型 | 方法和说明 |
|---|---|
OperateResult |
ErrorStateReset()
LED 熄灭 出错代码初始化
LED off Error code initialization |
byte[] |
ExtractActualData(byte[] response,
boolean isBit)
从PLC反馈的数据中提取出实际的数据内容,需要传入反馈数据,是否位读取
|
McType |
getMcType()
获取当前的PLC类型
|
byte |
getNetworkNumber()
获取网络号
|
byte |
getNetworkStationNumber()
获取网络站号
|
OperateResultExOne<McAddressData> |
McAnalysisAddress(String address,
short length)
当前MC协议的分析地址的方法,对传入的字符串格式的地址进行数据解析。
|
protected 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[]> |
ReadExtend(short extend,
String address,
short length)
读取扩展的数据信息,需要在原有的地址,长度信息之外,输入扩展值信息
To read the extended data information, you need to enter the extended value information in addition to the original address and length information |
OperateResultExOne<byte[]> |
ReadMemory(String address,
short length)
读取缓冲寄存器的数据信息,地址直接为偏移地址
Read the data information of the buffer register, the address is directly the offset address |
OperateResultExOne<String> |
ReadPlcType()
读取PLC的型号信息,例如 Q02HCPU
Read PLC model information, such as Q02HCPU |
OperateResultExOne<byte[]> |
ReadRandom(String[] address)
随机读取PLC的数据信息,可以跨地址,跨类型组合,但是每个地址只能读取一个word,也就是2个字节的内容。
|
OperateResultExOne<byte[]> |
ReadRandom(String[] address,
short[] length)
随机读取PLC的数据信息,可以跨地址,跨类型组合,每个地址是任意的长度。
|
OperateResultExOne<short[]> |
ReadRandomInt16(String[] address)
随机读取PLC的数据信息,可以跨地址,跨类型组合,但是每个地址只能读取一个word,也就是2个字节的内容。
|
OperateResultExOne<byte[]> |
ReadTags(String[] tags,
short[] length)
读取PLC的标签信息,需要传入标签的名称,读取的字长度,标签举例:A; label[1]; bbb[10,10,10]
To read the label information of the PLC, you need to pass in the name of the label, the length of the word read, and an example of the label: A; label [1]; bbb [10,10,10] |
OperateResultExOne<byte[]> |
ReadTags(String tag,
short length)
读取PLC的标签信息,需要传入标签的名称,读取的字长度,标签举例:A; label[1]; bbb[10,10,10]
To read the label information of the PLC, you need to pass in the name of the label, the length of the word read, and an example of the label: A; label [1]; bbb [10,10,10] |
OperateResult |
RemoteReset()
远程Reset操作
Remote Reset Operation |
OperateResult |
RemoteRun()
远程Run操作
Remote Run Operation |
OperateResult |
RemoteStop()
远程Stop操作
Remote Stop operation |
void |
setNetworkNumber(byte networkNumber)
设置网络号
|
void |
setNetworkStationNumber(byte networkStationNumber)
设置网络站号
|
String |
toString()
返回当前对象表示的字符串
Returns the string represented by the current object |
protected OperateResultExOne<byte[]> |
UnpackResponseContent(byte[] send,
byte[] response)
根据对方返回的报文命令,对命令进行基本的拆包,例如各种Modbus协议拆包为统一的核心报文,还支持对报文的验证
|
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 |
ConnectClose, getByteTransform, ReadBool, ReadCustomer, ReadDouble, ReadDouble, ReadFloat, ReadFloat, ReadInt16, ReadInt16, ReadInt32, ReadInt32, ReadInt64, ReadInt64, ReadString, ReadString, ReadUInt16, ReadUInt16, ReadUInt32, ReadUInt32, setByteTransform, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, WriteCustomer, WriteUnicodeString, WriteUnicodeStringgetConnectionId, getIpAddress, getPort, getReceiveCacheLength, getReceiveTimeOut, ReadFromCoreServer, ReadFromCoreServer, setConnectionId, setIpAddress, setPort, setReceiveCacheLength, setReceiveTimeOutCheckRemoteToken, 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, waitgetByteTransformReadFromCoreServerConnectClose, getConnectionId, ReadBool, ReadCustomer, ReadDouble, ReadDouble, ReadFloat, ReadFloat, ReadInt16, ReadInt16, ReadInt32, ReadInt32, ReadInt64, ReadInt64, ReadString, ReadString, ReadUInt16, ReadUInt16, ReadUInt32, ReadUInt32, setConnectionId, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, Write, WriteCustomerpublic MelsecMcUdp()
public MelsecMcUdp(String ipAddress, int port)
public byte getNetworkNumber()
getNetworkNumber 在接口中 IReadWriteMcpublic void setNetworkNumber(byte networkNumber)
setNetworkNumber 在接口中 IReadWriteMcnetworkNumber - 网络号public byte getNetworkStationNumber()
getNetworkStationNumber 在接口中 IReadWriteMcpublic void setNetworkStationNumber(byte networkStationNumber)
setNetworkStationNumber 在接口中 IReadWriteMcnetworkStationNumber - 网络站号public McType getMcType()
getMcType 在接口中 IReadWriteMcpublic OperateResultExOne<McAddressData> McAnalysisAddress(String address, short length)
IReadWriteMcMcAnalysisAddress 在接口中 IReadWriteMcaddress - 地址信息length - 数据长度protected byte[] PackCommandWithHeader(byte[] command)
NetworkUdpBasePackCommandWithHeader 在类中 NetworkUdpBasecommand - 发送的数据命令内容protected OperateResultExOne<byte[]> UnpackResponseContent(byte[] send, byte[] response)
NetworkUdpBaseUnpackResponseContent 在类中 NetworkUdpBasesend - 发送的原始报文数据response - 设备方反馈的原始报文内容public byte[] ExtractActualData(byte[] response,
boolean isBit)
IReadWriteMcExtractActualData 在接口中 IReadWriteMcresponse - 反馈的数据内容isBit - 是否位读取public OperateResultExOne<byte[]> Read(String address, short length)
IReadWriteNetRead 在接口中 IReadWriteNetRead 在类中 NetworkUdpDeviceBaseaddress - 数据地址length - 数据长度public OperateResultExOne<boolean[]> ReadBool(String address, short length)
IReadWriteNetBoolean 数组信息,需要指定地址和长度,返回 Boolean 数组Boolean array information, need to specify the address and length, return Boolean arrayReadBool 在接口中 IReadWriteNetReadBool 在类中 NetworkUdpDeviceBaseaddress - 数据地址length - 数据长度public OperateResult Write(String address, byte[] value)
IReadWriteNetWrite 在接口中 IReadWriteNetWrite 在类中 NetworkUdpDeviceBaseaddress - 起始地址value - 写入值public OperateResult Write(String address, boolean[] values)
IReadWriteNetWrite 在接口中 IReadWriteNetWrite 在类中 NetworkUdpDeviceBaseaddress - 起始地址values - 写入值public OperateResultExOne<byte[]> ReadRandom(String[] address)
address - 所有的地址的集合public OperateResultExOne<byte[]> ReadRandom(String[] address, short[] length)
address - 所有的地址的集合length - 每个地址的长度信息public OperateResultExOne<short[]> ReadRandomInt16(String[] address)
address - 所有的地址的集合public OperateResultExOne<byte[]> ReadTags(String tag, short length)
tag - 标签名length - 读取长度public OperateResultExOne<byte[]> ReadTags(String[] tags, short[] length)
tags - 标签名length - 读取长度public OperateResultExOne<byte[]> ReadExtend(short extend, String address, short length)
extend - 扩展信息address - 地址length - 数据长度public OperateResultExOne<byte[]> ReadMemory(String address, short length)
address - 偏移地址length - 读取长度public OperateResult RemoteRun()
public OperateResult RemoteStop()
public OperateResult RemoteReset()
public OperateResultExOne<String> ReadPlcType()
public OperateResult ErrorStateReset()
public String toString()
NetworkBasetoString 在类中 NetworkUdpDeviceBaseCopyright © 2022. All rights reserved.