Cicode Programming Reference > Cicode Function Categories > Task Functions Introduction > MsgWrite


Writes a message to a message session. The message is sent to the remote computer's callback function and can be read by calling MsgRead(). If the remote computer has not opened the session, this message is disregarded.

This function returns immediately after passing the message to CitectSCADA. CitectSCADA sends the message over the LAN in the background.

you need to first open the message session using the MsgOpen() function, to obtain the message handle.


MsgWrite(hMsg, Type, Str)


The message handle, returned from the MsgOpen() function. The message handle identifies the table where all data on the associated message is stored.


The integer message data, that is the message number.


The message text.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

MsgRead, MsgOpen



See Also

Task Functions