Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

MsgRead

  • Last UpdatedJul 18, 2023
  • 1 minute read

Reads a message from a message session. You can call this function only in a message post function (the callback function specified in the MsgOpen() function), to read the current message.

The nType and Str variables of this function return the message number and the text of the message. The return value of this function is the message handle (allowing a response to be sent back if required).

you need to open the message session using the MsgOpen() function, to enable the callback function.

Syntax

MsgRead(Type, Str)

nType:

The message number. Must be a Long type variable.

Str:

The message text. Must be a String type variable.

Return Value

The message handle of the message being read.

MsgOpen, MsgClose, MsgWrite, MsgRPC

Example

/* This function will read a message from the session and if

Type=1, will display the string as a prompt. If Type=2 then the
speaker beeps and an acknowledgment is sent back to the caller. */

INT

FUNCTION

MsgPostClient()

INT Type;

STRING Str;

INT hMsg;

hMsg=MsgRead(Type,Str);

IF Type=1 THEN

Prompt("Message"+Str);

ELSE

IF Type=2 THEN

Beep();

MsgWrite(hMsg,2,"DONE");

END

END

END

See Also

Task Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in