Docsity

Programmable Logic Controllers: Understanding FIFO and LIFO Load and Unload Instructions, Slides of Programmable Logic Controllers

Partial preview of the text

Download Programmable Logic Controllers: Understanding FIFO and LIFO Load and Unload Instructions and more Slides Programmable Logic Controllers in PDF only on Docsity!

Programmable Logic

Controllers

File Instructions

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 10-

File Instruction Types

• FFL - First In, First Out (FIFO) Load

• FFU - First In, First Out (FIFO) Unload

• LFL - Last In, First Out (LIFO) Load

• LFU - Last In, First Out (LIFO) Unload

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 10-

FIFO Load Instruction

  • On a false-to-true rung transition, the FFL instruction loads words or long words into a user-created file called a FIFO stack.

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 10-

FIFO Load Operands

  • Source - The source operand is a constant or address of the value used to fill the currently available position in the FIFO stack.p - The address level of the source must match the FIFO stack. If FIFO is a word size file, source must be a word value or constant. If FIFO is a long word size file, source must be a long word value or constant. The data range for the source is from -32768 to 32767 (word) or -2,147,483,648 to 2,147,483,647 (long word).
  • FIFO - The FIFO operand is the starting address of the stack

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 10-

the stack.

  • Control - This is a control file address. The status bits, stack length, and the position value are stored in this element.

FIFO Unload Instruction

  • On a false-to-true rung transition, the FFU instruction unloads words or long words from a userlong words from a user- created file called a FIFO stack.
  • The data is unloaded using first-in, first-out order.
  • After the unload completes, the data in the stack is shifted one element toward the top of the stack and the

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 10-

the top of the stack and the last element is zeroed out.

  • FFU operands are exactly as described in the FFL instruction.

LFL - Last In, First Out (LIFO) Load

  • On a false-to-true rung transition, the LFL instruction loads wordsinstruction loads words or long words into a user-created file called a LIFO stack.
  • This instruction’s counterpart, LIFO unload (LFU) is paired

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 10-

unload (LFU), is paired with a given LFL instruction to remove elements from the LIFO stack.

LIFO Loading & Unloading

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 10-