CODESYS R_TRIG

R_TRIG is a function block in the CODESYS Standard library that detects a rising edge of a boolean signal. A declared instance is called with the boolean signal to be checked connected to the CLK input. The Q output is TRUE when a rising edge is detected.

Source checked9/9 values · 2026-10-26

Specification

2 sources
Languageiec 61131 3
CodeR TRIG
SyntaxRTRIGInst(CLK := VarBOOL1);
DialectCODESYS

Parameters

NameData typeDescription
CLKBOOLInput: boolean signal to be checked
QBOOLOutput: TRUE: rising edge detected

Study notes

  • R_TRIG is marked (FB), i.e. it is a function block, so an instance must be declared before use: RTRIGInst : R_TRIG;
  • The instance is called in structured text as RTRIGInst(CLK := VarBOOL1); and the result is read from the Q output: VarBOOL2 := RTRIGInst.Q;
  • The library page places R_TRIG under the Trigger category of the Standard library.
↑↓ navigate↵ openesc close