Consystence
Request a demo
Back to blog

Do generated control blocks behave? Testing them against behaviour vectors

A worked example from our workshop: how a behaviour vector is defined from the behavioural master, how it is replayed on a ControlLogix controller, what a pass and a fail look like, and exactly what the 8 September 2026 result covers.

Garry Thomas
Worked examplesAutomationEngineering

Worked examples · ControlLogix · Workshop

Status as of 10 November 2026: bench-verified, early access. On 8 September 2026, eleven generated materials-handling ControlLogix blocks matched all 112 of their behaviour vectors on a workshop controller; later revisions have been checked off-controller so far. PLCnext generation has run on a virtual controller only, and generated Ignition projects are display-only. The availability table is the status of record.

The plant problem

You are replacing a conveyor block that has run for years. The new one was generated from an equipment definition rather than typed by an integrator. Before it goes anywhere near a belt, you want an answer to a plain question: when the pull-cord opens, does it trip with the right code, drop the start command, and refuse a reset until the cord is healthy, exactly as the definition says it should?

Reading the generated logic line by line is one way to answer that. It does not scale to a library, and it does not tell you how the code behaves on the controller, scan by scan. So we test the behaviour instead.

The set-up

There are two halves, and they meet in a file.

The behavioural master. Every block in the library has one reference implementation, the behavioural master. The native simulator runs it with simulated field devices, and the generated ControlLogix Add-On Instructions are derived from it, so the code on the controller and the block in the simulator come from the same definition.

The workshop controller. A physical ControlLogix controller on our workshop bench, loaded through our engineering agent. A replay re-downloads the controller for every vector, so the agent refuses to run one against physical hardware unless the engineer passes its explicit download flag.

Between them sits a test rig: a small generated program that wraps each block, copies stimulus tags into it, and advances it one scan at a time on request, mirroring every output and status back into tags the agent can read.

Defining a vector from the master

A behaviour vector is a short script for one scenario. Each block has its own scenario scripts (start the belt, bring it up to speed, open the pull-cord, try a reset), and the expected values are never written by hand. They are obtained by running the master block itself through that script and recording what it does. Each vector starts from the master’s own configuration defaults, so the controller and the master begin from the same state.

The file holds three kinds of step: set writes stimulus values, scan advances the block a given number of scans, and expect lists the values every output and status channel must hold at that point. Here is the end of the conveyor’s pull-cord vector, as it stood on 8 September:

  {"set": {"IO_PullCordOK": false}},
  {"scan": 1},
  {"expect": {
     "IO_StartCmd": true, "St_Running": true,
     "St_Fault": true, "St_FaultCode": 10,
     "St_PullCordTrip": true}},
  {"scan": 1},
  {"expect": {
     "IO_StartCmd": false, "St_Running": false,
     "St_Fault": true, "St_FaultCode": 10,
     "St_PullCordTrip": true}},
  {"set": {"IO_RunFeedback": false, "Cmd_Reset": true}},
  {"scan": 1},
  {"expect": {
     "IO_StartCmd": false, "St_Running": false,
     "St_Fault": true, "St_FaultCode": 10,
     "St_PullCordTrip": true}},
  {"set": {"Cmd_Reset": false}},
  {"scan": 1},
  {"set": {"IO_PullCordOK": true, "Cmd_Reset": true}},
  {"scan": 1},
  {"expect": {
     "IO_StartCmd": false, "St_Running": false,
     "St_Fault": false, "St_FaultCode": 0,
     "St_PullCordTrip": false}}

Excerpt: the last 13 of the vector’s 33 steps, with each expect trimmed to five of the 29 channels it checks. Source: the conveyor’s vector 09, “pull-cord trip, code 10, reset refused until healthy”, in the materials-handling conformance kit of 8 September 2026.

Read it the way you would read a commissioning sheet. The cord opens; on the next scan the block latches fault code 10 while the belt is still running. One scan later the start command is off. A reset while the cord is still open changes nothing. Only when the cord is healthy does a reset clear the fault. The earlier 20 steps start the belt, wait out its pre-start warning and bring it up to speed.

Replaying it on the controller

The agent takes a directory of vectors and, for each one, puts the controller in Program mode, downloads it fresh, returns it to Run and then walks the script. A set writes tags online; a scan asks the rig to advance and waits for it to acknowledge; an expect reads every listed channel back and compares it with the master’s value. Whole numbers and booleans must match exactly. Real values must agree within 0.01, or within two parts in ten thousand for large values.

A pass and a fail look like this. These are the agent’s two result formats, taken from its source; the placeholders are renamed for reading, and the list of disagreeing channels is shown with one whole-number or boolean entry:

{scans} scans, {checks} checkpoints — match
divergence at op {opIndex} (scan {atScan}): {channel}: expected {value}, got {actual}

A divergence stops the run at that vector and names the step, the scan count and every channel that disagreed, with both values. It tells you where the generated block and the master part company, which is the information you need to fix the generator rather than patch the output.

What we saw on 8 September

The first attempt did not reach the controller. The engineering software rejected one block on import because the generator had copied a long description past the 512-character limit for an Add-On Instruction. The agent stopped before the download, and the controller was left untouched. We fixed the generator, regenerated, and the full kit imported cleanly.

Our plan had been to replay on an emulated controller first. The emulator was not available on the workshop machine that day, so the replay ran directly on the physical controller, with explicit sign-off and with an off-controller run of the same vectors as the gate.

The result: all 112 vectors matched, with zero mismatches, across the eleven blocks. The conveyor had 23 vectors, the weightometer 17, the crusher 14, the motor 12, the screen 11 and the feeder 10; the supporting debounce, filter, interlock, rate-limiter and discrete-input blocks had between 4 and 6 each. Because every vector starts from a fresh download, a single vector took between 27 seconds and almost seven minutes, and the set took about five hours.

Since then

The blocks have been revised since 8 September, and the vector set has grown with them: the kit now holds 121 vectors across ten blocks; the weightometer is no longer part of the generated library. Those revisions have been checked off-controller so far. Our automated tests replay the same vectors against the generated code off the controller, through an interpreter of the controller logic, with the same step handshake and the same tolerances as the controller replay. That is a useful regression net, but it is not the controller. The revised set as a whole has not been replayed on a controller.

Where to go next

The Build and generate page describes the generator and the targets it emits, with their current status. The plant without the plant explains how the native simulator runs the behavioural master, and the Platform availability table records what has been verified on which target, and when.