Processor-in-the-Loop
Purpose
Interface actual code executing on real hardware with simulation
Library
Processor in the Loop
Description
The PLECS PIL block interfaces a plant simulated in PLECS with control code executed on a real micro controller.
For more information on how to work with PIL see section Processor-in-the-Loop. The PIL block usage and parameters are described in further details in section PIL Block.
Parameters
General
- Target
- A PIL block is associated with a target defined in the target manager, which is selected from the Target combo box. The Configure... button is a shortcut to the Target Manager to configure current and new targets.
- Sample time
- The PIL block can be triggered at a fixed periodic rate by configuring the sampling time as a positive value. By setting the parameter to -1 or [-1 0] the PIL block will execute with an inherited sample time.
- External trigger
- The direction of the edges of the trigger signal upon which the PIL block is executed.
- Output delay
- The delay time between input and output of the PIL block, in seconds. A delay of 0 is a valid setting, but it will create direct-feedthrough between inputs and outputs.
Inputs
- Number of inputs
- The number of input terminals to the PIL block. Probes can also be added to inputs by selecting them and clicking the > button. To remove a probe, select it and either press the Delete key or < button.
Outputs
- Number of outputs
- The number of output terminals to the PIL block. Probes can also be added to outputs by selecting them and clicking the > button. To remove a probe, select it and either press the Delete key or < button.
Note It is possible to multiplex several probes into one input/output. The sequence of the probes can be reordered by dragging probes up and down the list.