INCOMM (ch) |
Purpose | ch - must be a
numeric constant between 1 and 8. The actual target hardware determines the valid port #.
This function returns -1 if there is no data waiting at serial port. Note: INCOMM is supported on all COMM ports of F and T100M+ families of PLCs. |
Examples | FOR I=1 to 100 DM[I] = INCOMM(2): IF DM[I]<0 RETURN :ENDIF NEXT |
Comments: | Usually the PLC buffers the serial data arriving at its COMM port so that the program does not need to continuously check the COMM port for data. When the program is ready to process the data it can use the FOR..NEXT loop shown in the above example to read in all the data in the COMM buffer until it encounters a -1, which indicates that the buffer is empty. |
See Also | OUTCOMM, INPUT$( ), PRINT # |