public class YokogawaLinkTcp extends NetworkDeviceBase
| 限定符和类型 | 字段和说明 |
|---|---|
byte |
CpuNumber
获取或设置当前的CPU Number,默认值为1
Get or set the current CPU Number, the default value is 1 |
WordLengthAlienSession, isPersistentConn, IsSocketError, isUseAccountCertificate, LogMsgFormatBinary, simpleHybirdLockCoreSocket, fileCacheSize, LogNet, TokenLogNet| 构造器和说明 |
|---|
YokogawaLinkTcp()
实例化一个默认的对象
Instantiate a default object |
YokogawaLinkTcp(String ipAddress,
int port)
指定IP地址和端口号来实例化一个对象
Specify the IP address and port number to instantiate an object |
| 限定符和类型 | 方法和说明 |
|---|---|
static OperateResultExOne<ArrayList<byte[]>> |
BuildReadCommand(byte cpu,
String address,
short length,
boolean isBit)
构建读取命令的原始报文信息
|
static OperateResultExOne<ArrayList<byte[]>> |
BuildReadRandomCommand(byte cpu,
String[] address,
boolean isBit)
构建随机读取的原始报文的初始命令
|
static ArrayList<byte[]> |
BuildReadSpecialModule(byte cpu,
byte moduleUnit,
byte moduleSlot,
int dataPosition,
short length)
构建读取特殊模块的命令报文
|
static OperateResultExOne<ArrayList<byte[]>> |
BuildReadSpecialModule(byte cpu,
String address,
short length)
构建读取特殊模块的命令报文,需要传入高级地址,必须以 Special: 开头表示特殊模块地址,示例:Special:cpu=1;unit=0;slot=1;100
To construct a command message to read a special module, the advanced address needs to be passed in. |
static OperateResultExOne<byte[]> |
BuildStartCommand(byte cpu)
构建启动PLC的命令报文
|
static OperateResultExOne<byte[]> |
BuildStopCommand(byte cpu)
构建停止PLC的命令报文
|
static OperateResultExOne<byte[]> |
BuildWriteBoolCommand(byte cpu,
String address,
boolean[] value)
构建批量写入Bool数组的命令,需要指定CPU Number信息和设备地址信息
|
static OperateResultExOne<byte[]> |
BuildWriteRandomBoolCommand(byte cpu,
String[] address,
boolean[] value)
构建批量随机写入Bool数组的命令,需要指定CPU Number信息和设备地址信息
|
static OperateResultExOne<byte[]> |
BuildWriteRandomWordCommand(byte cpu,
String[] address,
byte[] value)
构建随机写入字的命令的报文
|
static byte[] |
BuildWriteSpecialModule(byte cpu,
byte moduleUnit,
byte moduleSlot,
int dataPosition,
byte[] data)
构建读取特殊模块的命令报文
|
static OperateResultExOne<byte[]> |
BuildWriteSpecialModule(byte cpu,
String address,
byte[] data)
构建写入特殊模块的命令报文,需要传入高级地址,必须以 Special: 开头表示特殊模块地址,示例:Special:cpu=1;unit=0;slot=1;100
To construct a command message to write a special module, the advanced address needs to be passed in. |
static OperateResultExOne<byte[]> |
BuildWriteWordCommand(byte cpu,
String address,
byte[] value)
构建字写入的命令报文信息,需要指定设备地址
|
static OperateResultExOne<byte[]> |
CheckContent(byte[] content)
检查当前的反馈内容,如果没有发生错误,就解析出实际的数据内容。
|
protected INetMessage |
GetNewNetMessage()
获取一个新的消息对象的方法,需要在继承类里面进行重写
The method to get a new message object needs to be overridden in the inheritance class |
OperateResult |
ModuleReset()
[商业授权] 重置当前的模块,当前打开的连接被强制关闭。
|
OperateResultExOne<byte[]> |
Read(String address,
short length)
读取的线圈地址支持X,Y,I,E,M,T,C,L,寄存器地址支持D,B,F,R,V,Z,W,TN,CN,举例:D100;也可以携带CPU进行访问,举例:cpu=2;D100
[商业授权] 如果想要读取特殊模块的数据,需要使用 Special: 开头标记,举例:Special:unit=0;slot=1;100 The read coil address supports X, Y, I, E, M, T, C, L, and the register address supports D, B, F, R, V, Z, W, TN, CN, for example: D100; it can also be carried CPU access, for example: cpu=2;D100. |
OperateResultExOne<boolean[]> |
ReadBool(String address,
short length)
读取的线圈地址支持X,Y,I,E,M,T,C,L,举例:Y100;也可以携带CPU进行访问,举例:cpu=2;Y100
The read coil address supports X, Y, I, E, M, T, C, L, for example: Y100; you can also carry the CPU for access, for example: cpu=2;Y100 |
OperateResultExOne<Date> |
ReadDateTime()
[商业授权] 读取当前PLC的时间信息,包含年月日时分秒
b>[Authorization] Read current PLC time information, including year, month, day, hour, minute, and second |
OperateResultExOne<Integer> |
ReadProgramStatus()
[商业授权] 读取当前PLC的程序状态,返回1:RUN;2:Stop;3:Debug;255:ROM writer
[Authorization] Read the program status. return code 1:RUN; 2:Stop; 3:Debug; 255:ROM writer |
OperateResultExOne<byte[]> |
ReadRandom(String[] address)
|
OperateResultExOne<boolean[]> |
ReadRandomBool(String[] address)
[商业授权] 随机读取
Boolean数组信息,主需要出传入String数组地址信息,就可以返回批量Boolean值[Authorization] Random read Boolean array information, the master needs to pass in the String array address information,
and then the batch can be returned to Boolean value
读取的线圈地址支持X,Y,I,E,M,T,C,L,举例:Y100;也可以携带CPU进行访问,举例:cpu=2;Y100 The read coil address supports X, Y, I, E, M, T, C, L, for example: Y100; you can also carry the CPU for access, for example: cpu=2;Y100 |
OperateResultExOne<short[]> |
ReadRandomInt16(String[] address)
|
OperateResultExOne<byte[]> |
ReadSpecialModule(byte moduleUnit,
byte moduleSlot,
int dataPosition,
short length)
[商业授权] 读取特殊模块的数据信息,需要指定模块单元号,模块站号,数据地址,长度信息。
|
OperateResultExOne<YokogawaSystemInfo> |
ReadSystemInfo()
[商业授权] 读取当前PLC的系统状态,系统的ID,CPU类型,程序大小信息
[Authorization] Read current PLC system status, system ID, CPU type, program size information |
OperateResult |
Start()
[商业授权] 如果未执行程序,则开始执行程序
[Authorization] Starts executing a program if it is not being executed This command will be ignored if it is executed while a program is being executed. |
OperateResult |
Stop()
[商业授权] 停止当前正在执行程序
[Authorization] Stops the executing program. |
String |
toString()
返回当前对象表示的字符串
Returns the string represented by the current object |
OperateResult |
Write(String address,
boolean[] value)
写入的线圈地址支持Y,I,E,M,T,C,L,举例:Y100;也可以携带CPU进行访问,举例:cpu=2;Y100
The write coil address supports Y, I, E, M, T, C, L, for example: Y100; you can also carry the CPU for access, for example: cpu=2;Y100 |
OperateResult |
Write(String address,
byte[] value)
写入的线圈地址支持Y,I,E,M,T,C,L,寄存器地址支持D,B,F,R,V,Z,W,TN,CN,举例:D100;也可以携带CPU进行访问,举例:cpu=2;D100
如果想要写入特殊模块的数据,需要使用 Special: 开头标记,举例:Special:unit=0;slot=1;100 The read coil address supports Y, I, E, M, T, C, L, and the register address supports D, B, F, R, V, Z, W, TN, CN, for example: D100; it can also be carried CPU access, for example: cpu=2;D100. |
OperateResult |
WriteRandom(String[] address,
byte[] value)
|
OperateResult |
WriteRandom(String[] address,
short[] value)
|
OperateResult |
WriteRandomBool(String[] address,
boolean[] value)
[商业授权] 随机写入
Boolean数组信息,主需要出传入String数组地址信息,以及对应的Boolean数组值[Authorization] Randomly write the Boolean array information, the main need to pass in the String array address information,
and the corresponding Boolean array value
写入的线圈地址支持Y,I,E,M,T,C,L,举例:Y100;也可以携带CPU进行访问,举例:cpu=2;Y100 The write coil address supports Y, I, E, M, T, C, L, for example: Y100; you can also carry the CPU for access, for example: cpu=2;Y100 |
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, 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 byte CpuNumber
public YokogawaLinkTcp()
public YokogawaLinkTcp(String ipAddress, int port)
ipAddress - Ip地址port - 端口号protected INetMessage GetNewNetMessage()
NetworkDoubleBaseGetNewNetMessage 在类中 NetworkDoubleBasepublic OperateResultExOne<byte[]> Read(String address, short length)
Read 在接口中 IReadWriteNetRead 在类中 NetworkDeviceBaseaddress - PLC的地址信息 D, B, F, R, V, Z, W, TN, CN, for example: D100;length - 读取的地址长度public OperateResult Write(String address, byte[] value)
Write 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - PLC的地址信息value - 写入的原始字节数据public OperateResultExOne<boolean[]> ReadBool(String address, short length)
ReadBool 在接口中 IReadWriteNetReadBool 在类中 NetworkDeviceBaseaddress - 读取的起始地址信息length - 读取的长度信息public OperateResult Write(String address, boolean[] value)
Write 在接口中 IReadWriteNetWrite 在类中 NetworkDeviceBaseaddress - 读取的线圈地址支持X,Y,I,E,M,T,C,L,举例:Y100;也可以携带CPU进行访问,举例:cpu=2;Y100value - 等待写入的值public OperateResultExOne<boolean[]> ReadRandomBool(String[] address)
Boolean数组信息,主需要出传入String数组地址信息,就可以返回批量Boolean值Boolean array information, the master needs to pass in the String array address information,
and then the batch can be returned to Boolean value
address - 批量地址信息public OperateResult WriteRandomBool(String[] address, boolean[] value)
Boolean数组信息,主需要出传入String数组地址信息,以及对应的Boolean数组值Boolean array information, the main need to pass in the String array address information,
and the corresponding Boolean array value
address - 批量地址信息value - 批量的数据值信息public OperateResultExOne<byte[]> ReadRandom(String[] address)
Byte数组信息,主需要出传入String数组地址信息,就可以返回批量Byte值Byte array information, the master needs to pass in the String array address information,
and then the batch can be returned to Byte valueaddress - 批量地址信息public OperateResultExOne<short[]> ReadRandomInt16(String[] address)
Short数组信息,主需要出传入String数组地址信息,就可以返回批量Short值Short array information, the master needs to pass in the String array address information,
and then the batch can be returned to Short valueaddress - 批量地址信息public OperateResult WriteRandom(String[] address, byte[] value)
Byte数组信息,主需要出传入String数组地址信息,以及对应的Byte数组值Byte array information, the main need to pass in the String array address information,
and the corresponding Byte array valueaddress - 批量地址信息value - 批量的数据值信息public OperateResult WriteRandom(String[] address, short[] value)
Short数组信息,主需要出传入String数组地址信息,以及对应的Short数组值Short array information, the main need to pass in the String array address information,
and the corresponding Short array valueaddress - 批量地址信息value - 批量的数据值信息public OperateResult Start()
public OperateResult Stop()
public OperateResult ModuleReset()
public OperateResultExOne<Integer> ReadProgramStatus()
public OperateResultExOne<YokogawaSystemInfo> ReadSystemInfo()
public OperateResultExOne<Date> ReadDateTime()
public OperateResultExOne<byte[]> ReadSpecialModule(byte moduleUnit, byte moduleSlot, int dataPosition, short length)
moduleUnit - 模块的单元号moduleSlot - 模块的站号dataPosition - 模块的数据地址length - 长度信息public static OperateResultExOne<byte[]> CheckContent(byte[] content)
content - 原始的数据内容public static OperateResultExOne<ArrayList<byte[]>> BuildReadCommand(byte cpu, String address, short length, boolean isBit)
cpu - Cpu Numberaddress - 地址数据信息length - 数据长度信息isBit - 是否位访问public static OperateResultExOne<ArrayList<byte[]>> BuildReadRandomCommand(byte cpu, String[] address, boolean isBit)
cpu - Cpu Numberaddress - 实际的数据地址信息isBit - 是否是位读取public static OperateResultExOne<byte[]> BuildWriteBoolCommand(byte cpu, String address, boolean[] value)
cpu - Cpu Numberaddress - 设备地址数据value - 实际的bool数组public static OperateResultExOne<byte[]> BuildWriteRandomBoolCommand(byte cpu, String[] address, boolean[] value)
cpu - Cpu Numberaddress - 设备地址数据value - 实际的bool数组public static OperateResultExOne<byte[]> BuildWriteWordCommand(byte cpu, String address, byte[] value)
cpu - Cpu Numberaddress - 地址value - 原始的数据值public static OperateResultExOne<byte[]> BuildWriteRandomWordCommand(byte cpu, String[] address, byte[] value)
cpu - Cpu Numberaddress - 地址value - 原始的数据值public static OperateResultExOne<byte[]> BuildStartCommand(byte cpu)
cpu - Cpu Numberpublic static OperateResultExOne<byte[]> BuildStopCommand(byte cpu)
cpu - Cpu Numberpublic static ArrayList<byte[]> BuildReadSpecialModule(byte cpu, byte moduleUnit, byte moduleSlot, int dataPosition, short length)
cpu - Cpu NumbermoduleUnit - 模块单元号moduleSlot - 模块站号dataPosition - 数据位置length - 长度信息public static OperateResultExOne<ArrayList<byte[]>> BuildReadSpecialModule(byte cpu, String address, short length)
cpu - Cpu Numberaddress - 高级的混合地址,除了Cpu可以不携带,例如:Special:unit=0;slot=1;100length - 长度信息public static byte[] BuildWriteSpecialModule(byte cpu,
byte moduleUnit,
byte moduleSlot,
int dataPosition,
byte[] data)
cpu - Cpu NumbermoduleUnit - 模块单元号moduleSlot - 模块站号dataPosition - 数据位置data - 数据内容public static OperateResultExOne<byte[]> BuildWriteSpecialModule(byte cpu, String address, byte[] data)
cpu - Cpu Numberaddress - 高级的混合地址,除了Cpu可以不携带,例如:Special:unit=0;slot=1;100data - 写入的原始数据内容public String toString()
NetworkBasetoString 在类中 NetworkDeviceBaseCopyright © 2022. All rights reserved.