You are on page 1of 3

Basic Instructions for P a g e | 1

PSCAD-MATLAB interfacing
IwouldliketoreferyoutoPSCADUsersGuideorPSCADOnlinehelp,whichcanbeaccessedby
pressingF1inthePSCADworkspace.UnderContents\PSCADManual\MATLAB

/Simulink

,youcan
findtheinstructionsforusingtheMatlabinterfacefunction.

Beforefurtherdescriptions,pleaseverifywhetherthefollowingrequisitesaremetonyourmachine:
1 MATLABhastobeinstalledpriortoPSCAD.YoumayneedtoreinstallPSCADtomakeit
recognizethelinksanddependenciestoMATLAB,itslibrariesandpaths.
2 TheMATLABinterfacefeatureisnotsupportedbytheGNUFortrancompiler,whichisprovided
withyourPSCADpackage.IrecommendthatyouinstallCompaqVisualFortran6.0orhigher,or
IntelFortranCompiler.
3 PleasenoticethattheuserhastocreateauserdefinedcomponenttousetheMATLABinterface
feature;i.e.youwillnotfindaMATLABInterfacecomponentintheMasterLibraryinPSCAD.
4 CreatingnewcomponentsrequiresanEducationaloraProfessionallicense.

BeforestartingtorunaMATLABinterfacesimulation,youshoulddirectPSCADtoMATLABsshared
libraryfolder.ThesharedlibrariesofMATLABR200Xarelocatedat:
%MatlabRoot%\extern\lib\win32\microsoft

InordertospecifythispathforPSCAD,selectVersion5underWorkspaceSettings|MATLAB|Installed
Version.Thenenterthecompletepathofthesharedlibraries(e.g.C:\Program
files\Matlab\R2008a\extern\lib\win32\microsoft)underLibraryPath.

Also,ifyouarecreatinganewmodel,whichusestheMATLABinterfacefunction,youhavetolinkyour
modeltotheinstalledMATLABlibrariesbyactivatingthecorrespondingcheckboxonProjectSettings|
Link:
Basic Instructions for P a g e | 2
PSCAD-MATLAB interfacing

Thishasalreadybeenactivatedintheexamplesin%PSCADfolder%\examples\matlab.

Afewexamplesareprovidedin%PSCADFOLDER%\examples\matlab.Ineachofthosecases,locatea
blockspecifiedasNewMatlabInterface.ByrightclickingonthecomponentandselectingtheEdit
Definitionoption(asshownbelow),youwillbeabletoexplorethewaytheinterfacehasbeen
designedineachparticularexample.

Basic Instructions for P a g e | 3


PSCAD-MATLAB interfacing
YouwillseethePSCADScriptcodeofeachblockontheScriptpaneofthecomponentdefinition
window:

ThekeysubroutineforusingtheMATLABinterfacefeatureisMLAB_INT(seePSCAD/EMTDCUsers
Guide).Also,properuseofSTORFandSTORIisrequiredforexchangingvariablesbetweenEMTDCand
theMATLABworkspace.

IpersonallyfoundtheusersguideandtheprovidedexamplesveryhelpfulwhenIwastryingtocreate
myfirstMATLABInterfacecase.So,pleasefirsttrytheinstructionsandexamples.Irecommendthatyou
explorethecorrespondingscriptcodeblocksinthegivenexamples.Ifyoustillencounterambiguities,
wewillbegladtoassistyou.

You might also like