Selection for MODBUS ADDRESS and MODBUS_SERIAL_BAUD
Posted: Thu Sep 18, 2014 2:37 am
Hi,
I am using ex_modbus_slave.c file of CCS compiler version 4.119. The code working fine. But I need to provide the selection of Baud rates for communication. Instead of fixed baud rate I need flexible baud rates which can be selected by end user.
It gives duplicate define warning. Please advise how to assign multiple baud rate options in this code.
Thanks,
Paddy
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
Posted: Thu Sep 18, 2014 2:57 am
You don't directly.
You build the code to handle one rate (19200bps, or 9600bps say).
Then use the 'set_uart_speed' command to select the rate you actually want to run.
So you have a command from the keyboard, or an external DIP switch (for example), that chooses from perhaps four rates, and then just call set_uart_speed(xxxx), to chose the rate.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum