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 operation
FALSE: Resets the defined operation after ready condition was reached

ETrig

Output

xDone

BOOL

TRUE: Ready condition reached

ETrig

xBusy

BOOL

TRUE: Operation is running

ETrig

xError

BOOL

TRUE: Error condition reached

ETrig

Input

sApiKey

API_KEY

Output

eError

ERROR

sConstructedUrl

URL

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: