Reading data from serial port

This subVI reads characters from the serial port. Figure 1 shows the block diagram of the subVI.

Fig. 1 Reading data from serial port

This subVI is used by all subroutines to read the answer from the GSM modem. The subVI in an endless loop checks the number of characters on the serial port. If this number is greater than zero subVI reads asmany 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 further reading is stop, although the number of characters in the serial buffer is larger. This process is repeated until the number of characters on the serial port is greater than zero.

When it is found that the number of characters on port is zero a delay of 200ms is generated  and rechecked the number of characters on the port. If the number of characters is zero the subVI finishes execution. Ifthe number of characters read is not equal to zero, the remaining characters are read and the execution of while loop is stop.

Save this file under other name

After downloading save this file under name:

GSM read data from serial port.vi

Something has heppend with this page and I can not upload this file under desired name.