VILLASframework
Modular co-simulation framework
|
During the previous labs, we use the villas pipe
, villas hook
and villas signal
tools connect simulators and process the exchanged simulation data. This approach is handy for small tests, development and training. However, more complex scenaries are unmanagable with this approach.
In this lab we introduce the VILLASnode daemon villas node
which provides an easier way to setup complex scenarios. In addition, villas node
benefits from lower latencies because we omit the standard input / output streams and the conversion of the samples in a human readable / line-based representation.
Note: We recommend the usage of the daemon for all real-time critical HIL simulations
The invocation of the daemon is pretty simple. Just pass the path to the configuration file as a paramteter:
All VILLASnode tools can fetch their configuration file from remote locations (all protocols from libcurl are supported):
All of the following examples use the same set of nodes, which we define in the file lab10_nodes.conf
:
Nodes for the following examples.
Todo: Please note, that currently each node must only used once as an input node. Using the same node as an input to multiple paths is not possible. Please consider using Loopback nodes as a workaround.
The configuration file lab10_uni_path.conf
extends lab10_nodes.conf
with a path section. This example reads samples from node rpi-1
and forwards them immediately to node rtds-1
.
A path can have multiple destinations by using an array for the out
setting. This example reads samples from node rtds-1
, duplicates them and forwards them immediately to nodes rpi-1
and rpi-2
.
Sometimes we want to filter and/or manipulate samples which are processes by a path. To do so, we can attach hook functions to a path. These hook functions are called for every batch of samples which is processed by the pass. This examples uses the print
hook to display all forwarded samples on stdout
of the console.
In a last example we demonstrate a bi-directional path by using multiple entries in the paths
section.
Go to [lab 11] =>(node-lab-11)