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 - xExecute- BOOLRising 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 - Inout - mdData- ARRAY [0..63] OF BYTE - The data to send - Input - itfRmp- The 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). - udiReceiverID- UDINT- 32-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 - uiSenderModuleID- UINT- The (local) 16 bit address of the receiver, which equals the first 16bit of the ComAddress (see AND 16#FFFF) - tValidity- TIME- TIME#1s0ms - The time this message is valid when sending it - Output - uiError- UINT- If 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: