Loading local progress…
Practice missions
Practise in
Level 1, 0 XP · your progress
Mission 31 · Pro Structured Text array exercise

Add four measured values

Practise arrays on four readings before you build a filter.

Copy SampleA, SampleB, SampleC and SampleD into Values[0] to Values[3]. Then add them up into Total, a (decimal number). Do this fresh on every .

This mission is part of ProTry the full course, every mission and the expert challenges free for 7 days. No card needed.
The 3D process tank this mission runs on Pro mission
Test replay

Total follows new readings, decimals included

Test 1 of 5
Set by the testChecked by the testStep 3 of 3 · 400 ms
Level
Applied
Time
About 12 min
Reward
+150 XP
Rig
3D process tank
Siemens editors
SCL
Rockwell editors
Structured Text
Course stage
17. Work through a collection
Automatic tests

What the tests check

  1. Total adds all four values exactly once, decimals included.
  2. When an changes, Total updates at once. If nothing changes, Total must not keep growing.
  3. The worked solution uses slots 0 to 3 and a FOR loop that includes both ends.
  1. Try it Use the buttons below the model and watch the rig respond.
  2. Test solution Every check runs on your code in one press.
  3. Replay If one fails, step through it one scan at a time to see why.
Why it matters

Where you’d see this on site

At a drinks factory, a daily report adds up water-use readings from four meters. All four readings must be in the total.

Missing one reading gives a false total. Counting one twice also misleads the operator. This exercise only does the sums; it does not fill the tank.

Where you'd find thisMaking one batch of drink

At a drinks factory, valves let measured amounts of water and syrup into a mixing tank. An electric mixer blends them into one batch. An outlet valve then sends the drink to a holding tank. Filling machines bottle it from there.

  1. Ingredient tanksHold the water and syrup
  2. Mixing tankFill, mix and measure one batchYou are here
  3. Holding tankKeeps the finished drink ready
  4. Bottle fillerPuts the drink into bottles
On a real site: places, parts and safety
  • Drinks factory — blending water and syrup
  • Paint factory — mixing ingredients into a consistent colour
  • Water-treatment works — preparing a measured chemical mixture
  • Brewery — heating water for washing equipment

A full tank does not close its own inlet. Water keeps arriving until the valve closes, so an open inlet can flood the room.

A heater that is not covered by liquid can overheat. Real tanks have separate safety devices as well as the PLC programme.

The sizes, timings and cutaways are teaching choices, not a drawing of any one real installation.

Keep going

Next in the course