User Tools

Site Tools


eeros_architecture:hal:hardware_libraries_sim

This is an old revision of the document!


Hardware Simulator

The simulator offers digital and analog inputs and outputs. It offers to run simple example and test programs without the need of external hardware, see Tutorials. The wrapper library can be found in https://github.com/eeros-project/sim-eeros.
Currently the simulator encompasses a reflect device:

The available subdevices of the simulator

The input channels of subdevice 0 are output on the channels of subdevice 1 and similarly the same is true for subdevices 2 and 3. Every signal on input channel 0 to 10 is “reflected” onto its corresponding output channel 0 to 10.

Available Subdevices

Function Description Subdevice available Channels
Digital Output Outputs 0 0-10
Digital Input Inputs reflected from outputs of subdevice 0 1 0-10
Digital Input Inputs 2 0-10
Digital Output Outputs reflected from inputs of subdevice 2 3 0-10
Analog Output Outputs 4 0-10
Analog Input Inputs reflected from outputs of subdevice 4 5 0-10
Analog Input Inputs 6 0-10
Analog Output Outputs reflected from inputs of subdevice 6 7 0-10

Configuration File

The possible configuration file for the initialization of the Hardware Abstraction Layer might be as follows:

{
  "device0": {
    "library": "libsimeeros.so",
      "devHandle": "reflect",
      "subdevice0": {
        "type": "DigOut",
        "channel4": {
          "signalId": "dout1"
        }
      },
      "subdevice1": {
        "type": "DigIn",
        "channel4": {
          "signalId": "din1"
        }
      },
      "subdevice4": {
        "type": "AnalogOut",
        "channel7": {
          "signalId": "aout1",
        }
      }
      "subdevice5": {
        "type": "AnalogIn",
        "channel7": {
          "signalId": "ain1",
        }
      },
    }
  }
}

Digital output on dout1 can be read at input din1, analog output on aout1 can be read at input ain1. The configuration could include scaling and range limiting for the analog channels as described in Configuration File.

eeros_architecture/hal/hardware_libraries_sim.1550239391.txt.gz · Last modified: 2019/02/15 15:03 by graf