I was asking me how could it be possible to share the registers handled by libmodbus (the modbus_t structure) with another program that could read and write in it. I had used this once in Perl (IPC) and it was working very well, but altering the source of libmodbus to radicaly change the way it handle the main register structure si definitively out of my range ...
My goal is too implement a PLC based on BBB that could
Update the Modbus Master (Mango Software) with the value of it's registers (function 03 and 01 ...) => libmodbus does that perfectly
Be updated by Modbus Master => libmodbus does that perfectly
react on direct GPIO INPUTS to change GPIO OUTPUTS (like a PLC with some ladder logic in it ... => my program does that
and finaly, reflects the changes done by my GPIO programm in the registers of libmodbus.
I've tried to put a little code in the middle of the "bandwidth-server-many-up.c" source but it's seems difficult to let enough time in the main loop for scanning the GPIO INPUTS, I guess libmodbus routines are waiting for events on it's network side so that my INPUT changes are not seen in "real time" like they 're in my little gpio program.
Not sure this is clear nor if it's the good place to talk about changes, But it seems to me that the principle of sharing registers could be interesting to improve this fabulous library usages.
modbus_t structure doesn't store values that's the role of modbus_mapping_t and yes, you can share these values.
Could you ask your questions on mailing list, please?
Hi,
I was asking me how could it be possible to share the registers handled by libmodbus (the modbus_t structure) with another program that could read and write in it. I had used this once in Perl (IPC) and it was working very well, but altering the source of libmodbus to radicaly change the way it handle the main register structure si definitively out of my range ... My goal is too implement a PLC based on BBB that could
I've tried to put a little code in the middle of the "bandwidth-server-many-up.c" source but it's seems difficult to let enough time in the main loop for scanning the GPIO INPUTS, I guess libmodbus routines are waiting for events on it's network side so that my INPUT changes are not seen in "real time" like they 're in my little gpio program.
Not sure this is clear nor if it's the good place to talk about changes, But it seems to me that the principle of sharing registers could be interesting to improve this fabulous library usages.
Anyway, thanks for read ...
Nicolas