Container with LS-BUS enable FMUs¶

Step-by-step example¶
The topology supported be fmucontainer require a BUS Simulation FMU. (See 3.2.2 of LS-BUS specification).
-
From LS-BUS Examples build 2 nodes
node1.fmuandnode2.fmu) and the Bus Simulationbus.fmu. -
Create a
bus+nodes.jsonfile describing the container. In this example, it connectsnode1.fmutobus.fmuthrough their terminals and the same fornode2.fmu. -
Create the container with the following command line
-
You could run the
bus+nodes.fmuwith you're favourite FMI-importer. Here is afrom fmpy.simulation import simulate_fmu def log(*args): msg = args[-1] if isinstance(args[-1], bytes): msg = msg.decode('utf-8') print(f"{msg}") simulate_fmu("bus+node.fmu", step_size=0.1, stop_time=1, output_interval=0.1, validate=True, use_event_mode=True, logger=log, debug_logging=True, relative_tolerance=1e-6)