Hi,
On Thu, 4 Jan 2018 18:35:25 -0800 (PST)
Kot Shrodingera <
kot.shr...@gmail.com> wrote:
> Thanks. Can you give me an example of multi-slave implementation?
I have several nice examples which I cannot yet publish - however they
are not using mappings anyway.
The libmodbus-mapping-implementation is based on the
callback-mechanisms (in my branch) which shows how you could handle it:
https://github.com/pboettch/libmodbus/blob/modbus-reply-callback/src/modbus-reply-mapping.c
You can copy this code and adapt it to your needs.
One solution could be to use the slave-id (which is passed to each
callback-function) to select the right mapping which you have allocated
during your initialization phase.
Using the callbacks you don't need to use mappings. Maybe using
something else to retrieve and store values would be more appropriate.
HTH,
--
Patrick.