FB_Stack (Function Block)

A collection whose access/mutation of items is last-in, first-out.

Implements: I_Stack

Properties

_Count

Type: T_Capacity

Number of items in the collection.

_Empty

Type: BOOL

Checks if collection is empty.

_Error_Status

Type: T_Error

Error status of the collection.

_Values

Type: I_Immutable_List

Gets an immutable list of the items in the stack.

Methods

Clear

Empties/Clears/Deletes every item in the stack.

Get

Gets item at the top of the stack.

Inputs

Name

Type

Description

Item

ANY

Variable to store returned item value.

Outputs

Name

Type

Description

bSuccess

BOOL

Get_Generic

Gets item at the top of the stack as a generic.

Outputs

Name

Type

Description

Item

T_Generic

Variable to store returned item value

bSuccess

BOOL

Pop

Removes item at the top of the stack without returning anything.

Outputs

Name

Type

Description

bSuccess

BOOL

Push

Add item to the top of the stack.

Inputs

Name

Type

Description

Item

ANY

Item to store.

Outputs

Name

Type

Description

bSuccess

BOOL

Push_Generic

Add generic item to the top of the stack.

Inputs

Name

Type

Description

Item

T_Generic

Item to store.

Outputs

Name

Type

Description

bSuccess

BOOL

Reverse

Reverses order of items on stack.

Outputs

Name

Type

Description

bSuccess

BOOL