STM/Modbus/Baremetal/UART_RS485_Modbus_Slave/Source/Modbus/Slave/Modbus_Slave.c
void AppendDatatoMBRegister(unsigned int StAddr, unsigned int count,
		unsigned int *inreg, volatile unsigned char *outreg)
{
	for (unsigned char c = 0; c < count; c++)
	{
		*(outreg + 3 + c * 2) = (unsigned char) (*(inreg + StAddr + c) >> 8);//MSB IN HIGHER BYTE
		*(outreg + 3 + (c * 2 + 1)) = (unsigned char) (*(inreg + StAddr + c));//LSB IN LOWER BYTE
	}
}
//Append Data from unsigned integer Array to Modbus PDU during Read Operation

Append Data from unsigned integer Array to Modbus PDU during Read Operation
Append Data from unsigned integer Array to Modbus PDU during Read Operation
void AppendDatatoMBRegister(unsigned int StAddr, unsigned int count,
		unsigned int *inreg, volatile unsigned char *outreg)
{
	for (unsigned char c = 0; c < count; c++)
	{
		*(outreg + 3 + c * 2) = (unsigned char) (*(inreg + StAddr + c) >> 8);
		*(outreg + 3 + (c * 2 + 1)) = (unsigned char) (*(inreg + StAddr + c));
	}
}
void AppendDatatoMBRegister ( unsigned int StAddr , unsigned int count , unsigned int * inreg , volatile unsigned char * outreg ) { for ( unsigned char c = 0 ; c < count ; c ++ ) { * ( outreg + 3 + c * 2 ) = ( unsigned char ) ( * ( inreg + StAddr + c ) >> 8 ) ; * ( outreg + 3 + ( c * 2 + 1 ) ) = ( unsigned char ) ( * ( inreg + StAddr + c ) ) ; } }
Append Data from unsigned integer Array to Modbus PDU during Read Operation
Append Data from unsigned integer Array to Modbus PDU during Read Operation
//MSB IN HIGHER BYTE
 //LSB IN LOWER BYTE
