APICaller (FB)¶
FUNCTION_BLOCK ABSTRACT APICaller EXTENDS CBML.ETrig
FB to encapsulate common behaviour regarding the API Calling. This contains: WebClient setup, WebClient calling, JSON result processing setup, actual JSON result processing and the coordination of those steps. Offers abstract methods to override for specialized behaviour, such as constructing a specific URL to call and the specific processing of the use case dependend received JSON data. — When adding support of more services, provided by the API, this should be the base for the specialized, service depended Function Block.
- InOut:
Scope
Name
Type
Comment
Inherited from
Input
xExecute
BOOL
Rising edge: Starts defined operationFALSE
: Resets the defined operation after ready condition was reachedETrig
Output
xDone
BOOL
TRUE
: Ready condition reachedETrig
xBusy
BOOL
TRUE
: Operation is runningETrig
xError
BOOL
TRUE
: Error condition reachedETrig
Input
sApiKey
Output
eError
sConstructedUrl
Contains the internally constructed URL, that is used to retrieve data from the API Server.
xUrlConstructed
BOOL
Is TRUE, when the content of sConstructedUrl is valid (after the internal URL Construction is finished).
Methods:
Structure: