top of page
Subscribe to J. Saman's newsletter for a FREE BOOK + updates straight to your inbox.

Beckhoff First: Scan Bit
VAR bFirstScan : BOOL := TRUE; // Initialized to TRUE END_VAR
In this example, the initialization code is executed only once, during the first scan of the PLC, when the First Scan Bit is set. beckhoff first scan bit
During the first cycle, the IF bFirstScan condition evaluates to true. The initialization code executes. bFirstScan is set to FALSE at the end of the block. VAR bFirstScan : BOOL := TRUE; // Initialized
IF fbFirstScan() AND (nEtherCATState = 8) THEN // 8 = OP EnableOutputs(); END_IF VAR bFirstScan : BOOL := TRUE
bottom of page