#[repr(u16)]pub enum DiagnosticSubFunction {
Show 15 variants
ReturnQueryData = 0,
RestartCommunicationsOption = 1,
ReturnDiagnosticRegister = 2,
ChangeAsciiInputDelimiter = 3,
ForceListenOnlyMode = 4,
ClearCountersAndDiagnosticRegister = 10,
ReturnBusMessageCount = 11,
ReturnBusCommunicationErrorCount = 12,
ReturnBusExceptionErrorCount = 13,
ReturnServerMessageCount = 14,
ReturnServerNoResponseCount = 15,
ReturnServerNakCount = 16,
ReturnServerBusyCount = 17,
ReturnBusCharacterOverrunCount = 18,
ClearOverrunCounterAndFlag = 20,
}Expand description
Sub-function codes for Function Code 0x08 (Diagnostics).
Serial line only. See Modbus Application Protocol Specification V1.1b3, Section 6.8.
These values are 16-bit and encoded big-endian inside the PDU data field.
Variants§
ReturnQueryData = 0
0x0000 — Return Query Data (Loopback test)
RestartCommunicationsOption = 1
0x0001 — Restart Communications Option
ReturnDiagnosticRegister = 2
0x0002 — Return Diagnostic Register
ChangeAsciiInputDelimiter = 3
0x0003 — Change ASCII Input Delimiter
ForceListenOnlyMode = 4
0x0004 — Force Listen Only Mode
ClearCountersAndDiagnosticRegister = 10
0x000A — Clear Counters and Diagnostic Register
ReturnBusMessageCount = 11
0x000B — Return Bus Message Count
ReturnBusCommunicationErrorCount = 12
0x000C — Return Bus Communication Error Count
ReturnBusExceptionErrorCount = 13
0x000D — Return Bus Exception Error Count
ReturnServerMessageCount = 14
0x000E — Return Server Message Count
ReturnServerNoResponseCount = 15
0x000F — Return Server No Response Count
ReturnServerNakCount = 16
0x0010 — Return Server NAK Count
ReturnServerBusyCount = 17
0x0011 — Return Server Busy Count
ReturnBusCharacterOverrunCount = 18
0x0012 — Return Bus Character Overrun Count
ClearOverrunCounterAndFlag = 20
0x0014 — Clear Overrun Counter and Flag
Implementations§
Source§impl DiagnosticSubFunction
impl DiagnosticSubFunction
Sourcepub fn to_be_bytes(self) -> [u8; 2]
pub fn to_be_bytes(self) -> [u8; 2]
Converts the DiagnosticSubFunction enum variant into its 2-byte big-endian representation.
Trait Implementations§
Source§impl Clone for DiagnosticSubFunction
impl Clone for DiagnosticSubFunction
Source§fn clone(&self) -> DiagnosticSubFunction
fn clone(&self) -> DiagnosticSubFunction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more