MIAplc
Examples

Example projects

Open a project straight in the simulator and watch it work. Inside the simulator you also find them under 📂 Open; for your own PLC, download the .espplc.json file.

How to open an example in the simulator

  1. Openpress ▶ Open in the simulator under the example (or 📂 Open inside the simulator).
  2. Confirmif the editor asks to replace the project, answer yes.
  3. Download and RunDownload to cpu, confirm, then Run.
  4. Onlinepress Online and switch the inputs on in the MOCK PLC panel.
Basic · 3 networks

Motor start / stop

The first program of every automation course: the self-holding circuit. Start runs the motor, its own contact keeps it on, Stop or the thermal overload stop it. A lamp lights up 3 seconds after starting.

  1. Click I0 (Start) and click again to release it: Q0 stays on.
  2. After 3 s Q1 lights up.
  3. Click I1 (Stop) or I2 (overload): the motor stops.
Timers · 6 networks

Traffic light

Three cascaded timers run the cycle green 5 s, yellow 2 s, red 4 s. With the traffic light off, yellow flashes using system bit SM5 (1 Hz clock).

  1. Without touching anything: Q1 flashes.
  2. Click I0 (Enable): the cycle starts on Q0, Q1, Q2.
  3. In Online, watch the timers count inside the TON boxes.
Advanced · FC, DB, comparisons

The relay song

Relays can't play notes, but they can play rhythm: Beethoven's Fifth, Jingle Bells and “Shave and a haircut” beaten out on Q0 and Q1. A step sequencer built with an FC, timers and comparisons. On a real board you hear the relays click. (Comments in Italian.)

  1. After Run the music starts by itself.
  2. I0: start again from the top.
  3. Open FC10 to see how the sequencer is built.
Coming soon

More examples

Part counter with CTU, tank with analog level and SCALE, recipe in a retentive DB, FC in Structured Text, µLink I/O module with Arduino.

Got an example to suggest? Write to me.

The traffic light in Online view in the MiaPLC simulator
The traffic light in Online view in the simulator: yellow phase, the yellow timer is counting.