[ENG] 17.1. [DKSF 70/71.6 IU] Controlling IO Lines

The interface of URL-encoded commands in a device can be used for the integration with web applications without using an SNMP protocol. Controlling IO lines is available through the interface of URL-encoded commands.

IO Line Status Request

http://192.168.0.100/io.cgi?ioN

where:

N  is a number of a line, specified after ?io.

Returned Values

 Error (incorrect request format or incorrect number of an IO line):

 io_result('error')

Successful completion of a command:

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

The first argument is always 'ok' ('error' while an error request).

The second argument is always «-1», to extend the API in future.

The third argument is a current instant status of an IO line, including a reset status.

The fourth argument is a pulse counter on this IO line.


The name JSON-P callback is fixed, io_result(), and cannot be changed in a request.

Switching a Line (in the Output Mode)

Switching to the status «0» or «1»:

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

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

where:

N  is a number of a line, it is indicated after ?io.


Switching to the alternate (inverted) status.

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

where:

N  is a number of a line, indicated after ?io.


Short-term switching to the inverted status, i.e. issuing a pulse.

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

where:

N  is a number of a line, indicated after ?io.

A duration in the seconds is specified after a comma.

Choosing the Operation Mode of an IO Line

Setting the operation mode of a line: «0» is an input, «1» is an output, «2» is a logic output:

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

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

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

where:

N  is a number of a line, indicated after ?io.

Returned Values

Error (incorrect format of a request or incorrect number of an IO line):

io_result('error')

Command is 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