//**************************************************************************** // Serial port 1 sends data function//************************************************************************ void Send_Byte(uchar data) { RS485_CTR1; while(!(IFG2&UTXIFG1)); //Send data when the send register is empty U1TXBUF=data; } //************************************************************ // Command judgment//******************************************************** void judge_data(void) { if (sys_tem[1]==0x52) //Command start{ Send_Byte(0x24); Send_Byte(0x52); Send_Byte(0x0D); } else if(sys_tem[1]==0x57)//Write program{ if(sys_tem[2]==0x43)//Write channel number{ Send_Byte(0x24); Send_Byte(0x57); Send_Byte(0x43); Send_Byte(0x30); Send_Byte(0x56); Send_Byte(0x4e); Send_Byte(0x0d); } else if (sys_tem[2]==0x42) //Write baud rate { Send_Byte(0x24); Send_Byte(0x57); Send_Byte(0x42); Send_Byte(0x44); Send_Byte(0x0d); } } } //************************************************************************ // Handle the receive interrupt from serial port 1//**************************************************************************** #pragma vector=UART1RX_VECTOR __interrupt void UART1_RX_ISR(void) { //Disable interrupt uint i; for(i=0;i<6;i++) { sys_tem[i]=U1RXBUF; } IE1 &=~URXIE1; judge_data(); delay_ms(5); //There is a small delay before switching RS485_CTR0; //Switch to the receiving state } sys_tem[]; defines an array to store the received commands The function you want to achieve is to receive a string of commands from the serial port (for example: 24, 57, 43, 30, 30, 0d), and then send this string of data out. How should the program be modified?