RMPSendMessage (FB)ΒΆ
FUNCTION_BLOCK FINAL RMPSendMessage EXTENDS CBML.ETrig
Function block that can be used to send a message from a module to another module. Use this function block for sending messages. If sending succeded xDone gets TRUE. If an error occurs during sending (i.e. receiving could not be assured) xError gets TRUE. Reset xExecute to FALSE before reusage of the function block by setting xExecute to TRUE.
A possible call semantic could be:
- RMPSendMessage(xExecute := TRUE, itfRmp := pEnv^.rmps,
udiReceiverID := udiProxyCom, uiSenderModuleID:= UDINT_TO_UINT(ComAddress AND 16#FFFF), tValidity:=T#1S, mdData := mdData );
This function block needs to be called until xDone is TRUE. If so, sending was successfull.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xExecuteBOOLRising edge: Starts defined operationFALSE: Resets the defined operation after ready condition was reachedETrig
Output
xDoneBOOLTRUE: Ready condition reachedETrig
xBusyBOOLTRUE: Operation is runningETrig
xErrorBOOLTRUE: Error condition reachedETrig
Inout
mdDataARRAY [0..63] OF BYTE
The data to send
Input
itfRmpThe RMP (Reliable Message Protocoll) sevrice to use for sending. This service can be aquired via the environment available in any module via IModule (see example of the function block description).
udiReceiverIDUDINT32-Bit-ID of receiver. This ID normaly is received, when receiving a message from a proxy (via Receive of IRMPService in an RMP (Reliable Message Protocoll) service
uiSenderModuleIDUINTThe (local) 16 bit address of the receiver, which equals the first 16bit of the ComAddress (see AND 16#FFFF)
tValidityTIMETIME#1s0ms
The time this message is valid when sending it
Output
uiErrorUINTIf an error occured, the number accounts for one of the following errors: 1: send buffer full; 2: message cannot be transmitted before tValidity (connection broken or remote receive buffer full) 3: receiver application not connected to this app
Methods:
Structure: