Switching devices

Article contents:


The following types of switching devices are possible (type):

  • relay - relay, the output of which in the device is designed in the form of contacts;
  • outlet - outlet;
  • toggle - switch;
  • strobo - low-current low-voltage output in the form of contacts.


Reading the parameters of the switching element is done by the command:

getelement - read the element. Required parameters are:

  • k - user session ID;
  • id - element ID;.
  • period - the time interval of the accumulated data, the following values ​​are possible: "100seconds", "100minutes", "100hours", "100days",
  • mode - the output mode of the data, must be "xml".


The response contains information about the element:

<element id="302001" module="2013" clas="switch" type="outlet" name="Outlet-1" state="off" value="0" initial="off" pulse="7" hwport="1" />

Where:

  • id - unique identifier of the element;
  • module - the identifier of the module to which the element belongs;
  • clas - the class of the element;
  • type - describes the type of the element within the class;
  • name - the name of the element;
  • state - the state of the element;
  • hwport - hardware port, determines the location of the connector on the body of the device;
  • value - a numerical value corresponding to the measured value;
  • initial - the normal state of the key (possible values ​​on and off), is set at the time the system is started;
  • pulse - the time in seconds, to which the key is transferred from the normal state (determined by the initial field) to the opposite one at the command "sendpulse".

Control

The following queries are used for management:

updateelement - management of the permanent state of the key (relay or outlets). Extra options rare:

  • k - user session ID;
  • id - the identifier of the element;
  • name - the name of the element, the length is not more than 63 characters;
  • initial - the normal state of the key (possible values ​​on and off), is set at the time the system is started;
  • pulse - the time in seconds, to which the key is transferred from the normal state (determined by the initial field) to the opposite one at the command "sendpulse";
  • value - the state to switch the relay (possible values on, off, pulse), can be used without initial and pulse fields. 


sendpulse - generation of a pulse of a given duration, administrator rights required. In this case, the key is transferred from the normal state (the initial field in the updateelement command) to the opposite one, and after a specified time again returns to the normal state. Extra options are:

  • k - user session ID;
  • id - the identifier of the element;
  • pulse - the time in seconds that determines the pulse width, if not specified, then the previously set value is used.



Devices equipped with PDU (Power Distribution Unit) additionally support the following requests:

updatemodule - change the state of the ports of the outlet module or relay. The constant value of the element does not change. Through this command, the relay is switched on and off and the outlets are switched on and off. Extra options:

  • k - user session ID;
  • id - module identifier;
  • relval - the state of the outlets in the form of a bit field (0 - off, 1 - enabled).
  • relmask - mask for setting the state of outlets in the form of a bit field:
    • 0 - the value of the corresponding bit in relval is ignored;
    • 1 - the value of the corresponding bit in relval is used.
  • interval - delay in milliseconds, when several relays or outlets are connected in series, the range is 22-11000.


getmodule - read the attributes of the socket block. Required parameters are:

  • k - user session ID;
  • id - module identifier;


The response is:

<module id="2013" clas="internal" type="outlet" sn="33554434" rev="01.01" num="1" name="Outlets bank" state="normal" interval="990" relval="0" real_relval="0"/>

Where:

  • id - module identifier;
  • clas - the class of the module;
  • type - type of module;
  • sn - factory serial number;
  • rev - the firmware version of the PDU;
  • num - the module number of the PDU;
  • name - the name of the module;
  • state - the state of the module;
  • interval - the delay of switching on several relays, in milliseconds;
  • relval - bit field of outlets status;
  • real_relval - not used.


fulloff - emergency shutdown of all outlets, administrator rights required. When this command is executed, execution of all logic schemes is blocked to avoid behavioral conflicts. Extra options are:

  • k - user session ID;
  • id - the module identifier.