If the default options are not suitable the file mbmconfig.h
should be created. This file can then be used to customization.
|
Backof time milliseconds for MODBUS ASCII to introduce an additional delay after the frame has been received and before the reply is sent.
|
|
The character timeout value for Modbus ASCII. The character timeout value is not fixed for Modbus ASCII and is therefore a configuration option. It should be set to the maximum expected delay time of the network. |
|
If the ASCII layer should wait some time before enabling the receiver.
|
|
Default respose timeout.
|
|
If debugging code should be built into the MODBUS stack.
|
|
If heavy (memory intensive) debugging code should be built into the MODBUS stack.
|
|
If the API should check arguments for errors. This has a small performance impact and one might not use this on very small systems. |
|
If the protocol analyzer should be enabled. The protocol analyser allows the user to supply to custom callbacks which are called by the stack whenever a new frame is sent or received. These protocol callbacks are maded from the different implementation layers (RTU, ASCII or TCP) and include the MODBUS PDU as well as the encapsulating elements. |
|
If the statistics interface should be enabled. The statistics interface allows to gather additional statistics from the MODBUS stacks. This includes
|
|
If the Read File Record function should be enabled.
|
|
If the Read Holding Registers function should be enabled.
|
|
If the Read Input Registers function should be enabled.
|
|
If the Read/Write Multiple Registers function should be enabled.
|
|
If the Read Coils function should be enabled.
|
|
If the Read Discrete Inputs function should be enabled.
|
|
If a function for rending raw frames should be enabled.
|
|
If the Report Slave ID function should be enabled.
|
|
If the Write File Record function should be enabled.
|
|
If the Read Input Registers function should be enabled.
|
|
If the Write Single Register function should be enabled.
|
|
If the Write Coils function should be enabled.
|
|
If the Write Single Coil function should be enabled.
|
|
If the RTU layer should at least wait 3,5 times the character timeout before enabling the receiver.
|
|
Choose the API of the serial read/write callbacks. There are two different versions.
|
|
Serial timeout for RTU frame reception computed dynamically on the baudrate. Only usef in V2 serial API. This function should return the timeout to use for end of frame transmission. You should set this to match the internal buffer size of your serial device. For example if you can buffer 32 bytes and the speed is 9600 you would return approx. 11/9600 * 32 + 5ms where the 5ms is an additional safety margin and 11/9600 is for 8 databits, 1 stopbit and parity. |
|
Serial timeout for RTU frame reception if the serial API version 2 is used. Most operating systems using the API version 2 do not support very tight timeouts. Therefore we do not use the t3.5 timers in MODBUS RTU but use a higher timeout. The best value depend on the operating system and its realtime characteristics as well as the serial driver interface.
|
|
The timeout to wait when wait after send timeouts are used in ASCII transmission mode. This macro should be defined if the default wait after send timeouts are not useful. It is only used when either MBS_ASCII_WAITAFTERSEND_ENABLED is defined. |
|
Numer of serial ASCII instances supported.
|
|
The timeout to wait when wait after send timeouts are used in RTU transmission mode. This macro should be defined if the default wait after send timeouts are not useful. It is only used when either MBS_RTU_WAITAFTERSEND_ENABLED is defined. |
|
If MODBUS ASCII support is enabled. If MODBUS RTU support is enabled. If MODBUS TCP support is enabled. Numer of serial RTU instances supported.
|
|
Numer of TCP instances supported.
|
|
Purge TCP sockets before next write. If enabled the client socket is purged before the next master transaction is started. This avoids problems in case of a previous timeout with data that is delivered late. |
|
Activate transmit timeout only after the transmit has been sent. This function polls the transmit state machine and only decrements the timeout when the stack is not transmitting data. This is useful when the baudrate is low as in this case transmitting could already take more time than the timeout. |
|
Numer of UDP instances supported.
|
|
If we want advanced startup/shutdown locking. Advanced startup/shutdown locking might be necessary if the MODBUS stack should be embedded as a DLL and the porting layers needs specials hooks for startup, i.e. when the first instance is created and when the last instance is shut down. If for the first time an MODBUS serial or TCP init function is called the stack calls vMBPLibraryLoad( ). If the stack is shutdown the function calls vMBPLibraryUnload( ). Because the init and the close functions could be mixed due to threading a second locking primitive MBP_ENTER_CRTICIAL_INIT and MBP_EXIT_CRITICAL_INIT have to be provided. They default to empty macros but should be defined. for safe startup/shutdown behaviour is this can not be enforced by the application. |