最近要设计一个modbus master 轮询的方案, 采用官网例程进行修改, 官方有提到可以从SD卡或MQTT来源进行初始化, 如果从NVS获取怎么设计呢?
During initialization of the Modbus stack, a pointer to the Data Dictionary (called descriptor) must be provided as the parameter of the function below.
mbc_master_set_descriptor(): Initialization of master descriptor.
Initialization of master descriptor. The descriptor represents an array of type mb_parameter_descriptor_t and describes all the characteristics accessed by master.
ESP_ERROR_CHECK(mbc_master_set_descriptor(&device_parameters[0], num_device_parameters));
The Data Dictionary can be initialized from SD card, MQTT or other source before start of stack. Once the initialization and setup is done, the Modbus controller allows the reading of complex parameters from any slave included in descriptor table using its CID. Refer to example TCP master, example Serial master for more information.
modbus master 轮询的数据字典 灵活设置
Moderator: ESP_Bob
-
- Posts: 2
- Joined: Fri Jun 07, 2024 5:55 am
modbus master 轮询的数据字典 灵活设置
- Attachments
-
- 123.png (117.21 KiB) Viewed 4720 times
Who is online
Users browsing this forum: No registered users and 39 guests