The subVI reads the characters from the serial port. Figure 1 shows the block diagram of the subVI.
Fig. 1 Reading the response from the modem after sending SMS message
This subVI is used only by subVI that sends SMS message. The GSM modem takes about 6s to send SMS message. After sending SMS message the GSM modem sends a message theat the sending of SMS message was (un)successful. This subVI is waiting on this response. he subVI in an endless loop checks the number of characters on the serial port. If this number is greater than zero subVI reads as many as there are characters in the serial buffer, if the LF character is not read. If the LF character is encountered before reading all characters in the serial buffer the futher reading is stop, although the number of characters in the serial buffer is larger.
If there is a string "+ CMGS:" in the read string of the GSM modem response the reading is continuing until the remaining characters in the serial buffer are read and the execution of the program is finisheed.Otherwise the routine continues to check the number of characters on the serial port.