The state of the simulation objects can be controlled and monitored. It is possible to retrieve the value of each variable and each parameter of each simulation object. The value of each independent variable can be set from the environment while a simulation is running.
The communication between the building simulator and its environment are established by eventstreams which generate the necessary commands and convert the output of the building simulator into a user readable format.
The following kinds of eventstreams are available:
By the entry
The different times are updated about every second, but due to the limitations of the ERLANG timing concept, there is some imprecision and the updates are not synchronous. Do not be worried that real-time binding is violated if simulation time and wall clock time do not change synchronously, the real-time binding is maintained nevertheless.
This kind of eventstreams provides access to a running simulation via sockets. Access can be from other programs as well as via the command telnet. telnet can be used in either line or character mode.
Via sockets it is not possible to send commands to be executed at a specific time.
Sockets provide a model of sensors and actuators corresponding to the testroom of AG Zimmermann, see [3]. Several connections can be established simultaneously on each socket and several sockets can be started with different sets of sensors/actuators.
There are four different subtypes of these eventstreams:
Sockets are declared in the configuration file using the following syntax:
'[ socket, ' Node ',' Host ',' Ports ',' Sensors '].' | |
Node | 'localnode' | NodeName |
Host | 'localhost' | HostName |
Ports | '[' Port ( ',' Port )* ']' |
Port | '{' Name ',' Number ',' Type '}' |
Name | <name> |
Number | <portnumber> |
Type | '[' 'cache' | 'nocache' | 'fault' | 'inspect' ']' |
Sensors | '[' FileName (',' FileName)* ']' |
FileName | <filename> |
An internal error can occur when several of these files are reparsed simultaneously. Restarting the building simulator until all files are parsed usually helps.
Sensors and Actuators are described as
Sensor | '[ sensor,' Name ', {' Object ',' Variable '}, Unit ',' Type '].' |
Type | 'analog' | 'digital' |
Actuator | '[ actuator,' Name ', {' Object ',' Variable '},' IntRep ',' ExtRep '].' |
IntRep | Unit | |
'threepoint' | 'openclose' | 'realzeroone' | | |
'float' | 'time' | 'name' | |
ExtRep | 'trigger' | 'threepoint' | 'twopoint' | |
'realzeroone' | 'percentfloat' | 'string' |
By the entries
The input and output formats are the same.
An entry in a file has the following format, see below for periodic input:
's:io(' Time ',' Object ',' Variable ',' Command ').' | |
Time | 'now' | Seconds |Compound |
Compound | as for controlstream |
Object | <name> |
Variable | <name> |
Command | '{' Value ',' Unit '}' | Number | 'get' | 'mon' | 'nom' |
<name>s can be given as ERLANG-atoms or as strings enclosed in quotes. Value and Unit must be an appropriate value and a unit, respectively, for the variable accessed. The unit of each variable is given in the header file of the corresponding object, cf. $Simulator/def_*.hrl. Numerical values can be input without unit, but this is not suggested.
get is used to retrieve the current value of the variable once, mon is used to retrieve the value of the variable at each future change, i.e. to monitor the variable. nom is used to stop monitoring.
Setting and retrieving variables can be done periodically, too. Input syntax is:
's:io_period(' Time ',' Object ',' Variable ',' Command ',' Period').' | |
Period | 'no_longer' | Seconds |