(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing
Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web...
Transcript of Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web...
![Page 1: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/1.jpg)
Technical Manual
Web ServicesSartorius Cubis SeriesElectronic Semimicro, Micro, Precision and Analytical Balances
Models MSA
98648-020-10
![Page 2: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/2.jpg)
Contents
1 Contents
1 Contents............................................................................................................................................................................................................................ 22 Change history................................................................................................................................................................................................................. 33 RESTful Web Services..................................................................................................................................................................................................... 4
3.1 Tools for RESTful Web Services................................................................................................................................................................................53.1.1 Firefox REST Client.......................................................................................................................................................................................................53.1.2 soapUI...............................................................................................................................................................................................................................53.1.3 REST describe and compile........................................................................................................................................................................................53.1.4 curl.....................................................................................................................................................................................................................................5
4 Application User Interface control............................................................................................................................................................................. 64.1 User Interface.................................................................................................................................................................................................................64.1.1 Area Task and Area User.............................................................................................................................................................................................64.1.2 Area Work........................................................................................................................................................................................................................74.1.3 Area fkey..........................................................................................................................................................................................................................9
5 Command Reference.................................................................................................................................................................................................... 105.1 Base URL........................................................................................................................................................................................................................105.2 getServiceList...............................................................................................................................................................................................................105.3 Application Service....................................................................................................................................................................................................115.3.1 getApplList....................................................................................................................................................................................................................115.3.2 getAreaList....................................................................................................................................................................................................................115.3.3 getScreenList (not implemented yet)..................................................................................................................................................................115.3.4 hideScreen....................................................................................................................................................................................................................125.3.5 getScreen (not implemented yet).........................................................................................................................................................................125.3.6 setScreen.......................................................................................................................................................................................................................135.3.7 clearScreen...................................................................................................................................................................................................................135.3.8 setTextLine....................................................................................................................................................................................................................145.3.9 setMenuLine.................................................................................................................................................................................................................145.3.10 setParamLine................................................................................................................................................................................................................155.3.11 getModuleList..............................................................................................................................................................................................................155.3.12 GetParamList................................................................................................................................................................................................................165.3.13 getParam.......................................................................................................................................................................................................................165.3.14 createParam.................................................................................................................................................................................................................175.3.15 setParam........................................................................................................................................................................................................................195.3.16 getMultiParam............................................................................................................................................................................................................205.3.17 getApplState................................................................................................................................................................................................................215.3.18 getApplStateCmd.......................................................................................................................................................................................................215.3.19 getModuleState..........................................................................................................................................................................................................215.3.20 getCmdList....................................................................................................................................................................................................................225.3.21 setModuleCmd............................................................................................................................................................................................................225.3.22 getEvents.......................................................................................................................................................................................................................235.3.23 getPortList....................................................................................................................................................................................................................245.3.24 getPort...........................................................................................................................................................................................................................245.3.25 setPort............................................................................................................................................................................................................................245.4 WeighingPoint Service.............................................................................................................................................................................................265.4.1 getWptList.....................................................................................................................................................................................................................265.4.2 GetWptData.................................................................................................................................................................................................................265.4.3 SetWptActive...............................................................................................................................................................................................................275.4.4 getWeight.....................................................................................................................................................................................................................27
Cubis MSA Web Services 2
![Page 3: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/3.jpg)
Change history
2 Change history
Version Date Name Changes/Adds
0.2 03.11.10 Pflüger - 1st Draft.
0.21 03.11.10 Pflüger - 2nd Draft
0.22 07.02.11 Kordes - 3rd Draft
0.23 22.08.11 Pflüger, Kordes - 4th Draft
0.24 17.02.14 Pflüger - 5th Draft
1.00 19.05.14 Pflüger - Release with new Layout
Cubis MSA Web Services 3
![Page 4: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/4.jpg)
RESTful Web Services
3 RESTful Web Services
The Cubis Web Services follow the paradigm of REST. This is described in depth in several publication. As an example you may look for REST in Practice by Jim Webber, Savas Parastatidis, and Ian Robinson, O'Reilly, ISBN: 978-0-596-80582-1.
Following the principles of REST the Cubis device will be presented as a set of resources that have one or more representations. Allthese resources are addressed by a unique URL. To give an example, a PUT to the following URL
http://172.16.253.157/rest1_0/appl/ui/WORK/2/TEXT/1?text=FirstLinecan be read in the following way:
http://172.16.253.157
/rest1_0 /appl /ui /WORK /2 /TEXT /1 ?text=FirstLine
Connect to the Cubis with the given IP via http
The REST services Rev. 1.0
Application services
User Interface
Area WORK Screen # 2 TEXT Line # 1
Additional parameter: set text to “FirstLine”
So this URL addresses a REST resource in the scales application user interface. It addresses line # 1 on screen # 2 in the work area and sets the text of this line.
This command is quite readable and you can use a standard browser to give this function a try.
The Cubis web services use the http methods GET, PUT and DELETE to address functions in the Cubis scale. The following table gives an overview of these functions:
http method Meaning
GET Read the value of a specific resource or a list of resources if more than one resource is addressed.
PUT Update the value of a resource or create a resource if it is not existent.
DELETE Destroy, delete or reset a resource to the default
If you use a standard plain vanilla browser for testing purposes you can only execute GET request using the URL line of the browser. To support you in this situation you can emulate PUT and DELETE requests by inserting the request verb just after 'rest1_0/', e.g.
http://172.16.253.157/rest1_0/PUT/appl/ui/WORK/2/TEXT/1?text=FirstLine
is accepted as a PUT request even if you send it via http method GET.
Remark:
In the literature you will find the hint that POST requests might be dangerous as these requests are not idempotent by definition. That means that if you can't get a response and you don't know if the request has been executed it might be dangerous to repeat this request. We don't use POST methods in Cubis web services and we tried our best to define the functionality to be idempotent. That means: repeating the same request several times is not harmful.
Cubis MSA Web Services 4
![Page 5: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/5.jpg)
RESTful Web Services
3.1 Tools for RESTful Web Services
There are some useful tools for the test of web services. You may use these tools for your first step with Cubis.
3.1.1 Firefox REST Client
There is an extension for the Mozilla Firefox browser that supports all kind of REST requests:
You can download it at
https://addons.mozilla.org/en-US/firefox/addon/restclient/
3.1.2 soapUI
SoapUI is a program running under Windows or Linux and allows you to test REST web services and can generate Java client code for you:
http://www.soapui.org/
3.1.3 REST describe and compile
REST describe and compile is a web site that can be used to generate client code for several programming languages. It doesn't work for me with Firefox but works with Internet Explorer.
http://tomayac.de/rest-describe/latest/RestDescribe.html
3.1.4 curl
The application curl is available for Windows as well as for linux. This command line application can be used to execute http request in batch files.
http://curl.haxx.se/
Cubis MSA Web Services 5
![Page 6: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/6.jpg)
Application User Interface control
4 Application User Interface control
Application services allow the access to resources managed by the Cubis application program. These are the following resource classes
• resources of the user interface, i.e. the display output and the key and touch screen input
• the application parameters
4.1 User Interface
The user interface resources of the Cubis scale allows the web service client to control parts of the display. The whole display is split in several areas. The area in the centre displaying the weight values can not be control via web service. The areas to be controlled are:
• task displays the currently selected task profile
• user displays the name of the user that is logged in currently
• work displays task specific parameters and is used for menus and input forms
• fkey shows the active function keys
4.1.1 Area Task and Area User
The task and user areas are suitable for status information for the current application display. Up to 30 definitions (screens) can bestored in the scale for these areas. The screens can be activated for each area independently. Every screen can hold one line definition. The lines can be defined as text lines only. The task area can display two lines though by wrapping the one line if it doesn't fit in length.
Cubis MSA Web Services 6
Task User
Work
FKey
Task User
Screen 1..30
![Page 7: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/7.jpg)
Application User Interface control
4.1.2 Area Work
In the work area up to 30 screens can be defined.
One of these screens can be activated. Every screen consists of up to 15 lines that can be scrolled by means of the scroll bar. Every
screen is of one of the following types:
• TEXT simple text to be displayed (see sample above)
• MENU a menu of selections
• PARAM parameters to be displayed
4.1.2.1 Menu screen
A menu screen shows a list of menu buttons that can be pressed by the user. Every line represents a menu item that can be selectable or deactivated.
Cubis MSA Web Services 7
TEXT
Screen 1..30
Screen 1..30
MENU
![Page 8: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/8.jpg)
Application User Interface control
4.1.2.2 Parameter screen
A parameter screen shows up to 15 lines with the current value of a parameter together with a descriptive header and a unit.
A parameter line can be used to just display an (unalterable) parameter or to show a parameter that is editable. In the latter case the user can change the parameters value by pressing the value button. Depending of the type of the parameter an appropriate edit wizard pops up.
The supported parameter types include:
• Number
• Number with unit
• Text string
• Password string (hidden)
• Formula string
• Filename string
Cubis MSA Web Services 8
Number
Number + unit
String
String
String
String
PARAM TYPE
...
![Page 9: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/9.jpg)
Application User Interface control
4.1.3 Area fkey
The fkey area is used to display function keys in the bottom line of the screen:
Up to 20 function key definitions can be defined. If not all defined function keys can be displayed then a 'More' key brings up a list of all available options:
Cubis MSA Web Services 9
![Page 10: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/10.jpg)
Command Reference
5 Command Reference
All REST request of the Cubis scale get the full parameter set of a request in the URL. That means that no http body is used in the PUT or DELETE requests. The response always has a body which is formatted as an XML string.
5.1 Base URL
The base URL of all REST services is /rest1_0/{method}. Every URL must start with this base URL.
URL /rest1_0/{method}
Method GET
Parameters Template parameters:
method One of• GET• PUT• DELETE
Overwrites the http method of the request. This parameter is optional and can be omitted. It is useful for testing purposes if you use a simple browser.
5.2 getServiceList
CMD getServiceList
URL /rest1_0/
Method GET
Parameters Template parameters:
none
Response resp_ServiceList List of available services. This is currently the following:• appl Application service• wpt Weighing point service
Cubis MSA Web Services 10
![Page 11: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/11.jpg)
Command Reference
5.3 Application Service
5.3.1 getApplList
CMD getApplList
URL /rest1_0/appl
Method GET
Parameters Template parameters:
none
Response resp_ApplList List of available application sections. This is currently the following:• ui User Interface Section• par Parameter Section• state Status Section• cmd Application Command Section
• event Event Section• multi Multiple Parameter Section• port Digital I/O Port Section
5.3.2 getAreaList
CMD getAreaList
URL /rest1_0/appl/ui
Method GET
Parameters Template parameters:
none
Response resp_AreaList List of available ui areas. This is currently the following:• user User area• task Task area• work Work area• fkey Function key area
5.3.3 getScreenList (not implemented yet)
CMD getScreenList
URL /rest1_0/appl/ui/{area}
Method GET
Parameters Template parameters:
area May be one of the following:• USER User area• TASK Task area• WORK Work area• FKEY Function key area
Response resp_ScreenList List of available screens for the area.
Cubis MSA Web Services 11
![Page 12: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/12.jpg)
Command Reference
5.3.4 hideScreen
CMD hideScreen
URL /rest1_0/appl/ui/{area}
Method DELETE
Parameters Template parameters:
area May be one of the following:• USER User area• TASK Task area• WORK Work area• FKEY Function key area
Response status
Action Hides the user defined screen in the given area. After hiding the default screen of the application is shown in this area.
5.3.5 getScreen (not implemented yet)
CMD getScreen
URL /rest1_0/appl/ui/{area}/{screen}
Method GET
Parameters Template parameters:
area May be one of the following:• USER User area• TASK Task area• WORK Work area• FKEY Function key area
screen The screen number from 1 to 30.
Response resp_Screen Properties of the given screen.
Cubis MSA Web Services 12
![Page 13: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/13.jpg)
Command Reference
5.3.6 setScreen
CMD setScreen
URL /rest1_0/appl/ui/{area}/{screen}
Method PUT
Parameters Template parameters:
area May be one of the following:• USER User area• TASK Task area• WORK Work area• FKEY Function key area
screen The screen number from 1 to 30.
Request parameters:
meassize For work area only:• NORMAL: normal screen size (default)• SMALL: small meas area and bigger work
screen size• NONE: none meas area and maximal work
screen size
Response status
Action Activates the current screen so that it is displayed.
Example:
http://172.16.253.157/rest1_0/PUT/appl/ui/WORK/2?meassize=NONE
5.3.7 clearScreen
CMD clearScreen
URL /rest1_0/appl/ui/{area}/{screen}
Method DELETE
Parameters Template parameters:
area May be one of the following:• USER User area• TASK Task area• WORK Work area• FKEY Function key area
screen The screen number from 1 to 30.
Response status
Action Clears the screen. All screen definitions are deleted. If this screen is currently activated the area is blank.
Example:
http://172.16.253.157/rest1_0/DELETE/appl/ui/work/2
Cubis MSA Web Services 13
![Page 14: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/14.jpg)
Command Reference
5.3.8 setTextLine
CMD setTextLine
URL /rest1_0/appl/ui/{area}/{screen}/text/{line}
Method PUT
Parameters Template parameters:
area May be one of the following:• USER User area• TASK Task area• WORK Work area
screen The screen number from 1 to 30.
line The line number from 1 to 15.
Request parameters:
text Required. Text to be displayed
Response status
Action Sets a line of text to be displayed on the given screen line. Beware! If the screen number is used before with a screen type different from text the request will returnan error. The screen must be cleared before to avoid such a problem.
5.3.9 setMenuLine
CMD setMenuLine
URL /rest1_0/appl/ui/{area}/{screen}/menu/{line}
Method PUT
Parameters Template parameters:
area May be one of the following:• work Work area
screen The screen number from 1 to 30.
line The line number from 1 to 15.
Request parameters:
label Required. Text to be displayed on menu button
isEnabled Defines if the menu button is active or displayed as inactive. One of:• true (default)• false
Response status
Action Sets a menu line to be displayed on the given screen line. Beware! If the screen number is used before with a screen type different from menu the request will return an error. The screen must be cleared before to avoid such a problem.
Cubis MSA Web Services 14
![Page 15: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/15.jpg)
Command Reference
5.3.10 setParamLine
CMD setParamLine
URL /rest1_0/appl/ui/{area}/{screen}/param/{line}
Method PUT
Parameters Template parameters:
area May be one of the following:• work Work area
screen The screen number from 1 to 30.
line The line number from 1 to 15.
Request parameters:
id Required. The name of the parameter.
Response status
Action Sets a parameter to be displayed on the given screen line. Beware! This parameter has to be created before with command createParam.
Example:
http://172.16.253.157/rest1_0/PUT/appl/ui/WORK/3/PARAM/1?id=ABCDEF
5.3.11 getModuleList
CMD getModuleList
URL /rest1_0/appl/par
Method GET
Parameters Template parameters:
none
Request parameters:
none
Response resp_getModuleList
Action Returns a list all application modules. Currently activated modules have attribute isActive=true.
Cubis MSA Web Services 15
![Page 16: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/16.jpg)
Command Reference
5.3.12 GetParamList
CMD getParamList
URL /rest1_0/appl/par/{module}
Method GET
Parameters Template parameters:
module Identifies the application module. The valid module names may be requested with the getModuleList command.
Request parameters:
none
Response resp_getParamList
Action Returns a list of currently available parameters in the addressed application module. Beware! The addressed application module must be activated.
5.3.13 getParam
CMD getParam
URL /rest1_0/appl/par/{module}/{id}
Method GET
Parameters Template parameters:
module Identifies the application module the parameter belongs to. The valid module names may be requested with the getModuleList command.
id The name of the parameter. The valid names may be requested with thegetParamList command.
Request parameters:
verbose Defines the amount of parameter attributes that will be returned in theresponse:
• normal (default) Standard output• full All published attributes• debug All available attributes including
internal attributes
options Shows all possible values of select parameter:• true shows selected and all possible values• false (default) show only selected value
Response resp_getParam
Action Returns the value of the addressed parameter a various number of attributes (depending on the values of verbose and options). Beware! The addressed application module must be activated.
Cubis MSA Web Services 16
![Page 17: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/17.jpg)
Command Reference
5.3.14 createParam
CMD createParam
URL /rest1_0/appl/par/EXT/{id}
Method PUT
Parameters Request parameters:
id The name of the parameter referenced by this line (up to 20 char long).The default name is WORK_x, where x is an internal index.
type Required. Type of the parameter. This is one of:• STRING Text parameter• NUMBER Number parameter
wizard Required. Text (up to 50 chars) to be displayed as a header line during parameter input. Defaults to the name of the parameter.
title Required. Text (up to 20 chars) to be displayed as description at start ofline.
header Required. Text (up to 6 chars) to be displayed as short description just before the parameter.
value Required. Value of the parameter. Format must match the type of the parameter.
lengthmax Required for STRING. Maximal length of STRING parameter.
charmode Required for STRING. Input mode for STRING parameter. Can be one of the following:
• ALL All characters allowed• PASSWORD Text is not displayed but displayed
asterisk ('****').• FORMULA Input wizard for formulas• FILENAME Restricts string to upper case• AUTOCHAR Automatic switching of upper and
lower case
decpoint Required for NUMBER. Number of decimal digits for NUMBER parameter.
step Optional for NUMBER. The step index determines the step of the last digit of a measure parameter:
• 0: 1 (default)• 1: 2-fold • 2: 5-fold • 3: 10-fold • 4: 20-fold • 5: 50-fold • 6: 100-fold ...
Cubis MSA Web Services 17
![Page 18: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/18.jpg)
Command Reference
omitsign Optional for NUMBER. Determines if the sign of a MEASURE parameter is displayed:
• true: no sign displayed• false(default): the sign is displayed
unit Optional for NUMBER. Physical unit for measure parameter. One of the following:
• GRAMS• MICROGRAMS • MILLIGRAMS • KILOGRAMS• TONNE• POUND• LITER• SECOND• PIECES• OUNCES• PERCENT• CARAT• TROYOUNCES• TAEL_HONGKONG• TAEL_SINGAPUR• TAEL_TAIWAN• GRAIN• PENNYWEIGHT• PARTS_PER_POUND• TAEL_CHINA• MOMME• KARAT• TOLA• BAHT• MESGHAL• POUND_OUNCES• NEWTON• FREE_1• FREE_2• FREE_3• FREE_4• FREE_5• FREE_6• UNIVERSAL
You can get units, enabled in this balance, with commandGET/appl/par/WEIGH/BASIS_UNIT?options=true
Response status
Action Sets a parameter to be displayed on the given screen line. Beware! If the screen number is used before with a screen type different from param the request will return an error. The screen must be cleared before to avoid such a problem.
Cubis MSA Web Services 18
![Page 19: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/19.jpg)
Command Reference
Examples:
The following example defines a parameter line with an editable NUMBER parameter with 2 decimal digits
http://172.16.253.157/rest1_0/PUT/appl/par/EXT/NUM1?type=NUMBER&wizard=I%20am%20a%20number&title=MyNum&header=par1&value=1234.5678&decpoint=2
This example displays an editable number of type NUMBER with the unit CARAT and a resolution of 3 decimal digits that is displayed without sign:
http://172.16.253.157/rest1_0/PUT/appl/par/EXT/MES?type=NUMBER&wizard=Edit%20number&title=Measure&header=par2&value=1234.5678&decpoint=3&unit=CARAT&step=10&omitsign=true
The following example defines a parameter line with an editable STRING parameter
http://172.16.253.157/rest1_0/PUT/appl/par/EXT/ABCDEF?type=STRING&wizard=Edit&title=Str12&header=str22&value=Hallo world
5.3.15 setParam
CMD setParam
URL /rest1_0/appl/par/EXT/{id}
Method PUT
Parameters Template parameters:
id The name of the parameter. This parameter must be created before with createParam.
Request parameters:
value Required. Value of the parameter. Format must match the type of the parameter.
Response status
Action Changes value of the addressed parameter. Beware! This parameter has to be created before with command createParam.
Example:
http://172.16.253.157/rest1_0/PUT/appl/par/EXT/ABCDEF?value=New Text
Cubis MSA Web Services 19
![Page 20: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/20.jpg)
Command Reference
5.3.16 getMultiParam
CMD getMultiParam
URL /rest1_0/appl/multi
Method GET
Parameters Template parameters:
none
Request parameters:
urls Defines the list of parameters that will be returned in the response. Use character “;” as separator between parameters. Parameters shall be defined in format: appl/par/{Module}/{id}
Response resp_multi
Action Returns the values of the addressed parameters. Beware! The addressed application modules must be activated.
Example:
GET http://172.16.253.157/rest1_0/appl/multi?urls=appl/par/WEIGH/WGT_GROSS;appl/par/WEIGH/WGT_NET;appl/par/WEIGH/WGT_TARE;appl/par/WEIGH/WGT_TARE1;appl/par/WEIGH/WGT_TARE2;appl/par/COUNT/NREF;appl/par/COUNT/WREF
Answer:
<?xml-stylesheet version="1.0" encoding="UTF-8" type="text/xsl" href="/dir/opt/xml/cubisrest.xsl"?><response status="200" msg="OK" httpmethod="GET"url_head="/appl/multi?urls=appl/par/WEIGH/WGT_GROSS;appl/par/WEIGH/WGT_NET;appl/par/WEIGH/WGT_TARE;appl/par/WEIGH/WGT_TARE1;appl/par/WEIGH/WGT_TARE2;appl/par/COUNT/NREF;appl/par/COUNT/WREF"><paramlist msg="Module not active"><param moduleid="WEIGH" paramid="WGT_GROSS" url="/rest1_0/appl/par/WEIGH/WGT_GROSS"type="MEASURE" value="-0.02" unit="g" decp="2" stable="true"/><param moduleid="WEIGH" paramid="WGT_NET" url="/rest1_0/appl/par/WEIGH/WGT_NET" type="MEASURE" value="-0.02" unit="g" decp="2" stable="true"/><param moduleid="WEIGH" paramid="WGT_TARE" url="/rest1_0/appl/par/WEIGH/WGT_TARE" type="MEASURE" value="0.00" unit="g" decp="2" stable="true"/><param moduleid="WEIGH" paramid="WGT_TARE1" url="/rest1_0/appl/par/WEIGH/WGT_TARE1"type="MEASURE" value="0.00" unit="g" decp="2" stable="true"/><param moduleid="WEIGH" paramid="WGT_TARE2" url="/rest1_0/appl/par/WEIGH/WGT_TARE2"type="MEASURE" value="0.00" unit="g" decp="2" stable="true"/></paramlist></response>
Cubis MSA Web Services 20
![Page 21: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/21.jpg)
Command Reference
5.3.17 getApplState
CMD getApplState
URL /rest1_0/appl/state
Method GET
Parameters Template parameters:
none
Request parameters:
none
Response resp_getApplState
Action Returns all active application modules with their active and inactive states.
5.3.18 getApplStateCmd
CMD getApplStateCmd
URL /rest1_0/appl/state/{module}/{state}
Method GET
Parameters Template parameters:
module Identifies the application module. The valid module names may be requested with the getModuleList command.
state Identifies the state of the module. The valid state names may be requested with the getApplState command.
Request parameters:
none
Response resp_getApplStateCmd
Action Returns commands of the state in the module.
5.3.19 getModuleState
CMD getModuleState
URL /rest1_0/appl/state/{module}
Method GET
Parameters Template parameters:
module Identifies the application module. The valid module names may be requested with the getModuleList command.
Request parameters:
none
Response resp_getModuleState
Action Returns the state of the addressed application module. Beware! The addressed application module must be activated.
Cubis MSA Web Services 21
![Page 22: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/22.jpg)
Command Reference
5.3.20 getCmdList
CMD getCmdList
URL /rest1_0/appl/cmd/{module}
Method GET
Parameters Template parameters:
module Identifies the application module. The valid module names may be requested with the getModuleList command.
Request parameters:
none
Response resp_getCmdList
Action Returns the list of available commands of an application module. Beware! The addressed application module must be activated.
5.3.21 setModuleCmd
CMD setModuleCmd
URL /rest1_0/appl/cmd/{module}/{command}
Method PUT
Parameters Template parameters:
module Identifies the application module. The valid module names may be requested with the getModuleList command.
command Command to be executed.
Request parameters:
none
Response status
Action Executes the addressed module command. Beware! The addressed application module must be activated and the command must exist.
Cubis MSA Web Services 22
![Page 23: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/23.jpg)
Command Reference
5.3.22 getEvents
CMD getEvents
URL /rest1_0/appl/event
Method GET
Parameters Template parameters:
none
Request parameters:
remove Flag, if event table in the balance shall be deleted after this request:• yes (default) event table will be deleted• no do not delete event table
Response resp_getParam
Action Return the list of events for own defined softkeys, menus and parameters: • softkey was pressed• menu item was selected• parameter value was changed by use
Cubis MSA Web Services 23
![Page 24: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/24.jpg)
Command Reference
5.3.23 getPortList
CMD getPortList
URL /rest1_0/appl/port
Method GET
Parameters Template parameters:
none
Request parameters:
none
Response resp_ApplPortList
Action Return the list of available ports:• INTERN• SLOT
5.3.24 getPort
CMD getPort
URL /rest1_0/appl/port/{port_id}
Method GET
Parameters Template parameters:
port_id Identifies the port. One of • INTERN• SLOT
Request parameters:
none
Response resp_getPort
Action Return the current state of the addressed digital I/O port. The value is a string of five characters '0' or '1'
5.3.25 setPort
CMD setPort
URL /rest1_0/appl/port/{port_id}
Method PUT
Parameters Template parameters:
port_id Identifies the port. One of • INTERN• SLOT
Request parameters:
out The ouput pattern to be set. This must be a five character string where every character can be '0' or '1'.
• 1. Pin 15 - Universal In • 2. Pin 16 - Minor • 3. Pin 17 - Pares • 4. Pin 18 - Major
Cubis MSA Web Services 24
![Page 25: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/25.jpg)
Command Reference
• 5. Pin 19 – Set
If one or more pins are set to function as input ports the corresponding bit character has no function.
dir The direction pattern to be set. This must be a five character string where every character can be 'I' for input or 'O' for output.
• 1. Pin 15 - Universal In • 2. Pin 16 - Minor • 3. Pin 17 - Pares • 4. Pin 18 - Major • 5. Pin 19 - Set
Every pin can be used as input or output - even the 'Universal In' port.Be aware that changing the port direction may disturb the functionality of the internal output pin control of the scale (e.g. in checkweighing tasks)!
Response status
Action Set output and direction pattern.
Cubis MSA Web Services 25
![Page 26: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/26.jpg)
Command Reference
5.4 WeighingPoint Service
5.4.1 getWptList
CMD getWptList
URL /rest1_0/wpt
Method GET
Parameters Template parameters:
none
Request parameters:
none
Response resp_getWptList
Action Returns the list of available weighing points.
5.4.2 GetWptData
CMD getWptData
URL /rest1_0/wpt/{weighingpoint}
Method GET
Parameters Template parameters:
weighingpoint Identifies the weighing point (weight sensor):• A• B• C• D
The weighing points currently available can be requested with the getWptList command.
Request parameters:
none
Response resp_getWptData
Action Returns the metrological data of the addressed weighing point.
Cubis MSA Web Services 26
![Page 27: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/27.jpg)
Command Reference
5.4.3 SetWptActive
CMD setWptActive
URL /rest1_0/wpt/{weighingpoint}
Method PUT
Parameters Template parameters:
weighingpoint Identifies the weighing point (weight sensor):• A• B• C• D
The weighing points currently available can be requested with the getWptList command.
Request parameters:
none
Response status
Action Activates the addressed weighing point to be displayed in the main weighing display.Currently only one weighing point is available.
5.4.4 getWeight
CMD getWeight
URL /rest1_0/wpt/{weighingpoint}/{weighttype}
Method GET
Parameters Template parameters:
weighingpoint Identifies the weighing point (weight sensor):• A• B• C• D
The weighing points currently available can be requested with the getWptList command.
weighttype The weight type that is to be read:• net Net value• gross Gross value• tare Tare value• tare1 Applicative tare value 1• tare2 Applicative tare value 2
Request parameters:
none
Response resp_getWeight
Action Returns the addressed weight value.
Example:
GET http://172.16.253.157/rest1_0/wpt/A/netThis will return the current weight value:
Cubis MSA Web Services 27
![Page 28: Cubis MSA Web Services - Pipette Cubis Balance...RESTful Web Services 3.1 Tools for RESTful Web Services There are some useful tools for the test of web services. You may use these](https://reader030.fdocuments.net/reader030/viewer/2022040615/5f0d563d7e708231d439d8f9/html5/thumbnails/28.jpg)
Command Reference
<?xml-stylesheet version="1.0" encoding="UTF-8" type="text/xsl" href="/dir/opt/xml/cubisrest.xsl"?><resp_getWeight status="200" msg="WptGet( ):" httpmethod="GET" url_head="/wpt/A/net"><weight decimal="2" quality="verified" range="1" stable="stable" type="N=G" udecimal="0" stepidx="0" unit="g" value="0.00 g" result="N=G 0.00 g" url="/rest1_0/wpt/A/net"/></resp_getWeight>
Cubis MSA Web Services 28