Programming interface
3.5 Code examples
SIMATIC RTLS4083T
Operating Instructions, 12/2019, C79000-G8976-C527-02
21
3.5
Code examples
Code example WAMP connection
{
"wamp": {
"url": "ws://127.0.0.1:12344/",
"realm": "agilion.wls",
"user": "Administrator",
"key": "Agilion2011"
}
}
Code example WAMP connection with RPC call
console.log("start")
var config = null
function changetheme(session, addr, themeid, param){
console.log("change zone for etag (zoneid,etag)",themeid,addr)
var epapercmd = [parseInt(addr,10),parseInt(themeid,10),param]
if ( config.debug ) console.log("send epapercmd: ",epapercmd)
session.call("agilion.wls.epaper.set_display_theme", epapercmd).then(
function (res) {
if ( config.debug ) console.log("epaperapi response:", res);
/*
Code Bedeutung
* 0x0000 No error
* 0x0011 TransponderID invalid
* 0x0012 ThemeID invalid
* 0x0013 FieldID invalid
* 0x0101 Text length invalid
* 0x0102 Text contains invalid characters or characters not supported
*/
}
);
}