serFlush (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


serFlush clears the system receive buffer for the chosen port.

The result is that any data not received into the application buffer, but present in the system buffer, will be cleared.

 

Input:

port : SINT (0..127) (default 0)

Selects which serial port to use.

 

Returns:

None.

 

Declaration:

FUNCTION serFlush;
VAR_INPUT
  port : SINT := 0;   // Port number
end_var;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  portNum : SINT := 0;                   // Select which port to use for the communication        
END_VAR;
 
...
 
BEGIN
  ...
  // Reset buffer cmd received?
  IF .. THEN
     // Clear buffer
    serFlush(port:=portNum);
     ...
  END_IF;
  ...
END;
 
END_PROGRAM;