en-us_commands:reference:imodbusrtumem
This is an old revision of the document!
Table of Contents
ImodbusRTUMem()
ImodbusRTUMem() sets the sizes of M and D memory used by the Slave.
void ImodbusRTUMem(uint16_t m_size, uint16_t d_size)
Commands
| Command | Arguments | Return Value | Operation |
|---|---|---|---|
ImodbusRTUMem(m_size, d_size) | uint16_t m_sizeuint16_t d_size | void | Sets the sizes of M and D memory used by the Slave. |
Example
ImodbusRTUMem(100, 100);
Precautions
- Keep calling the Slave or Master execution function in
loop(). - The data array size must be at least the requested quantity.
- Do not treat return codes BUSY and IDLE as communication failures.
- When sharing
MandDwith Cnet/MC Protocol, define a single final size and initialization order. Do not callImodbusRTUMem()orICnetMem()again at runtime. - Memory allocation functions do not return success status. For nonzero sizes, verify that
MandDare notnullptrbefore accessing them in user code.
en-us_commands/reference/imodbusrtumem.1788785567.txt.gz · Last modified: by 127.0.0.1
