GetMessage (FB)¶
FUNCTION_BLOCK GetMessage EXTENDS CBM.ETrigTo
Reads a C2D message from the Microsoft AZURE IoT Hub via HTTPS.
- InOut:
Scope
Name
Type
Comment
Inherited from
Input
xExecute
BOOL
Rising edge: Action startsFalling edge: Resets outputsIf a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone
,xError
) are present at the outputs for exactly one cycle.ETrigTo
udiTimeOut
UDINT
Defines the time (µs) after which an FB (e.g. requiring an external acknowledgement) aborts operation due to a timeout with error message.
ETrigTo
Output
xDone
BOOL
TRUE
: Action successfully completedETrigTo
xBusy
BOOL
TRUE
: Function block activeETrigTo
xError
BOOL
TRUE
: Error occurred, function block aborts actionFALSE
: No errorETrigTo
Input
sHubDomainName
STRING(255)
Domain name of the IoT Hub
sDeviceId
STRING(255)
Device ID
wsSaS
WSTRING(255)
Shared Access Signature (SAS Token)
Output
eError
Error code
xReceived
BOOL
TRUE if a message has been received
iHttpStatus
INT
HTTP status
wsData
WSTRING(WEB_CLIENT.g_udiMaxResponseSize)
The last received message
wsHeader
WSTRING(WEB_CLIENT.g_udiMaxHeaderSize)
The http header of the last message