Skip to content

Commit

Permalink
Doc update.
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Rule (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Dec 2, 2024
1 parent a0d4a33 commit bdf48c3
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 115 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ FMI Libraries of the Dynamic Simulation Environment (DSE) Core Platform provide
* FMI Model Compatability Library (MCL) - for loading FMUs into a DSE simulation.
* FMI ModelC FMU - for packaging a DSE simulation as an FMU.
* FMI Gateway FMU - for bridging between a remote simulation and a DSE simulation.
* FMI FMU - a minimal API for implementing FMUs with support for Binary Variables and Virtual Networks.

The DSE FMI libraries operate in Co-simulation environments and support both scalar and binary variables.
Virtual networks (e.g. CAN) are implemented using [Network Codecs](https://github.com/boschglobal/dse.standards/tree/main/dse/ncodec) and supported via FMI Binary variables, or in the case of FMI 2, by using encoded [FMI String variables](https://github.com/boschglobal/dse.standards/tree/main/modelica/fmi-ls-binary-to-text).
Expand Down Expand Up @@ -51,13 +52,26 @@ Virtual networks (e.g. CAN) are implemented using [Network Codecs](https://githu
* Simple lifecycle which can be customised to support automation of simulation environments (e.g. session management).


#### FMI FMU

* Minimal API for implementing Co-simulation FMUs with methods:
* `fmu_create()`
* `fmu_init()`
* `fmu_step()`
* `fmu_destroy()`
* Automatic FMI Variable indexing and storage, including FMI 2 support for Binary Variables
* Build targets for FMI 2 and FMI 3.
* Virtual Networks (CAN etc.) using [Network Codecs](https://github.com/boschglobal/dse.standards/tree/main/dse/ncodec) and Binary Streams. Includes support for FMI 2 (via String variables).


### Project Structure

```text
L- dse
L- fmigateway FMI Gateway FMU source code.
L- fmimcl FMI MCL source code.
L- fmimodelc FMI ModelC FMU source code.
L- fmu FMI FMU source code.
L- extra Build infrastructure.
L- tools/fmi Containerised tools.
L- licenses Third Party Licenses.
Expand Down
78 changes: 39 additions & 39 deletions doc/content/apis/fmi/fmimcl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,6 @@
title: FMI MCL API Reference
linkTitle: MCL
---
## mcl_create


Create an instance of the MCL which will then be used to operate the Model that
the MCL represents.

### Parameters

model (ModelDesc*)
: Model descriptor object.

### Returns

MclDesc (pointer)
: Object representing the MCL Model, an extended ModelDesc type (derived from
parameter `model`).

NULL
: The MCL Model could not be created. Inspect `errno` for more details.

### Error Conditions


Available by inspection of `errno`.



## mcl_destroy


Releases memory and system resources allocated by `mcl_create()`.

### Parameters

model (ModelDesc*)
: Model descriptor object.



## FMI Model Compatibility Library


Expand Down Expand Up @@ -235,6 +196,45 @@ center footer Dynamic Simulation Environment



## mcl_create


Create an instance of the MCL which will then be used to operate the Model that
the MCL represents.

### Parameters

model (ModelDesc*)
: Model descriptor object.

### Returns

MclDesc (pointer)
: Object representing the MCL Model, an extended ModelDesc type (derived from
parameter `model`).

NULL
: The MCL Model could not be created. Inspect `errno` for more details.

### Error Conditions


Available by inspection of `errno`.



## mcl_destroy


Releases memory and system resources allocated by `mcl_create()`.

### Parameters

model (ModelDesc*)
: Model descriptor object.



## Typedefs

### FmuData
Expand Down
132 changes: 66 additions & 66 deletions doc/content/apis/fmi/fmimodelc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,33 @@
title: FMI ModelC FMU API Reference
linkTitle: ModelC FMU
---
## fmi2FreeInstance
## FMI ModelC FMU


Free memory and resources related to the provided FMU instance.
The FMI ModelC FMU is and FMU which is capable of loading and running a
DSE Simulation (e.g. a ModelC Simulation Stack). All capabilites of the ModelC
Runtime are supported, including the exchange of binary signals (e.g. CAN) and
realisation of bus topologies (e.g. multi-node CAN Networks).

### Parameters

c (fmi2Component*)
: An Fmu2InstanceData object representing an instance of this FMU.
### Component Diagram

<div hidden>

```
@startuml fmimodelc-component
title FMI ModelC FMU
center footer Dynamic Simulation Environment
@enduml
```

</div>

![](fmimodelc-component.png)




Expand All @@ -31,6 +49,27 @@ fmi2Component (pointer)



## fmi2ExitInitializationMode


Initialise the Model Runtime (of the ModelC library) and in the process
establish the simulation that this ModelC FMU is wrapping/operating.

This function will generate indexes to map between FMI Variables and ModelC
Signals; both scaler signals (double) and binary signals (string/binary).

### Parameters

c (fmi2Component*)
: An Fmu2InstanceData object representing an instance of this FMU.

### Returns

fmi2OK (fmi2Status)
: The simulation that this FMU represents is ready to be operated.



## fmi2GetReal


Expand All @@ -57,41 +96,36 @@ fmi2OK (fmi2Status)



## fmi2SetReal
## fmi2GetString


Set values for the provided list of value references and values.
Get values for the provided list of value references.

### Parameters

c (fmi2Component*)
: An Fmu2InstanceData object representing an instance of this FMU.

vr (fmi2ValueReference[])
: List of value references to set.
: List of value references to retrieve.

nvr (int)
: The number of value references to set.
: The number of value references to retrieve.

value (fmi2Real[])
: Storage for the values to be set.
value (fmi2String[])
: Storage for the retrieved values.

### Returns

fmi2OK (fmi2Status)
: The requested variables have been set (where available).

: The requested variables are retrieved (where available).


## fmi2SetString

## fmi2SetReal

Set values for the provided list of value references and values. String/Binary
variables are always appended to the ModelC Binary Signal.

> Note: If several variables are indexed against the same ModelC Binary Signal,
for instance in a Bus Topology, then each variable will be appended to that
ModelC Binary Signal.
Set values for the provided list of value references and values.

### Parameters

Expand All @@ -104,7 +138,7 @@ vr (fmi2ValueReference[])
nvr (int)
: The number of value references to set.

value (fmi2String[])
value (fmi2Real[])
: Storage for the values to be set.

### Returns
Expand Down Expand Up @@ -148,80 +182,46 @@ fmi2Error (fmi2Status)



## FMI ModelC FMU


The FMI ModelC FMU is and FMU which is capable of loading and running a
DSE Simulation (e.g. a ModelC Simulation Stack). All capabilites of the ModelC
Runtime are supported, including the exchange of binary signals (e.g. CAN) and
realisation of bus topologies (e.g. multi-node CAN Networks).


### Component Diagram

<div hidden>

```
@startuml fmimodelc-component
title FMI ModelC FMU
center footer Dynamic Simulation Environment
@enduml
```

</div>

![](fmimodelc-component.png)




## fmi2ExitInitializationMode
## fmi2FreeInstance


Initialise the Model Runtime (of the ModelC library) and in the process
establish the simulation that this ModelC FMU is wrapping/operating.

This function will generate indexes to map between FMI Variables and ModelC
Signals; both scaler signals (double) and binary signals (string/binary).
Free memory and resources related to the provided FMU instance.

### Parameters

c (fmi2Component*)
: An Fmu2InstanceData object representing an instance of this FMU.

### Returns

fmi2OK (fmi2Status)
: The simulation that this FMU represents is ready to be operated.


## fmi2SetString

## fmi2GetString

Set values for the provided list of value references and values. String/Binary
variables are always appended to the ModelC Binary Signal.

Get values for the provided list of value references.
> Note: If several variables are indexed against the same ModelC Binary Signal,
for instance in a Bus Topology, then each variable will be appended to that
ModelC Binary Signal.

### Parameters

c (fmi2Component*)
: An Fmu2InstanceData object representing an instance of this FMU.

vr (fmi2ValueReference[])
: List of value references to retrieve.
: List of value references to set.

nvr (int)
: The number of value references to retrieve.
: The number of value references to set.

value (fmi2String[])
: Storage for the retrieved values.
: Storage for the values to be set.

### Returns

fmi2OK (fmi2Status)
: The requested variables are retrieved (where available).
: The requested variables have been set (where available).



Expand Down
8 changes: 4 additions & 4 deletions doc/content/docs/user/fmi/fmigateway/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "FMI Gateway FMU"
linkTitle: "Gateway FMU"
linkTitle: "Gateway"
weight: 200
tags:
- FMI
Expand All @@ -25,11 +25,11 @@ FMI Gateway FMU
```

## FMI Gateway FMU Setup
## Setup

> DOC: Provide description of FMI Gateway FMU Taskfile workflows.
> DOC: Provide description of Gateway Taskfile workflows.

## FMI Gateway FMU Operation
## Operation

> DOC: Operation.
6 changes: 3 additions & 3 deletions doc/content/docs/user/fmi/fmimcl/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "FMI Model Compatibility Library (MCL)"
title: "FMI Model Compatibility Library"
linkTitle: "MCL"
weight: 400
tags:
Expand All @@ -25,12 +25,12 @@ FMI Model Compatibility Library
```

## FMI MCL Setup
## Setup

> DOC: Provide description of FMI MCL Taskfile workflows.

## FMI MCL Operation
## Operation

### Measurement

Expand Down
Loading

0 comments on commit bdf48c3

Please sign in to comment.