This library contains the SPLAY Function Block for API integration with Beckhoff modules. For additional support, see the Official SPLAY API Documentation.
- Open the "References" folder in TwinCAT
- Navigate to "Library repository"
- Click "Install..." and select the SPLAY_API.compiled-library
[ ! ] Make sure to restart TwinCAT after installing the library file on your local machine.
The SPLAY Function Block additionally requires two dependency libraries to be installed.
- Tc3_JsonXml provides the JsonDomParser function block
- Tc3_IotBase provides the IotHttpClient function block
Detailed examples using the SPLAY Function Block can be found in the MAIN POU of the Examples project. Only a general description will be provided here.
Inputs | |
---|---|
'fbJson' | The JsonDomParser function block |
'fbHttpClient' | The IotHttpClient function block |
Outputs | |
---|---|
'jsonRX' | An sJsonValue holding the request return (which can also be accessed from fbJson) |
PROGRAM MAIN
VAR
fbJson : FB_JsonDomParser;
fbHttpClient : FB_IotHttpClient:=(
sHostName:='10.10.3.102',
nHostPort:=80,
bKeepAlive:=TRUE,
tConnectionTimeout:=T#10S,
stTLS:=(
bNoServerCertCheck:=FALSE
)
);
SPLAY : FB_SPLAY:=(
fbJson:=fbJson,
fbHttpClient:=fbHttpClient
);
nState : INT:=1;
sReceived : STRING(300);
END_VAR
CASE nState OF
1:
// Example 'GET_INFO' command usage
SPLAY.GET_INFO();
fbJson.CopyDocument(sReceived, SIZEOF(sReceived));
ADSLOGSTR(
msgCtrlMask:=ADSLOG_MSGTYPE_STRING,
msgFmtStr:='%s',
strArg:=sReceived
);
nState:=2;
END_CASE
-
Latest version v1.0.0.1.
-
Input buffers are currently limited to 3kB of memory.
-
Currently, support has not been implemented for the following functions:
-
GET_PLAYLIST_INTENSITY
-
SET_TRACK_INTENSITY
-
GET_TRACK_INTENSITY
-
UPDATE_STORAGE_PATH
-
UPDATE_SCHEDULE
-
DELETE_SCHEDULE
-
ENABLE_SCHEDULE
-
SET TIME
-
REFRESH_SETTING
-