VAR fbGetCurTaskIdx : GETCURTASKINDEX; bFirstScan : BOOL; END_VAR
Beckhoff TwinCAT (versions 2, 3, and NC) provides multiple ways to generate or access this bit. Below are the four most common methods, ranked by modern best practice. beckhoff first scan bit
PROGRAM PRG_Main VAR FirstScan : BOOL; END_VAR VAR fbGetCurTaskIdx : GETCURTASKINDEX