Pro
7 min

CCST 09 — Integer Comparison (GEQ/LEQ)

ccstladdercomparisonintegerGEQ
CCST 09 — Integer Comparison (GEQ/LEQ) scenario preview

Ready to build this?

Sign up free — no credit card required. This scenario requires the Pro plan.

Sign up to play this scenario →

Already have an account? Log in

Briefing

SPEED_OK is TRUE when SPEED_INT is between 800 and 1200 RPM (inclusive). Use two comparison instructions.

Objectives

  • SPEED_OK := (SPEED_INT >= 800) AND (SPEED_INT <= 1200)
  • False when SPEED_INT < 800 or > 1200

Hints

  • Use two comparison branches: GEQ(SPEED_INT, 800) AND LEQ(SPEED_INT, 1200)
  • In IEC: SPEED_OK := (SPEED_INT >= 800) AND (SPEED_INT <= 1200)

I/O Table

Inputs

SPEED_INT

Speed value (RPM)

INT · %IW0

Outputs

SPEED_OK

Speed in range indicator

BOOL · %Q0.0

Your program will be tested against:

All test cases run automatically when you submit. Assertions are hidden until you pass.

  1. #1SPEED_OK when at 1000

    SPEED_OK when at 1000

  2. #2Not ok when at 700

    Not ok when at 700

  3. #3Not ok when at 1300

    Not ok when at 1300

Ready to build this?

Sign up free — no credit card required. This scenario requires the Pro plan.

Sign up to play this scenario →

Already have an account? Log in