4<£UH#modbus½Å±¾Ê¾Àý #ÊäÈë01 03 10 01 00 03 CRC_LOW_CRC_HIGH #·µ»Ø01 03 06 00 00 00 CRC_LOW CRC_HIGH alertData= [0x01,0x03,0x10,0x01,0x00,0x03] compareData= [0x01, 0x03, 0x06] crcLow = [0x50] crcHigh = [0xCB] RECV UART uart0 receivedData = INPUT # IF ((receivedData.charAt(0) == 0x01) && (receivedData.charAt(1) == 0x03) &&(receivedData.charAt(2) == 0x06)) # IF ((receivedData.charAt(3) != 0x00) && (receivedData.charAt(4) != 0x00) &&(receivedData.charAt(5) !=60x00)) strLen = receivedData.length() index = receivedData.indexOf(compareData) IF (strLen >= 6 ) IF (index == 0) flag = 0 judge = receivedData.charAt(3) IF (judge != 0) flag = 1 END judge = receivedData.charAt(4) IF (judge != 0) flag = 1 END judge = receivedData.charAt(5) IF (judge != 0) flag = 1 END IF (flag == 0) RETURN(FALSE) END END END OUTPUT=INPUT RETURN(TRUE) END TIMER HeartBeat 3000 alertCRCData = alertData + crcLow + crcHigh SEND(UART, uart0, alertCRCData) ENDÿÿÿÿÿÿÿÿÿÿ