[ENG] 15.1. [DKSF 48.5 IU] IO Lines Control

The interface of URL-encoded commands in this device can be used for integration with web-applications without SNMP protocole.The operating of IO lined can be implemented via the interface of URL-encoded commands.

IO line status request

http://192.168.0.100/io.cgi?ioN

where:

N – the number of the line, indicated after ?io.

All IO lines status request

http://192.168.0.100/io.cgi?io

Return values

Error (wrong request format or wrong IO line number):

 io_result('error')

Successful execution of the command:

io_result('ok', 9, [1, 0, 0, 1]);

The first agrument: always 'ok' (upon request erroe — 'error').

The second argument — a bit map of the IO lines status

The third argument — IO line status in the form of a list

Return values

Error (wrong request format or wrong IO line number):

 io_result('error')

Successful execution of the command:

io_result('ok', -1, 1, 339)

The first agrument: always 'ok' (upon request erroe — 'error').

The second argument: always «-1», for API extension in the future

The third argument:current instantaneous state of the IO line, including the reset state.

The forth argument: pulse counter on this IO line.

The name JSON-P callback-а iis fixed, io_result(), and can not be changed in the request

Line switching (in output mode)

Switching to the state “0” or “1”:

http://192.168.0.100/io.cgi?ioN=0

http://192.168.0.100/io.cgi?ioN=1

where:

N – the line number, indicated after ?io.


Switching to an alternative (inverse) state.

http://192.168.0.100/io.cgi?ioN=f

where:

N – the line number, indicated after ?io.


Short-term switching to the inverse state, i.e., the issuance of a pulse.

http://192.168.0.100/io.cgi?ioN=f,5

where:

N – the line number, indicated after  ?io.

Duration in seconds is set after the decimal point.

The choice of the IO line operation mode

Setting the line operation mode: “0” - input, “1” - output:

http://192.168.0.100/io.cgi?ioN&mode=0

http://192.168.0.100/io.cgi?ioN&mode=1

where:

N the line number, indicated after ?io.

Return values

Error (wrong request format or wrong IO line number):

io_result('error')

The command has been executed.

io_result('ok')

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