Skip to content

Training Scenarios

A scenario is a state of the model that students have to diagnose. A typical one: “the signal from the PLC does not arrive”. The teacher shares one link per scenario. Students open it, read the task, look at the PLC and the IO cards, and find the fault.

Scenarios are made of components on nodes of the model. You build them in the editor, with no code.

From teacher to student The teacher shares one link per scenario. The link opens the student view with the scenario active, showing the task window, the model, the operator panel and the IO modules. A TrainingLock on the document sends every opening without a teacher key to the student view. Teacher builds scenarios, shares one link each Link ?doc=...&scenario=Name &mode=student Student view scenario active, task window, operator panel, IO modules TrainingLock sends every opening without a teacher key here
One link per scenario. With the lock on, a student cannot reach the teacher view.
ComponentPurpose
ScenarioOne exercise: name, task text, which panels students see, optionally a variant that changes fields of the model
SignalFaultA fault on one signal. It sits as a child node below a Scenario and is active only while that scenario is active
WebIOModuleThe IO card picture students use for diagnosis
TrainingLockLocks the document so that it always opens in the student view

A SignalFault has a Target signal and a FaultType:

FaultTypeEffect
StuckFalseThe signal is always false (analog: the fixed value)
StuckTrueThe signal is always true
FrozenThe signal keeps the last value and ignores changes
InvertedThe signal is inverted
DelayedEvery change arrives later by DelayOn or DelayOff milliseconds
BouncingA change bounces for BounceDuration milliseconds at the BounceInterval

Inspector of a SignalFault: FaultType StuckFalse, StuckValue 0, Enabled, and the Target signal ArmDown

The direction of the signal decides who sees the fault:

  • PLC output (for example ArmDown): the model sees the fault value. The PLC program still sees what it wrote, so the LED on the DO card is on while the arm does not move.
  • PLC input (for example ArmIsDown): the PLC sees the fault value, even a real PLC connected through CONNECT. The sensor of the model works, but the PLC never gets its message.

The real value stays available underneath, and delays and bouncing run on the simulation clock. In discrete event simulation they behave the same, because the fault sits in the signal store and not in the animation.

  1. Create a node, for example Scenario - Arm does not go down, and add the component Scenario.
  2. Fill ScenarioName, Description and, if the task should open as a window, tick ShowOpener and write OpenerTitle and OpenerText.
  3. Add a child node with the component SignalFault. Pick the Target signal and the FaultType.
  4. Add IO cards with WebIOModule, or generate them with Generate from signals.

Inspector of a Scenario: ScenarioName, Description, VisibleToStudents, ReleasedToStudents, Variant, ShowOpener with OpenerTitle and OpenerText, and the four student view switches

Property of ScenarioDescription
ScenarioNameThe name used in the link. Defaults to the node name
VisibleToStudentsShow the name to students. Off keeps the title of the exercise a secret
ReleasedToStudentsThe scenario appears in the student list of a locked document
VariantA variant of the document that is applied while the scenario is active
ShowOpener, OpenerTitle, OpenerTextA task window that opens when the scenario starts. Students can reopen it with the Task button
ShowInspector, ShowHierarchy, ShowSignalList, ShowProblemsGroup Student view: which panels students may see. All off by default

Only one scenario is active at a time. Without a scenario in the link, none is active and the model behaves as usual.

One link per scenario, in the form

<viewer address>/?doc=<document>&scenario=<ScenarioName>&mode=student

With mode=student the viewer shows the reduced student view: no scenario switcher, no force markers, no scenario or fault components in the hierarchy and Inspector, no variant management. Students see the model, the operator panel and the IO modules window.

As the teacher, open the document without mode=student. A scenario switcher in the top bar lets you change between the base state and every scenario.

The scenario switcher in the top bar of the teacher view, open: Base, ArmDoesNotGoDown and EndPositionNotReported

Students see the task window, the operator panel and the IO modules window, and nothing that gives the solution away.

The student view of the scenario ArmDoesNotGoDown: a task window next to the operator panel and the IO modules window, where the ArmDown LED is on while ArmIsDown stays dark

Put a TrainingLock on the root node and tick Locked. From then on every opening without teacher proof lands in the student view, whatever the link says. A link without scenario shows the StartScenario, or a list of the scenarios marked as released.

Two ways to unlock:

  • Teacher link. The command trainingLock.createTeacherLink creates a link with a secret key after #tk=. The viewer removes the key from the address bar right after reading it. The link is shown once.
  • Teacher password. trainingLock.setTeacherPassword stores a salted, slow hash of the password. Students use the Teacher button and the password dialog. The proof lasts until the tab is closed.
Continuous simulationDiscrete event simulation
Signal faultsDelay and bounce follow the simulation timeDelay and bounce are events in the event queue
Fast forward and stepNot applicableFaults trigger at the same simulated time as in real-time mode
ResetFaults stay active, real values are re-appliedSame