Slave id

Asked by flipback

Hello, I'm writing binding for your lib on Ruby - http://github.com/flipback/libmodbus4r/tree/master
And I have problem with it. How can I define id for slave(server)? Or it function have not released?

Question information

Language:
English Edit question
Status:
Solved
For:
libmodbus Edit question
Assignee:
No assignee Edit question
Solved by:
Stéphane Raimbault
Solved:
Last query:
Last reply:
Revision history for this message
Best Stéphane Raimbault (sra) said :
#1

Side note: I'm intend to revert some API changes on trunk version about slave ID.

but currently modbus_slave_manage() uses the slave ID defined in modbus_param (trunk version of libmodbus):

void modbus_slave_manage(modbus_param_t *mb_param, const uint8_t *query,
                         int query_length, modbus_mapping_t *mb_mapping)
{
       ....

        if (slave != mb_param->slave && slave != MODBUS_BROADCAST_ADDRESS) {

Revision history for this message
flipback (atimin) said :
#2

Thanks Stéphane Raimbault, that solved my question.