FIFO

PLCopen motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Manages a first in / first out list.

Inputs

Inputs

Data Type

Range

Unit

Default

Description

@Tail

ANY

 

 

 

Value of the oldest pushed value.

Updated after call.

Buf[]

ANY

 

 

 

Array for storing values.

IN

ANY

 

 

 

Value to be pushed.

POP

BOOL

 

 

 

Pop a new value on the rising edgeClosed The transition of a digital signal from low to high. AKA: positive edge..

PUSH

BOOL

 

 

 

Push a new value on the rising edge.

RST

BOOL

 

 

 

ResetClosed New start of the microprocessor. the list.

Outputs

Outputs

Data Type

Range

Unit

Description

EMPTY

BOOL

 

 

TRUE if the list is empty.

OFLO

BOOL

 

 

TRUE if the overflow is on a PUSH command.

CountClosed Internal count pulses, 1 pulse = 1/2^20turn.

DINT

 

 

Number of values in the list.

pRead

DINT

 

 

IndexClosed Zero pulse (zero signal) of a hardware pin such as digital input or feedback pin. in the buffer of the oldest pushed value.

pWrite

DINT

 

 

Index in the buffer of the next push positionClosed Position means a point in space which is described by different coordinates. Depending on the used system and transformation it can consist of a maximum of six dimensions (coordinates).This means three Cartesian coordinates in space and coordinates for the orientation. In ACS there can be even more than six coordinates. If the same position is described in different coordinate systems the values of the coordinates are different..

Remarks

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the input rung is the PUSH input.
    • The output rung is the EMPTY output.

IL Language Example

(* MyFIFO is a declared instance of FIFO function block *)
Op1: CAL MyFIFO (PUSH, POP, RST, IN, @Tail , BUFF[])
FFLD  MyFIFO.EMPTY
STClosed Structured text - A high-level language that is block structured and syntactically resembles Pascal.  EMPTY
FFLD  MyFIFO.OFLO
ST  OFLO
FFLD  MyFIFO.COUNT
ST  COUNT
FFLD  MyFIFO.PREAD
ST  PREAD
FFLD  MyFIFO.PWRITE
ST  PWRITE

ST Language Example

(* MyFIFO is a declared instance of FIFO function block: *)
MyFIFO (PUSH, POP, RST, IN, @Tail , BUFFER);
EMPTY := MyFIFO.EMPTY;
OFLO := MyFIFO.OFLO;
COUNT := MyFIFO.COUNT;
PREAD := MyFIFO.PREAD;
PWRITE := MyFIFO.PWRITE;

See Also

LIFO