2018-06-28 11:45:41 -04:00
|
|
|
menu "Modbus configuration"
|
|
|
|
|
2020-07-21 12:34:04 -04:00
|
|
|
config FMB_COMM_MODE_TCP_EN
|
|
|
|
bool "Enable Modbus stack support for TCP communication mode"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enable Modbus TCP option for stack.
|
|
|
|
|
|
|
|
config FMB_TCP_PORT_DEFAULT
|
|
|
|
int "Modbus TCP port number"
|
|
|
|
range 0 65535
|
|
|
|
default 502
|
|
|
|
depends on FMB_COMM_MODE_TCP_EN
|
|
|
|
help
|
|
|
|
Modbus default port number used by Modbus TCP stack
|
|
|
|
|
|
|
|
config FMB_TCP_PORT_MAX_CONN
|
|
|
|
int "Maximum allowed connections for TCP stack"
|
|
|
|
range 1 6
|
|
|
|
default 5
|
|
|
|
depends on FMB_COMM_MODE_TCP_EN
|
|
|
|
help
|
|
|
|
Maximum allowed connections number for Modbus TCP stack.
|
|
|
|
This is used by Modbus master and slave port layer to establish connections.
|
|
|
|
This parameter may decrease performance of Modbus stack and can cause
|
|
|
|
increasing of processing time (increase only if absolutely necessary).
|
|
|
|
|
|
|
|
config FMB_TCP_CONNECTION_TOUT_SEC
|
|
|
|
int "Modbus TCP connection timeout"
|
|
|
|
range 1 3600
|
|
|
|
default 20
|
|
|
|
depends on FMB_COMM_MODE_TCP_EN
|
|
|
|
help
|
|
|
|
Modbus TCP connection timeout in seconds.
|
|
|
|
Once expired the current connection with the client will be closed
|
|
|
|
and Modbus slave will be waiting for new connection to accept.
|
|
|
|
|
2019-11-26 00:16:25 -05:00
|
|
|
config FMB_COMM_MODE_RTU_EN
|
|
|
|
bool "Enable Modbus stack support for RTU mode"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enable RTU Modbus communication mode option for Modbus serial stack.
|
|
|
|
|
|
|
|
config FMB_COMM_MODE_ASCII_EN
|
|
|
|
bool "Enable Modbus stack support for ASCII mode"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enable ASCII Modbus communication mode option for Modbus serial stack.
|
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_MASTER_TIMEOUT_MS_RESPOND
|
2018-10-19 09:51:27 -04:00
|
|
|
int "Slave respond timeout (Milliseconds)"
|
|
|
|
default 150
|
2020-07-21 12:34:04 -04:00
|
|
|
range 50 3000
|
2018-10-19 09:51:27 -04:00
|
|
|
help
|
|
|
|
If master sends a frame which is not broadcast, it has to wait sometime for slave response.
|
|
|
|
if slave is not respond in this time, the master will process timeout error.
|
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_MASTER_DELAY_MS_CONVERT
|
2018-10-19 09:51:27 -04:00
|
|
|
int "Slave conversion delay (Milliseconds)"
|
|
|
|
default 200
|
|
|
|
range 50 400
|
|
|
|
help
|
|
|
|
If master sends a broadcast frame, it has to wait conversion time to delay,
|
|
|
|
then master can send next frame.
|
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_QUEUE_LENGTH
|
2019-01-25 11:10:53 -05:00
|
|
|
int "Modbus serial task queue length"
|
|
|
|
range 0 200
|
|
|
|
default 20
|
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
Modbus serial driver queue length. It is used by event queue task.
|
|
|
|
See the serial driver API for more information.
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2020-07-21 12:34:04 -04:00
|
|
|
config FMB_PORT_TASK_STACK_SIZE
|
|
|
|
int "Modbus port task stack size"
|
|
|
|
range 2048 8192
|
|
|
|
default 4096
|
2019-01-25 11:10:53 -05:00
|
|
|
help
|
2020-07-21 12:34:04 -04:00
|
|
|
Modbus port task stack size for rx/tx event processing.
|
2018-10-19 09:51:27 -04:00
|
|
|
It may be adjusted when debugging is enabled (for example).
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_SERIAL_BUF_SIZE
|
2019-01-25 11:10:53 -05:00
|
|
|
int "Modbus serial task RX/TX buffer size"
|
|
|
|
range 0 2048
|
|
|
|
default 256
|
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
Modbus serial task RX and TX buffer size for UART driver initialization.
|
|
|
|
This buffer is used for modbus frame transfer. The Modbus protocol maximum
|
|
|
|
frame size is 256 bytes. Bigger size can be used for non standard implementations.
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2019-11-26 00:16:25 -05:00
|
|
|
config FMB_SERIAL_ASCII_BITS_PER_SYMB
|
|
|
|
int "Number of data bits per ASCII character"
|
|
|
|
default 8
|
|
|
|
range 7 8
|
|
|
|
depends on FMB_COMM_MODE_ASCII_EN
|
|
|
|
help
|
|
|
|
This option defines the number of data bits per ASCII character.
|
|
|
|
|
|
|
|
config FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS
|
|
|
|
int "Response timeout for ASCII communication mode (ms)"
|
|
|
|
default 1000
|
|
|
|
range 300 2000
|
|
|
|
depends on FMB_COMM_MODE_ASCII_EN
|
|
|
|
help
|
|
|
|
This option defines response timeout of slave in milliseconds for ASCII communication mode.
|
2020-07-21 12:34:04 -04:00
|
|
|
Thus the timeout will expire and allow the master program to handle the error.
|
2019-11-26 00:16:25 -05:00
|
|
|
|
2020-07-21 12:34:04 -04:00
|
|
|
config FMB_PORT_TASK_PRIO
|
|
|
|
int "Modbus port task priority"
|
2020-11-16 11:03:30 -05:00
|
|
|
range 3 23
|
2019-01-25 11:10:53 -05:00
|
|
|
default 10
|
|
|
|
help
|
2020-07-21 12:34:04 -04:00
|
|
|
Modbus port data processing task priority.
|
|
|
|
The priority of Modbus controller task is equal to (CONFIG_FMB_PORT_TASK_PRIO - 1).
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2021-03-16 07:06:22 -04:00
|
|
|
choice FMB_PORT_TASK_AFFINITY
|
|
|
|
prompt "Modbus task affinity"
|
|
|
|
default FMB_PORT_TASK_AFFINITY_CPU0
|
|
|
|
depends on !FREERTOS_UNICORE
|
|
|
|
help
|
|
|
|
Allows setting the core affinity of the Modbus controller task, i.e. whether the task is pinned to
|
|
|
|
particular CPU, or allowed to run on any CPU.
|
|
|
|
|
|
|
|
config FMB_PORT_TASK_AFFINITY_NO_AFFINITY
|
|
|
|
bool "No affinity"
|
|
|
|
config FMB_PORT_TASK_AFFINITY_CPU0
|
|
|
|
bool "CPU0"
|
|
|
|
config FMB_PORT_TASK_AFFINITY_CPU1
|
|
|
|
bool "CPU1"
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
config FMB_PORT_TASK_AFFINITY
|
|
|
|
hex
|
|
|
|
default FREERTOS_NO_AFFINITY if FMB_PORT_TASK_AFFINITY_NO_AFFINITY || FREERTOS_UNICORE
|
|
|
|
default 0x0 if FMB_PORT_TASK_AFFINITY_CPU0
|
|
|
|
default 0x1 if FMB_PORT_TASK_AFFINITY_CPU1
|
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_CONTROLLER_SLAVE_ID_SUPPORT
|
2019-01-25 11:10:53 -05:00
|
|
|
bool "Modbus controller slave ID support"
|
2020-07-21 12:34:04 -04:00
|
|
|
default y
|
2019-01-25 11:10:53 -05:00
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
Modbus slave ID support enable.
|
|
|
|
When enabled the Modbus <Report Slave ID> command is supported by stack.
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_CONTROLLER_SLAVE_ID
|
2019-01-25 11:10:53 -05:00
|
|
|
hex "Modbus controller slave ID"
|
|
|
|
range 0 4294967295
|
|
|
|
default 0x00112233
|
2019-04-26 12:47:21 -04:00
|
|
|
depends on FMB_CONTROLLER_SLAVE_ID_SUPPORT
|
2019-01-25 11:10:53 -05:00
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
Modbus slave ID value to identify modbus device
|
|
|
|
in the network using <Report Slave ID> command.
|
|
|
|
Most significant byte of ID is used as short device ID and
|
|
|
|
other three bytes used as long ID.
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_CONTROLLER_NOTIFY_TIMEOUT
|
2019-01-25 11:10:53 -05:00
|
|
|
int "Modbus controller notification timeout (ms)"
|
|
|
|
range 0 200
|
|
|
|
default 20
|
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
Modbus controller notification timeout in milliseconds.
|
|
|
|
This timeout is used to send notification about accessed parameters.
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_CONTROLLER_NOTIFY_QUEUE_SIZE
|
2019-01-25 11:10:53 -05:00
|
|
|
int "Modbus controller notification queue size"
|
|
|
|
range 0 200
|
|
|
|
default 20
|
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
Modbus controller notification queue size.
|
|
|
|
The notification queue is used to get information about accessed parameters.
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_CONTROLLER_STACK_SIZE
|
2019-01-25 11:10:53 -05:00
|
|
|
int "Modbus controller stack size"
|
|
|
|
range 0 8192
|
|
|
|
default 4096
|
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
Modbus controller task stack size. The Stack size may be adjusted when
|
|
|
|
debug mode is used which requires more stack size (for example).
|
2018-06-28 11:45:41 -04:00
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_EVENT_QUEUE_TIMEOUT
|
2019-01-25 11:10:53 -05:00
|
|
|
int "Modbus stack event queue timeout (ms)"
|
|
|
|
range 0 500
|
|
|
|
default 20
|
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
Modbus stack event queue timeout in milliseconds. This may help to optimize
|
|
|
|
Modbus stack event processing time.
|
2019-01-25 11:10:53 -05:00
|
|
|
|
2019-04-26 12:47:21 -04:00
|
|
|
config FMB_TIMER_PORT_ENABLED
|
2021-08-13 10:46:09 -04:00
|
|
|
bool "Modbus stack use timer for 3.5T symbol time measurement"
|
2021-03-16 07:06:22 -04:00
|
|
|
default n
|
2019-01-25 11:10:53 -05:00
|
|
|
help
|
2018-10-19 09:51:27 -04:00
|
|
|
If this option is set the Modbus stack uses timer for T3.5 time measurement.
|
|
|
|
Else the internal UART TOUT timeout is used for 3.5T symbol time measurement.
|
2019-01-25 11:10:53 -05:00
|
|
|
|
2022-12-22 04:05:55 -05:00
|
|
|
config FMB_TIMER_USE_ISR_DISPATCH_METHOD
|
|
|
|
bool "Modbus timer uses ISR dispatch method"
|
2019-11-12 09:16:55 -05:00
|
|
|
default n
|
2022-12-22 04:05:55 -05:00
|
|
|
select ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD
|
2019-11-08 03:55:42 -05:00
|
|
|
select UART_ISR_IN_IRAM
|
|
|
|
help
|
2022-12-22 04:05:55 -05:00
|
|
|
If this option is set the Modbus stack uses ISR dispatch method
|
|
|
|
to send timeout events from the callback function called from ISR.
|
2019-11-12 09:16:55 -05:00
|
|
|
This option has dependency with the UART_ISR_IN_IRAM option which places UART interrupt
|
|
|
|
handler into IRAM to prevent delays related to processing of UART events.
|
2019-11-08 03:55:42 -05:00
|
|
|
|
2018-06-28 11:45:41 -04:00
|
|
|
endmenu
|