Clickmsggetrxsnapshot – Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual
Page 169
168
APPENDIX • CLICK 500 DEVELOPER GUIDE
ClickMsgGetRxSnapshot
Provides a way to copy data from the safe message buffer into a snapshot buffer, and also
provides access to the snapshot buffer. The safe message buffer holds messages that match
the format specification of an active receive task.
˽
LIBRARY – click500message.lib
˽
SYNTAX –
unsigned int ClickMsgGetRxSnapshot(int virt, unsigned char** ptr,
int makeSnapshot)
˽
PARAMETER1 – The virtual port to read from (V1, V2, V3, V4).
˽
PARAMETER2 – A pointer to a pointer to the beginning of the buffer containing the
current snapshot.
˽
PARAMETER3 – If this flag is set to TRUE, data in the safe message buffer will be cop-
ied into the snapshot buffer. Otherwise if set to FALSE, this function will not copy any
data from the safe message buffer but simply provides access to data already residing
in the snapshot buffer.
˽
RETURN VALUE – The number of bytes in the buffer.
˽
EXAMPLE –
unsigned char *pMsg;
unsigned int len;
unsigned char byteTen;
len = ClickMsgGetRxSnapshot(V1, &pMsg, 1);
if (len >=10)
{
byteTen = *(pMsg+9);
}
˽
SEE ALSO – ClickMsgAddReceiveTaskToVPort, ClickMsgCreate, ClickMsgReadVar