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),
Classes | |
| class | comm |
| class | Message |
| class | Queue |
Functions | |
| void | Queue::add (Message *msg) |
| comm::comm (MODULE *mod) | |
| Register the new object class and construct the default object properties. | |
| int | comm::create () |
| Create a new object. | |
| EXPORT int | create_comm (OBJECT **obj, OBJECT *parent) |
| Message * | Queue::drop (Message *msg, bool reverse=false) |
| int | comm::init (OBJECT *parent) |
| Initialize the new object. | |
| EXPORT int | init_comm (OBJECT *obj) |
| Message * | Queue::next (Message *msg) |
| TIMESTAMP | Queue::next_delivery_time (void) |
| Message * | Queue::peek (void) |
| Queue::Queue () | |
| static void | comm::route (comm *net, Message *msg) |
| TIMESTAMP | comm::sync (TIMESTAMP t0) |
| Synchronize the object. | |
| EXPORT TIMESTAMP | sync_comm (OBJECT *obj, TIMESTAMP t0) |
| Message * | Queue::take (Message *msg=NULL) |
| Queue::~Queue () | |
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 | |