Applies To:
  • CitectSCADA 1.00 1.01 1.10 1.11 1.20 2.00 2.01 3.00 4.00

Summary:
What format do I use to pass multiple parameters (which includes strings and integers) to the MsgRPC() function. 

Solution:
The format for the MsgRPC function is:

MsgRPC(hMsg, Name, Arg, Mode);

and the arguments to pass to the function must be separated by commas. To pass strings the string arguments must be enclosed in quotes ("") and use the string escape character (^) around strings enclosed within a string. If you do not enclose the string in quotes, then the string is only the first tag found.

E.g. Passing an integer, a string then an integer again

/* Passes 3 arguments to a remote function called test */
FUNCTION(INT n1, STRING s1, INT n2)
   INT hMsg;
   hMsg=MsgOpen("IOServer",0,0);
   MsgRPC(hMsg, "Test", IntToStr(n1)+",^""+s1+"^","+IntToStr(n2),1);
END

The arguments could be

n1=10
s1=hello there
n2=20

 

Keywords:
 

Attachments