GCLIB_DLL_EXPORTED GReturn GCALL GMessage | ( | GCon | g, |
GCStringOut | buffer, | ||
GSize | buffer_len | ||
) |
Provides access to unsolicited messages from the controller.
To use this function, -s MG
must be used in the GOpen() address
string to subscribe to messages. Unsolicited bytes must be flagged by the high-bit setting, CW 1
. The driver will automatically set this when subscribing to messages. The user should not overwrite this setting.
Unsolicited messages are data generated by the controller that are not in response to a command, a data record, or an interrupt. Examples follow.
MG
command from embedded code. MG
sent from the host is solicited.TP
, RP
, var=?
?55 i=var
GMessage()
, they will all be placed in the buffer, separated by newline characters.g | Connection's handle. |
buffer | The buffer to write the message data. The buffer will be null terminated. |
buffer_len | The length of the user's buffer. |
GMessage() will block until a message is received, or the function times out.
$00-$07
and $10-$17
. These bytes may be routed to a third party device such as am HMI or display panel. See MG and CF.See x_gmessage.cpp for an example. See x_nonblocking.cpp for an example of non-blocking usage.