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

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.

Syntax

MsgWrite(hMsg, Type, Str)

hMsg:

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

Type:

The integer message data, that is the message number.

Str:

The message text.

Return Value

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

Related Functions

MsgRead, MsgOpen

Example

MsgWrite(hMsg,10,"MyMsg");

See Also

Task Functions