mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 14:28:25 +08:00
feat: Add sync version of ReadStatus
This commit is contained in:
@@ -492,6 +492,18 @@ namespace S7.Net
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read the current status from the PLC. A value of 0x08 indicates the PLC is in run status, regardless of the PLC type.
|
||||
/// </summary>
|
||||
/// <returns>The current PLC status.</returns>
|
||||
public byte ReadStatus()
|
||||
{
|
||||
var dataToSend = BuildSzlReadRequestPackage(0x0424, 0);
|
||||
var s7data = RequestTsdu(dataToSend);
|
||||
|
||||
return (byte) (s7data[37] & 0x0f);
|
||||
}
|
||||
|
||||
private byte[] RequestTsdu(byte[] requestData) => RequestTsdu(requestData, 0, requestData.Length);
|
||||
|
||||
private byte[] RequestTsdu(byte[] requestData, int offset, int length)
|
||||
|
||||
Reference in New Issue
Block a user