Hi Mark,
I have a simple Modbus serial slave device that will have a Modbus address of 250 on start-up, a Modbus master will communicate with it at address 255 and then assign it another Modbus address that it should use until it is power cycled. (When it will return to using an address of 250).
The slave address is defined within the structure ptrMODBUS_pars and is used in the call fnInitialiseMODBUS_port which sets up a Modbus port.
What is the best way to cleanly change a devices address, note this need to happen after the device had replied to the modbus message that caused the change of address, from memory. fnMODBUSPostFunction is not the correct place to handle this as this is called before the reply is sent back.
I could use a gateway as in this post
http://www.utasker.com/forum/index.php?topic=670.msg2882#msg2882 but I would like to make use of all the utasker routines to handle different messages, also my slave will only ever have one address its just that it will change.
Cheers
Martin