From GridLAB-D Wiki
Jump to: navigation, search

 TODO:  Update for Hassayampa (Version 3.0)

Important node
This capability is partially implemented. See the Realtime_server page for details. Striken text indicates the capability is not implemented at this time.

A real-time server (RTserver) module that include synchronous HTTP services has been implemented. The realtime server component has two main features.

  1. It locks the simulator clock to the system clock. Although the simulator clock may be started before the real-time clock, the simulator will advanced as quickly as possible until the real-time clock time is encountered. From then on the simulation will run in real-time. This allow stable initialization to be performed if necessary.
    If the simulation clock is initialized to TS_INIT, the simulation will start immediately with the real-time clock. This is enabled by setting the global variable run_realtime to a non-zero value. If the value is greater than 1, then the clock will run at a rate that many times greater than the system clock.
  2. Incoming HTTP traffic on port 80 is handled during the sync process of the server object. As many servers can be created as desired. The name of the server is used for virtual host naming but if the server is unnamed, it takes the name of the local host. Messages are handled synchronously in the order they are received and responses are always delivered in XML.

The following messages are handled:

http://servername/globalname
This query obtains the value of a global variable. The XML result is usually as follows

 <global>
    <variable-name>
       <unit>unitname</unit>
       value
    </variable-name>
 </global>

http://servername/objectname
This message queries the server for an object. The XML result is usually as follows

 <objectname>
   <propertyname>
     <unit>unitname</unit>
     value
   </propertyname>
   etc...
 </objectname>

http://servername/objectname/propertyname
This message queries the server for property of an object. The XML result is usually as follows

 <objectname>
   <propertyname>
     <unit>unitname</unit>
     value
   </propertyname>
 </objectname>

http://servername/objectname/propertyname=value
This message queries the server for property of an object. The XML result is usually as follows

 <objectname>
   <propertyname>
     <unit>unitname</unit>
     value
   </propertyname>
 </objectname>

Optionally, units may be appended, e.g., http://servername/objectname/propertyname?='value unit

http://servername/objectname/functionname?arg1&arg2&...&argN
This message calls the function on the object. The XML result is usually as follows

 <objectname>
   <functionname>
     int64-value
   </functionname>
 </objectname>