Bird
Raised Fist0
PLC Programmingscripting~10 mins

Numeric displays and indicators in PLC Programming - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Numeric displays and indicators
Start PLC Program
↓
Read Numeric Input
↓
Process/Convert Number
↓
Send Number to Display
↓
Display Number on Indicator
↓
Wait for Next Cycle
↩Back to Read Numeric Input
The PLC reads a numeric input, processes it, sends it to a display device, and updates the indicator continuously.
Execution Sample
PLC Programming
NUM_INPUT := 1234;
DISPLAY_VALUE := NUM_INPUT;
// Output DISPLAY_VALUE to numeric display indicator
Assign a numeric input value to a variable and send it to the display indicator.
Execution Table
StepVariableValueActionOutput to Display
1NUM_INPUT1234Assign input valueNo output yet
2DISPLAY_VALUE1234Copy NUM_INPUT to DISPLAY_VALUEPrepare to display 1234
3DISPLAY_VALUE1234Send to display deviceDisplay shows 1234
4--Wait for next cycleDisplay holds 1234
5NUM_INPUT5678New input value assignedDisplay updates next cycle
6DISPLAY_VALUE5678Copy new inputPrepare to display 5678
7DISPLAY_VALUE5678Send to display deviceDisplay shows 5678
8--Wait for next cycleDisplay holds 5678
💡 PLC runs continuously, updating display each cycle with new input values.
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 5After Step 6Final
NUM_INPUTundefined12341234567856785678
DISPLAY_VALUEundefinedundefined1234123456785678
Key Moments - 2 Insights
Why does DISPLAY_VALUE change only after NUM_INPUT is assigned?
DISPLAY_VALUE copies NUM_INPUT's value each cycle (see steps 2 and 6). Until NUM_INPUT changes, DISPLAY_VALUE remains the same.
Why does the display hold the number even when the program waits?
The display device keeps showing the last sent value until a new value is sent (steps 4 and 8). This is normal behavior.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is DISPLAY_VALUE at step 3?
A5678
Bundefined
C1234
D0
💡 Hint
Check the 'Value' column for DISPLAY_VALUE at step 3 in the execution_table.
At which step does NUM_INPUT first change to 5678?
AStep 2
BStep 5
CStep 7
DStep 1
💡 Hint
Look at the 'Value' column for NUM_INPUT in the execution_table.
If NUM_INPUT did not change at step 5, what would DISPLAY_VALUE be at step 7?
A1234
Bundefined
C5678
D0
💡 Hint
DISPLAY_VALUE copies NUM_INPUT each cycle; see variable_tracker for how values change.
Concept Snapshot
Numeric displays in PLCs show numbers by:
- Reading numeric input values
- Assigning input to a display variable
- Sending the display variable to the numeric indicator
- The display holds the last sent number until updated
- This cycle repeats continuously to update the display
Full Transcript
This lesson shows how numeric displays and indicators work in PLC programming. The PLC reads a numeric input value, assigns it to a variable for display, and sends that value to the numeric display device. The display shows the number and holds it until the next update cycle. When the input changes, the display updates accordingly. The execution table traces each step, showing variable values and display output. Key moments clarify why display values update only after input changes and why the display holds values between cycles. The visual quiz tests understanding of variable values at specific steps and the effect of input changes on the display. This helps beginners see how numeric indicators work in real PLC programs.

Practice

(1/5)
1. What is the main purpose of numeric displays in PLC programming?
easy
A. To control the power supply
B. To store data in memory
C. To show numbers clearly on control panels
D. To connect different devices

Solution

  1. Step 1: Understand numeric displays

    Numeric displays are designed to show numbers clearly so operators can read values easily.
  2. Step 2: Identify the correct purpose

    Among the options, only showing numbers clearly matches the function of numeric displays.
  3. Final Answer:

    To show numbers clearly on control panels -> Option C
  4. Quick Check:

    Numeric displays = show numbers clearly [OK]
Hint: Numeric displays always show numbers, not control or storage [OK]
Common Mistakes:
  • Confusing numeric displays with data storage
  • Thinking numeric displays control power
  • Mixing numeric displays with device connections
2. Which of the following is the correct syntax to display a numeric value on a PLC numeric display using a function called DisplayNumber with input value?
easy
A. DisplayNumber(value);
B. DisplayNumber = value;
C. DisplayNumber:value;
D. DisplayNumber->value;

Solution

  1. Step 1: Identify function call syntax

    In PLC programming, calling a function with an argument uses parentheses, like DisplayNumber(value);
  2. Step 2: Check other options

    Options A, B, and C use incorrect assignment or symbol syntax not valid for function calls.
  3. Final Answer:

    DisplayNumber(value); -> Option A
  4. Quick Check:

    Function call syntax uses parentheses [OK]
Hint: Function calls use parentheses with arguments [OK]
Common Mistakes:
  • Using assignment instead of function call
  • Using colon or arrow symbols incorrectly
  • Missing parentheses for function arguments
3. Given the following PLC code snippet, what will be the displayed output on the numeric display?
int temperature = 25;
DisplayNumber(temperature + 5);
medium
A. Error
B. 25
C. 5
D. 30

Solution

  1. Step 1: Calculate the expression inside DisplayNumber

    The code adds 5 to the variable temperature (25 + 5), resulting in 30.
  2. Step 2: Understand DisplayNumber output

    The function displays the calculated value, so the numeric display shows 30.
  3. Final Answer:

    30 -> Option D
  4. Quick Check:

    25 + 5 = 30 displayed [OK]
Hint: Add values before display function call [OK]
Common Mistakes:
  • Ignoring the addition operation
  • Assuming the display shows the variable only
  • Thinking the code causes an error
4. Identify the error in this PLC code snippet intended to display a numeric value:
int speed = 100
DisplayNumber(speed);
medium
A. Incorrect function name
B. Missing semicolon after variable declaration
C. Variable type is wrong
D. DisplayNumber cannot take variables

Solution

  1. Step 1: Check syntax of variable declaration

    The line int speed = 100 is missing a semicolon at the end, which is required.
  2. Step 2: Verify function call correctness

    The function call DisplayNumber(speed); is correct and uses the variable properly.
  3. Final Answer:

    Missing semicolon after variable declaration -> Option B
  4. Quick Check:

    Semicolon missing after int declaration [OK]
Hint: Always end statements with semicolon [OK]
Common Mistakes:
  • Forgetting semicolon after declarations
  • Assuming function name is wrong
  • Thinking variables can't be passed to functions
5. You want to display a temperature value with one decimal place on a numeric display in a PLC program. Which approach correctly formats the number before display?
float temp = 23.456;
// Choose the correct formatting method
DisplayNumber(____);
hard
A. round(temp, 1)
B. int(temp)
C. temp + 0.1
D. floor(temp)

Solution

  1. Step 1: Understand formatting for decimals

    To show one decimal place, rounding the float to 1 decimal is needed.
  2. Step 2: Evaluate options

    Only round(temp, 1) correctly rounds to one decimal place. temp + 0.1 (temp + 0.1) changes the value, B (int(temp)) removes decimals, D (floor(temp)) truncates down.
  3. Final Answer:

    round(temp, 1) -> Option A
  4. Quick Check:

    Rounding to 1 decimal = round(temp, 1) [OK]
Hint: Use round(value, decimals) to format numbers [OK]
Common Mistakes:
  • Using int() which removes decimals
  • Adding small values instead of rounding
  • Using floor() which truncates without rounding
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard