Namespaces | |
NT18B07 | |
R421A | |
RID35 | |
STM8Relay | |
STS | |
Classes | |
struct | ADU |
class | Device |
A virtual device, represents a modbus slave device. More... | |
class | GenericRequest |
struct | PDU |
Protocol Data Unit. More... | |
class | Request |
Enumerations | |
enum | Exception { Exception::Success = 0x00, Exception::IllegalFunction = 0x01, Exception::IllegalDataAddress = 0x02, Exception::IllegalDataValue = 0x03, Exception::SlaveDeviceFailure = 0x04 } |
Modbus exception codes returned in response packets. More... | |
enum | Function { Function::XX } |
Functions | |
bool | operator! (Exception exception) |
ErrorCode | readRequest (RS485::Controller &controller, ADU &adu) |
void | sendResponse (RS485::Controller &controller, ADU &adu) |
Detailed Description
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Created on: 1 May 2018
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Copyright 2022 mikee47 mike@ sill yhous e.ne t
This file is part of the IOControl Library
This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.
Enumeration Type Documentation
◆ Exception
|
strong |
Modbus exception codes returned in response packets.
Enumerator | |
---|---|
Success | No exception, transaction completed normally. |
IllegalFunction | Function not allowed/supported/implemented, or device in wrong state to process request. For example, an unconfigured device may be unable to return register values. |
IllegalDataAddress | Data address not allowed. More specifically, the combination of reference number and transfer length is invalid. For a controller with 100 registers, the ADU addresses the first register as 0, and the last one as 99. If a request is submitted with a starting register address of 96 and a quantity of registers of 4, then this request will successfully operate (address-wise at least) on registers 96, 97, 98, 99. If a request is submitted with a starting register address of 96 and a quantity of registers of 5, then this request will fail with Exception Code 0x02 "Illegal Data Address" since it attempts to operate on registers 96, 97, 98, 99 and 100, and there is no register with address 100. |
IllegalDataValue | Data value not allowed. This indicates a fault in the structure of the remainder of a complex request, such as that the implied length is incorrect. It specifically does NOT mean that a data item submitted for storage in a register has a value outside the expectation of the application program, since the MODBUS protocol is unaware of the significance of any particular value of any particular register. |
SlaveDeviceFailure | Protocol slave device failure exception. An unrecoverable error occurred while the server (or slave) was attempting to perform the requested action. |
◆ Function
|
strong |
Function Documentation
◆ operator!()
◆ printRequest() [1/2]
◆ printRequest() [2/2]
◆ printResponse() [1/2]
◆ printResponse() [2/2]
◆ readRequest()
ErrorCode IO::Modbus::readRequest | ( | RS485::Controller & | controller, |
ADU & | adu | ||
) |
◆ sendResponse()
void IO::Modbus::sendResponse | ( | RS485::Controller & | controller, |
ADU & | adu | ||
) |