Simulation Level II driver

Available for: Linux, Windows

With this simulated VSCP module it is possible to get measurement events injected into the system and to react on button press events that send TurnOn/TurnOff events. The simulation is primarily built for the user interface demo code that comes with VSCP & Friends but will be extended to do other things in the future.

This is work in progress. The driver will be a full level I and Level II node simulation by time. Currently it is usable to get periodic measurement events and to have a counterpart for button press events (confirmations).

Driver Windows: vscpl2_sim.dll
Driver Linux:

If you have problems starting this driver on a unix machine you can use

tail -f /var/log/syslog | grep VSCPSimDrv 

to get information on possible problems reported from the driver.

The configuration string has the following format


The parameter NumberOfNodes (which is optional) is the number of simulated devices the driver should report data from. Sensors will be assigned in the order they are started so nicknames will be 1,2,3 etc. This value can also be set as a VSCP daemon variable and if both are present the VSCP daemon variable will be used. Default is 1.

Variable name Type Description
_numberofnodes integer NumberOfNodes is the number of simulated nodes the driver should report data from.
_blevel2[0..n] boolean True if this is a level II node. Full GUID will be used in that case.
_zone[0..n] integer This is the zone for the simulated module.
_subzone[0..n] integer This is the subzone for the simulated module.
_guid[0..n] guid GUID to use when the data from the node is reported. A level II node must have a GUID assigned to it. For a level node all bytes of the GUID except for the lsb byte can be set to zero to indicate that the GUID of the interface should be used.
_path[0..n] string Path to measurement simulation data file. The data in this file is sent out as measurement events of the selected type in a round robin fashion. If not give a built in series of data will be used.
_interval[0..n] integer Sample interval in seconds for events. Set to zero to turn off. Default is 30 seconds.
_unit[0..n] integer Unit use. Allowed values is units listed for the defined measurement types.
_index[0..n] integer Measurement index 0-7. Default is 0.
_coding[0..n] integer Message coding 0-2. Default is 0. Allowed values 0=Normalized integer, 1=floating point, 2=string.
_decisionmatrix[0..n] string Comma separated list with decision matrix elements. Values can be decimal or hexadecimal and should, if hexadecimal, be preceded with "0x".
_measurementclass[0..n] long Class used for sent measurement events. Default is CLASS1.MEASUREMENT
_measurementtype[0..n] long Type used for sent measurement events. Default is Type=6, Temperature

The full variable name is built from the name you give the driver (prefix before _variablename) in vscpd.conf. So in the examples below the driver have the name sim1 and the full variable name for the _zone0 will thus be


If you have another diver and name it sim2 it will therefore instead request variable sim2_zone0

If your driver name contains spaces, for example “name of driver” it will get a prefix that is “name_of_driver”. Leading and trailing spaces will be removed.

Example of vscpd.conf entry for the simulation driver.
<!-- Level II simulation  -->
<driver enable="true">                        

The name "sim1" will be preceded in front of all variable names as sim1_variablen where n is the ordinal starting from zero (sim1__index0, sim1_coding0, etc).

The config string is set to 1 in this case meaning we should only simulate one node. There is only one parameter to set for this driver and it will be overridden if there is a variable defined as sim1_numberofnodes0.

Example of decision matrix (dm.xml) entry for the simulation driver.
    One simulated node that report temperature values 
    The NumberOfNodes can be specified in the driver configuration 
    string instead and does not need to be in configuration file.
<variable type="integer">
    Number of simulated nodes this driver should act as. Each of them should
        have an entry below with the index of the driver ordinal as the last character
        in there name. All variables names start with the driver unique prefix "sim_" 
        in this case.

<variable type="boolean">
    <note>This is a Level I node.</note>

<variable type="integer">
    <note>Zone for module.</note`

<variable type="integer">
    <note>Zone for module.</note>

<variable type="guid">
    <note>GUID for the node.</note>

<variable type="string">
    <note>Path to simulation data. Leave blank to use internal values.

<variable type="integer">
    <note>Interval between measurement events.</note>

<variable type="long">

<variable type="long">
    <note>Measurement type is temperature.</note>

<variable type="integer">
    <note>`Degrees Celsius (0=Kelvin, 1=Fahrenheit).</note>

<variable type="integer">
    <note>`Coding as normalized integer. (0=normalized integer, 1=float, 2=string)</note>

<variable type="integer">
    <note>Sensor index (0-7).</note>

<variable type="string">
      Two DM entries that reply to CLASS1.CONTROL, TurnOn/TurnOff with 

The coding of the decision matrix is as a normal Level I decision matrix

Byte Description
0 originating node id
1 flags
2 vscp-class mask
3 vscp-class
4 vscp-type mask
5 vscp-type
6 action
7 action parameter

Example of data file for simulation values.

Very Simple Control Protocol
Thu Jan 17 2019 17:41:36 GMT+0000 (UTC)
This document is licensed under Creative Commons BY 4.0 and can be freely copied, redistributed, remixed, transformed, built upon as long as you give credits to the author.

results matching ""

    No results matching ""