User Tools

Site Tools


en-us_commands:reference:imodbusrtumem

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en-us_commands:reference:imodbusrtumem [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:reference:imodbusrtumem [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1
Line 16: Line 16:
  
 <code cpp> <code cpp>
-ImodbusRTUMem(100, 100);+void setup() { 
 +  ImodbusRTUMem(100, 200);  // Set the M·D memory sizes used by the Slave. 
 +  ImodbusRTUAdr(0, 0);  // Set the start addresses of M·D memory. 
 +  ImodbusRTUInit(Serial1, 1, 115200);  // Set the communication port, station number and baud rate. 
 +
 + 
 +void loop() { 
 +  ImodbusRTU();  // Check incoming requests and process Slave responses. 
 +  D[0] = 100; 
 +  D[3] = 200; 
 +}
 </code> </code>
  
Line 26: Line 36:
   * When sharing ''M'' and ''D'' with Cnet/MC Protocol, define a single final size and initialization order. Do not call ''ImodbusRTUMem()'' or ''ICnetMem()'' again at runtime.   * When sharing ''M'' and ''D'' with Cnet/MC Protocol, define a single final size and initialization order. Do not call ''ImodbusRTUMem()'' or ''ICnetMem()'' again at runtime.
   * Memory allocation functions do not return success status. For nonzero sizes, verify that ''M'' and ''D'' are not ''nullptr'' before accessing them in user code.   * Memory allocation functions do not return success status. For nonzero sizes, verify that ''M'' and ''D'' are not ''nullptr'' before accessing them in user code.
 +
 +===== Built-in Commands in the Same Category =====
 +
 +  * [[:en-us_commands:reference:imodbusrtuadr|ImodbusRTUAdr() View detailed description]]
 +  * [[:en-us_commands:reference:imodbusrtuinit|ImodbusRTUInit() View detailed description]]
 +  * [[:en-us_commands:reference:imodbusrtu|ImodbusRTU() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/imodbusrtumem.1788785567.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki