Ladder diagram program examples

The following examples demonstrate ladder diagram programs.

Example: OSR function block

The following example program shows the recommended usage of an OSR function block to detect an edge while connected to the controller.
Example: OSR function block
Example: OSR function block

Example: Comparing REAL Values using SUB (-), ABS, and LT (<)

It is not recommended to use the REAL data type for equality comparisons due to rounding differences. Two values might appear equal in
FactoryTalk Design Workbench
but evaluate as false.
For example, 23.500001 and 23.499999 both display as 23.5 but are not equal in the controller.
To compare REAL values, use a SUB instruction to find the difference and check if it is less than a set precision value. See the LD program example for details.
Example: Comparing Real Values using SUB (-), ABS, and LT (<)
Example: Comparing Real Values using SUB (-), ABS, and LT (<)
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal