structured text


Sieve of Eratosthenes with ControlLogix

Introduction to the Sieve of Eratosthenes with ControlLogix The Sieve of Eratosthenes with ControlLogix is a method to find the prime numbers within a given limit. I thought this would be a fun project to try out on the ControlLogix. We’ll give this a shot, and hope we don’t fault Read More »

ControlLogix Sieve of Eratosthenes

ControlLogix Set Dominant (SETD)

Introduction to the ControlLogix Set Dominant (SETD) Instruction The ControlLogix Set Dominant (SETD) instruction is a type of latching instruction. Basically, when the SET bit goes true, the output is on. Likewise, when the RESET bit is true (with SET off), the output goes false. If both the SET and Read More »

ControlLogix SETD instruction

Structured Text Compare Statements

Introduction to ControlLogix Structured Text Compare Statements The ControlLogix Structured Text Compare Statements work a bit differently than the compare statements of ladder logic and function blocks. In Structured Text, the compare statements are similar to what you see in other standard programming languages. Basically, we can test a value Read More »

ControlLogix Structured Text

ControlLogix Structured Text Functions

Introduction to ControlLogix Structured Text Functions ControlLogix Structured Text Functions allow us to perform the same calculations several times through a processor scan. For example, we might want to convert Celsius to Fahrenheit. We simply create another routine that acts as our function. After that, we can pass and receive Read More »

Structured Text JSR Instruction

Structured Text Counter (CTUD)

Introduction to the Structured Text Counter (CTUD) We use the CTUD in Structured Text, or in Function block to count up or down. CTUD is the instruction for the Count Up/Down Counter. One instruction will work both ways. Each time the CUEnable bit goes true, the counter increments. On the Read More »

CTUD

Structured Text Timer

Introduction to ControlLogix Structured Text Timer In this post, we’ll cover the ControlLogix Structured Text Timer. ControlLogix supports 4 programming languages: Ladder, Structured Text, Function Blocks, and Sequential Flow Charts. Some vendors prefer structured text over ladder. One reason for this is that they can develop the program without a Read More »

stx timer

ControlLogix For / Do Statement

Introduction to ControlLogix For / Do Statement The ControlLogix For / Do Statement is similar to what you might think of as a FOR / NEXT loop. Basically, it is a construct that executes the same code a number of times. It does this by incrementing a tag. For example, Read More »

for DO

ControlLogix CASE / OF Statement

Introduction to ControlLogix CASE / OF Statement The ControlLogix CASE / OF Statement allows a specific block of code to execute. The block of code that executes depends on the value of a tag. This can also be an expression that returns a value. You can use this statement in Read More »

case of

ControlLogix IF / THEN Statement

Introduction to ControlLogix IF / THEN Statement The most common instruction is the ControlLogix IF / THEN Statement. This is for Structured Text routines. Structured Text is an easy way to program complex algorithms. Additionaly, some vendors prefer to use all structured text routines. One of the reasons to use Read More »

if then