Skip to Content

PLC Solution Library · End-of-line test simulator

Run an end-of-line test sequence and see each step pass or fail

At the end of your line, each part needs proof: its wiring is right, its insulation holds and it works when you power it. In this simulator, one M-Duino 42 runs that test sequence on an example cable harness with a 24 V module, drives an external insulation tester and writes an OK or KO result for each step.

Scan a serial number, start the test or inject a fault. Watch each step, the tower lamp and the record your PLC writes.

Choose your scenario

07:00:00 Free mode · scan a serial and start the test Simulated values
0parts tested
0OK
0KO
-first pass yield
-serial on the fixture
-last cycle time

      Leave the serial empty and press Scan: the simulator makes the next number.

      About this panel

      Example bench for you to test. The part is a cable harness with 8 wires from connector X1 to connector X2, and a 24 V module on connector X3.

      One M-Duino 42 drives the whole sequence. A barcode scanner sends the serial number over RS-232. An external insulation tester does the high voltage test and answers with BUSY, PASS and FAIL signals. A current transducer gives the module current as 0-10 V.

      Every time, limit and fault on this panel is a simulated example, not the data of a real bench.

      Your design choices

      These are the choices you make in your own test program. They are explained below. A serial that already passed is always blocked, so a double scan never creates a second OK.

      Example test limits

      Continuity8 wires. Each wire must reach only its own pin.
      InsulationExternal tester, for example 500 V DC. The limit is set in the tester. The PLC reads PASS or FAIL.
      Module current100 to 200 mA at 24 V
      Module responseWithin 500 ms of the command
      Tester timeout10 s without an answer

      Example values for this simulator. Your limits come from your product drawing and your test specification.

      Table test_results

      idserialtimecontinuityinsulationfunctionalresultfailureattempt

      One row per test attempt. Your PLC writes the row to its microSD card with the time of its real-time clock, and sends it over Ethernet to your MES or database. NOT RUN means the step did not run. It is not an OK.

      What does the PLC do at each step of the sequence?

      The PLC runs a fixed sequence of steps for each part and gives a result for every step. It reads the serial number, closes the fixture, checks the wiring, starts the insulation test, powers the part for a functional test and writes the result. The part passes only if every step is OK.

      1. Scan. A barcode scanner sends the serial number to the PLC over RS-232. The PLC checks that this serial has not already passed.
      2. Clamp. The PLC closes the fixture and waits for the "fixture closed" sensor. No test starts on an open fixture.
      3. Continuity. The PLC drives one wire at a time and reads all the wires at the other end. It finds open, crossed and shorted wires.
      4. Insulation. The PLC disconnects its own lines from the part and starts an external insulation tester. It waits for the tester to answer PASS or FAIL.
      5. Functional. The PLC powers the part, measures its current and checks that it answers a command in time.
      6. Record. The PLC writes one record with the serial, the time and the result of each step, then shows green or red on the tower lamp.

      Run the Wiring faults scenario and compare what you see on the wires with the failure text in the table.

      How do open, crossed and shorted wires show up in the scan?

      The PLC uses the method "drive one, read all". It switches on one output, which puts 24 V on one wire at connector X1. Then it reads all the inputs wired to connector X2. A good wire lights only its own input.

      • Open wire: the expected input stays off.
      • Crossed wires: the expected input stays off and another input switches on.
      • Short between two wires: the expected input switches on, and another input switches on with it.

      This check proves the connection map. It does not measure resistance. If your specification gives a limit in ohms or milliohms, add a resistance meter or a dedicated harness tester, and let the PLC read its result.

      In a real fixture, a series resistor or diode on each wire start protects the outputs when two wires are shorted.

      With 8 wires, the example uses 8 outputs and 8 inputs of the M-Duino 42. For more test points, add a second PLC on Ethernet, expansion modules or a switching matrix. The logic stays the same.

      Why does an external tester do the insulation test?

      An insulation test puts a high DC voltage, for example 500 V, between the conductors and the shield or the housing, and checks the leakage. That voltage must never reach the PLC inputs and outputs. A dedicated insulation tester makes the measurement. The PLC runs the sequence around it.

      1. The PLC opens a set of isolation relays, rated for the test voltage, that disconnect its own lines from the part.
      2. It checks that the guard of the test area is closed.
      3. It sends a START pulse to the tester and waits for BUSY.
      4. When BUSY goes off, it reads PASS or FAIL. It waits for the tester to finish and discharge the part before it reconnects its own lines.
      5. If the tester does not answer within the timeout, the step is KO with the reason "tester no answer". The PLC keeps its lines disconnected and waits for a reset of the tester. It does not assume that the high voltage is off.

      Many testers can also send the measured value over RS-232 or RS-485. The PLC can store it in the record next to PASS or FAIL.

      The guard check in the PLC program is process logic. Protection of people from high voltage needs a safety-rated circuit, separate from this logic, that cuts the tester output when the guard opens.

      How do retests and double scans show up in the record?

      The PLC builds one record for each test attempt. The record holds the serial number, the time, the result of each step, the reason of the first failure and the attempt number. It writes the record in two places.

      • Local copy: one line in a CSV file on the microSD card, with the time of the real-time clock. If the network is down, nothing is lost.
      • Plant copy: the same record over Ethernet to your MES or database, for example with Modbus TCP, MQTT or an HTTP request.

      Before a test starts, the PLC checks the serial against its records or your MES. A serial that already passed is blocked, so a double scan never creates a second OK. A KO serial can be blocked, or allowed one retest that the record marks as attempt 2.

      Run the Insulation and retest scenario. It allows one retest. Run it again with "Not allowed" to see the block.

      Design choices you make

      1. Stop at the first KO, or run every step

      If you stop at the first KO, the cycle is shorter and the part goes to the red bin sooner. If you run every step, the record shows every fault of the part, which helps when you look for the cause. Do not run the insulation test on a part with a short that the continuity step has already found, unless your tester and your specification allow it.

      2. What a KO part does next

      A common rule is that a KO part must go into a red bin with a sensor before the PLC opens the fixture for the next part. This keeps KO parts out of the good flow. You decide if a KO serial can be tested again, and how many times.

      3. Where the limits live

      You can keep the limits in the PLC program, or read them from your MES for each product reference. With limits in the MES, one bench tests several references, and the record stores which limits the PLC used.

      4. Proof that a step really ran

      Write a result for every step, also for the steps that did not run. In the table, NOT RUN marks a step that did not run, which is not the same as OK. Check the time of your real-time clock regularly, for example against an NTP server, so the records of different benches stay in order.

      The case study behind this simulator

      This simulator goes with our case study on end-of-line testing with an M-Duino 42.

      Read the end-of-line testing case study

      What you see here is a general pattern. The part, the number of wires, the limits, the times and the faults are examples, not the design of a real bench.

      Related pages: a pneumatic test bench with an Arduino based PLC, to check a sequence before it runs on a machine, and the automated fuse test bench project pack, with test sequences, interlocks and one report per test.

      Learn the building blocks

      These tutorials and examples cover the parts of this bench on an Arduino based PLC.

      More examples: PLC Solution Library · all simulators.

      M-Duino 42: the specs that matter here

      Inputs26: 14 digital optoisolated and 12 analog/digital (0-10 V, 10-bit), 5 to 24 Vdc
      Outputs16: 10 digital optoisolated transistor outputs and 6 analog/digital/PWM (0-10 V, 8-bit), 5 to 24 Vdc. Relays go through interface relays.
      CommunicationEthernet 10/100 Mbit (RJ45), RS-485, RS-232, TTL serial, I2C, SPI
      Built inReal-time clock, microSD slot, USB
      ControllerArduino Mega 2560 inside
      Power supply12 to 24 Vdc, with fuse and polarity protection
      MountingDIN rail TS35, IP20, inside a cabinet
      ProgrammingArduino IDE with the Industrial Shields boards package

      Example I/O for this bench

      SignalPLC I/OCount
      Drive wires 1 to 8 at connector X1Digital outputs8
      Insulation tester START, module supply relayDigital outputs2
      Tower lamp (green, yellow, red), fixture clamp valve, module command, isolation relaysAnalog/digital outputs used as digital6
      Read wires 1 to 8 at connector X2Digital inputs8
      Start button, fixture closed, guard closed, tester BUSY, PASS and FAILDigital inputs6
      Module current from a 0-10 V transducerAnalog input1
      Module response, red bin sensorAnalog/digital inputs used as digital, through a 24 V to 10 V interface if the signal is 24 V2
      Barcode scannerRS-2321
      MES or databaseEthernet1

      This example uses all 16 outputs and 17 of the 26 inputs. The outputs are transistor outputs, so the supply relay and the isolation relays are interface relays driven by the PLC. Check your loads and input levels against the ratings in the M-Duino family datasheet. Full specs: M-Duino 42 · M-Duino family.

      FAQ

      What should the PLC do when the insulation tester does not answer?

      Treat it as an unsafe state. The PLC marks the step KO with the reason "tester no answer", keeps its own lines disconnected and keeps the part in the fixture. It waits for a reset of the tester before anyone opens the guard. A tester that does not answer may still have its output on, so the PLC does not assume that the high voltage is off.

      Should a KO part be retested, and how is it recorded?

      It depends on your quality rules. A common setup allows one retest after a check or a repair. The record keeps both attempts with the same serial number: attempt 1 with its failure, attempt 2 with its result. A serial that already passed is always blocked, so a double scan never creates a second OK.

      Stop at the first KO or run every step?

      Stop at the first KO for a shorter cycle. Run every step when you need every fault of the part for the repair. Do not run the insulation test on a part with a short that the continuity step has found, unless your tester and your specification allow it.

      What is first pass yield in an end-of-line test?

      It is the share of parts that pass at their first attempt. Retests do not count as first passes. In the simulator, the panel calculates it from the first attempt of each serial number.

      What happens to a part that fails?

      The tower lamp turns red and the record stores the first failure. In a common setup, the PLC keeps the fixture closed until the part is in a red bin with a sensor. You decide if the same serial number can be tested again, and the record counts the attempts.

      Do I need to be a programmer to build this bench?

      You write the test program in C++ with the Arduino IDE. The parts you need (RS-232, microSD card, real-time clock, Modbus TCP) have public tutorials, linked above. If you prefer, an integrator can write the program from your test specification.

      Send me this architecture

      Tell us what your bench tests, how many test points you have and where the results must go. Our team replies with a proposed architecture for your case. Your simulator settings go with the request.