Messenger Library Messages

From LabVIEW Wiki
Jump to: navigation, search

Messages in Messenger Library generally contain up to three things:

  • A "Label" that is a short text string that identifies the message. Examples: "Latest Temperature", "Start Measurement", "Shutdown".
  • Data of some type. There is more that one type of data message, but most messages hold data in a Variant.
  • (Optional) A "Reply Address", which is the address where a reply to this message should be sent.

Messages have Write and "Read" (aka Extract) methods to add and access Label and Data. There is also a Reply method for the message handler to send a reply to the Reply Address.

Note on Error Messages: an "Error Message" is a special subtype of Message who's Data is an Error Cluster. On any "Read" of an Error Message, the contained Error Cluster will be output on the Error out terminal of the Read method. This connects Error Messages to the stadard LabVIEW error-handling design of the passed Error Cluster. Similarly, as responsibility for directing a reply belongs to the sender of the original message, if there is an error input on the "error in" terminal of any "Reply" method, then an error message will be sent (instead of the regular reply). This design effectively allows simple error handling Request-Reply messaging interactions, with the Requestor receiving the error cluster.

See also Messenger Library and Addresses.