@ntd Thanks a lot! I think I got it so far. The adresses of the devices you got from Neuron documentation I assume?
Only one question left so far. If I want to write the current state of the relay I would use (according to doc):
//int modbus_write_bit(modbus_t *ctx, int addr, int status);
errlvl=modbus_write_bit(modbus_handle, 100, status);
I am unsure about the "status". This means I will enable or disable the bit and therefore switching the relay, right?
Ok, how about reading the DI 2.1?
Would I use the following?
//int modbus_read_bits(modbus_t *ctx, int addr, int nb, uint8_t *dest);
errlvl=modbus_read_bits(modbus_handle, 108, nb, *dest);
Here I have no clue for what I would need the nb... does it mean it will read nb bits? To be stored in nb*dest? I would always use the value 1, wouldn't I? If using 2 it would return the value of the second DI 2.2 in the second bit, correct?
Thanks a lot in advance!
/KNEBB