[ENG] 16.1. [DKSF 54.3 IU] Relay Control

To add login and password to the URL structure, there is a need to use the next scheme:

http://<user_name>:<password>@<host>:<port>/<URL‐path>?<parameters>

where:

<user_name>:<password> -  are credentials for authroisation in a device web- INRERFASC;

<host> - is an IP address of a device;

<port> - port of an HTTP server;

<URL‐path>?<parameters> - is a URL-encoded command of a device.

An interface of URL-encoded commands in a device can be used for the integration with web applications without using an SNMP protocol. Through the interface of URL-encoded commands, a relay control is available.

Requesting a Relay Status

http://192.168.0.100/relay.cgi?rN

where: 

N  a relay number is indicated after ?r. 

Returned Values

Error (incorrect request format or incorrest relay number):

relay_result('error');

Successful execution of a device:

relay_result('ok', 2, 1);

where:

The first argument: always 'ok' ('error' when there is a request error).

The second argument is a source of controlling a relay (values are given for the firmware DKST70):

0 – Switched off manually

1 – Switched on manually


The third argument: a monumental actual relay status («0» or «1») taking into consideration the functioning of the module «Watchdog», activating reset, issuing a pulse, etc.

Switching a Relay

Changing a control source, and manual switching a relay on and off:

http://192.168.0.100/relay.cgi?rn=s

After ?r, a relay number is specified, after =, a number of a mode (control source) is specified.

where:

n – is a relay number

s – operation mode of a relay:

0 – Manual off

1 – Manual on


Switching (inverting) a relay, on <-> off:

http://192.168.0.100/relay.cgi?rn=f

A relay must be set to the mode «Manual on» or «Manual off».


Short-term switching of a relay to an inverse status (issuing a reset pulse):

http://192.168.0.100/relay.cgi?rn=f,10

Duration in seconds is specified after a comma. Applicable for all modes.

Returned Values

An error is returned if a request format is incorrect as a result of setting an incorrect/unacceptable value of a relay number or a relay mode.

relay_result('ok')

relay_result('error')

Authorization

To add a login and password to the structure of a URL-encoded command, it is possible to use the next scheme:

  • http://<username>:<password>@<host>:<port>/<URL‐path>?<parameters>

where:

<username>:<password> – are credentials for authorization in a device web interface;

<host>  is an IP address of a device;

<port>  is a port of an HTTP server;

<URL‐path>?<parameters>  is a URL-encoded command