
The output of the RTDS simulation is captured by the two commands at line number 31 and 32 f. The for loop, the lines between 17 and 58, send out 100 values with an interval of 0.2 seconds. The second and third parameters of this function call are the IP address and port number of the TCP server, which is RSCAD/Runtime in this demonstration is used under the assumption that the same computer which runs RSCAD/Runtime also runs this MATLAB M file. The line number 12 tries to connect to the RSCAD/Runtime with connection request. The regular expression is utilized as a rigorous measure in order to make sure the transmission is complete and the token string is ready to be parsed at the client c. This port number should match the port number given in the RSCAD/Runtime script file b. The command at line number 8 declares a variable with port number. 7Ĩ Built the connection with a MATLAB M file Open the related M file in MATLAB Pay attention: a. As explained in the introductory section, once this command is executed, the port is open and the RSCAD/Runtime becomes a TCP server. Regarding the port number, note that many standard or well-established network applications have already reserved many port numbers, which are known as Well-Known Port Numbers ( andregi-2.htm). It is the ListenOnPort() command with the port number passed as a parameter.


6ħ Built the connection with a MATLAB M file RSCAD Runtime script The most important command in this script file is at the line number 6. The second meter ( ElapseTime ) displays the time between each change made to the VAL slider.

6 Built the connection with a MATLAB M file RSCAD Runtime The VAL slider would be used as input to the simulation case The external application which connects to the RSCAD/Runtime would control the slider The external application would use the meter value as input.
