Вы находитесь на странице: 1из 7

Start-Up

RESTful Web Service API KI00334 2013-04

1 Function and area of use


iX Developer provides an API for interacting with tags via the built-in Web Server. The tags can
be read from or written to using the HTTP verbs GET and POST. GET to read tags and POST to
perform batch operation. The API will typically be used when external applications wants to
read/write tag values from a panel/controller.

Software requirements:
- iX Developer 2.0
- Chrome Web Browser
- Simple REST Client (Chrome Plugin)

2 About the Start-up document


This Start-Up document should not be considered as a complete manual. It is an aid to be
able to start up a normal application quickly and easily. For further information we refer to
the iX Developer reference manual and User guide.
 MAxx831x (Reference manual)
 MAxx832x (User Guide)
This document and other Start-Up documents can be downloaded from
www.beijerelectronics.com.
Please use the address manuals@beijerelectronics.com for feedback on our Start-Up
documents.

                                                                              
Parent company: Sweden Beijer Electronics AB (publ) Beijer Electronics Inc. Beijer Electronics GmbH
Registered office: Malmoe Box 426 939 North Plum Grove Road, Suite F Zettachring 2A
Internet: www.beijerelectronics.com SE-201 24 MALMOE US-Schaumburg, IL 60173 DE-705 67 Stuttgart
KI_sv.dot, 090709

E-mail: info@beijerelectronics.com SWEDEN USA GERMANY


VAT reg no SE556025185101 Telephone +46 40 35 86 00 Telephone +1 847 619 6068 Telephone +49 711 327 599-0
Telefax +46 40 93 23 01 Telefax +1 847 619 6674 Telefax +49 711 327 599 10
RESTful Web Service API KI00334 2013-04

3 iX Settings
Create a Panel-project or a PC-project. This document is based on a Panel-project but the
same approach is applied to a PC-project.
Let’s start by configuring iX and creating a layout. In this example the Demo controller is
used.
 Select the System ribbon tab click on Web Server.

 Check Enable Web Server and enter a port number, the default port is 80.

When Enable forms authentication is checked; Free definable username and password can
be set. The authentication is not encrypted, but sent in plain text.
When unchecked; Anonymous authentication is used.
The Web Server will be active as soon as the application is running.
KI_sv.dot, 090709

www.beijerelectronics.com 2 (7)
RESTful Web Service API KI00334 2013-04

4 Install Simple REST Client


An easy way to test the API is to install a REST client. Most browsers provides this support
via a plugin.
In this sample we are using Chrome and a plugin called Simple REST Client.
Navigate to https://chrome.google.com/webstore/detail/simple-rest-
client/fhjcajmcbmldlhcimfajhfbgofnpcjmb
Click on the Add to Chrome button:

Click on the Add button:

The plugin is now installed, just click on the small icon in order to activate it:
KI_sv.dot, 090709

www.beijerelectronics.com 3 (7)
RESTful Web Service API KI00334 2013-04

5 GET and POST


By using different verbs it’s possible to read and write tag values via the API.

5.1 GET – Tags in application or specific tag


The GET verb allows the external application to retrieve a list of all tags running in the
application or information about a specific tag.
This can easily be tested by typing the following URL string in the client followed by
clicking on the Send button:

The Web Server will reply with:


KI_sv.dot, 090709

www.beijerelectronics.com 4 (7)
RESTful Web Service API KI00334 2013-04

To retrieve information about a specific tag the URL string will need to be modified slightly:

The Web Server will reply with:


KI_sv.dot, 090709

www.beijerelectronics.com 5 (7)
RESTful Web Service API KI00334 2013-04

5.2 POST – Read/Write tag batches


In order to read/write a batch of tags the POST verb can be used. The sample below will
receive information about Tag1 and Tag2:

The Web Server will reply with:


KI_sv.dot, 090709

www.beijerelectronics.com 6 (7)
RESTful Web Service API KI00334 2013-04

In order to write values to a batch of tags the URL string will need to be altered, refer to the
picture below:

The Web Server will reply with:


KI_sv.dot, 090709

www.beijerelectronics.com 7 (7)

Вам также может понравиться