The PLC communications object implements message handling between PLC objects.
The following functions are available to send and receive messages.
void SNDMSG(char *destination, char *string);
void SNDDAT(char *destination, void *buffer, unsigned int size);
int RCVMSG(char source[], char buffer[]);
int RCVDAT(char source[], void *buffer, unsigned int size);
Each communications networks is defined by a single object that handles all messages between PLC objects linked to it. The network has the following properties
latency defines the message delivery latency (note this is a functional distribution).reliability to define the probability with which a message is delivered at all, andbitrate to define the data rate at which messages are delivered (longer messages take longer to be delivered if bitrate is non-zero),
Functions | |
| comm::comm (MODULE *mod) | |
| Register the new object class and construct the default object properties. | |
| int | comm::create () |
| Create a new object. | |
| int | comm::init (OBJECT *parent) |
| Initialize the new object. | |
| TIMESTAMP | comm::sync (TIMESTAMP t0) |
| Synchronize the object. | |
Variables | |
| static comm * | comm::defaults = NULL |
| a pointer to the default values for new objects | |
| static CLASS * | comm::oclass = NULL |
| a pointer to the registered object class definition | |