Opc Da Com Guide
User Manual:
Open the PDF directly: View PDF .
Page Count: 172 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- 1 Introduction
- 2 Setting up a SimLink application
- 3 The SimLink GUI
- 4 The Access database
- 4.1 Tables
- 4.2 Standard database tables
- 4.2.1 The Config table. Standard keywords
- 4.2.2 The Config table. All OPC client links
- 4.2.3 The DataTypeInfo table
- 4.2.4 The Diagnostics table
- 4.2.5 The Diagnostics table. The DataTrace keyword.
- 4.2.6 The Diagnostics table. The GroupTrace keyword.
- 4.2.7 The KSIM_XREF table. Standard keywords
- 4.2.8 The KSIM_XREF table. Examples
- 4.2.9 The KSIM_XREF table. An example: Two data items
- 4.2.10 The SimLink_XREF table.
- 4.2.11 The SubServers table.
- 4.2.12 The UpdateRate table
- 4.2.13 The WatchdogItems table.
- 4.3 Configuring SimLink.NET to SimLink.NET
- 5 Softing and Matrikon OPC test tools
- 6 OPC DCOM configuration
- 7 Variable transfer between DCS and K-Spice
- 8 The Cross Reference List
- 9 Tips and troubleshooting
- 9.1 DOS commands
- 9.2 System Values.
- 9.3 Disable ExplicitReadAfterConnect
- 9.4 Changing Date and Time setting
- 9.5 Reconnect support
- 9.6 K-Spice PID Controller connection
- 9.7 PI Integration
- 9.8 Remotely Starting Controllers
- 9.9 Data organization on the OPC server
- 9.10 User accounts in Windows
- 9.11 SQL tips and tricks
- 9.12 Basic Terminology
- 9.13 FAQs
- 10 Switchover functionality
K-SpiceDCSLink:OpcDaCom
UserGuide
Release1
1/A
July2014©KongsbergOil&GasTechnologiesAS
Documenthistory
Document34148/H
Rev.AJune2014Createddocument.ArbortextversionofvariousWikipages.
Thereader
ThisuserguideisintendedasareferencemanualfortheK-Spice®user.Themanualisbasedonthe
assumptionthattheuserisfamiliarwithprocessmodelling,aswellasoilandgasproductionsystems.
Note
©2014KongsbergOil&GasTechnologiesAS.Allrightsreserved.Theinformationcontainedinthis
documentremainsthesolepropertyofKongsbergOil&GasT echnologiesAS.Nopartofthisdocument
maybecopiedorreproducedinanyformorbyanymeans.Theinformationcontainedwithinitisnottobe
communicatedtoathirdparty,withoutthepriorwrittenconsentofKongsbergOil&GasTechnologiesAS.
KongsbergOil&GasTechnologiesASendeavourstoensurethatallinformationinthisdocumentis
correctandfairlystated,butdoesnotacceptliabilityforanyerrorsoromissions.
Comments
Toassistusinmakingimprovementstotheproductandtothismanual,wewelcomecommentsand
constructivecriticism.
e-mail:kogt.documentation@kongsberg.com
FormoreinformationonK-Spice®,visitourwebsite:www.kongsberg.com/K-Spice
KongsbergOil&GasTechnologiesAS
www.kongsberg.com/kogt
UserGuide
Tableofcontents
1INTRODUCTION...............................................................7
1.1ControlsystemsandK-SpiceDCSlinks................................................................8
1.2Acronymsandconcepts........................................................................................10
1.3StructureofaDCScommunicationsystem..........................................................11
1.4DCSdriverfunctionality......................................................................................11
2SETTINGUPASIMLINKAPPLICATION..........................13
2.1ThecreationofaSimLinkapplication.................................................................13
2.2TheleHostnames.txt..........................................................................................15
2.3SimRemoteLauncher............................................................................................17
2.4CreatealinkapplicationintheK-Spiceproject...................................................18
2.5Creationofanewdatabase...................................................................................25
2.6Thecommandlineoption—database...................................................................28
3THESIMLINKGUI..........................................................29
3.1BrowseOPCServers............................................................................................31
3.2SyntaxinSimLinklogles..................................................................................34
3.3UsingExcelconditionalformattingonSimLinklogles..................................35
3.4WatchanitemintheSimLinkGUI......................................................................39
3.5Tagconnectionerrors...........................................................................................41
3.6Tagconnectionsuccess.........................................................................................42
3.7Theksimendoftheconnectionhasfailed...........................................................44
3.8Missingnode........................................................................................................45
3.9DcsError...............................................................................................................46
3.10CoCreateInstanceEx.............................................................................................47
4THEACCESSDATABASE.................................................48
4.1Tables....................................................................................................................50
4.2Standarddatabasetables.......................................................................................52
4.2.1TheCongtable.Standardkeywords........................................................52
4.2.2TheCongtable.AllOPCclientlinks......................................................55
4.2.3TheDataTypeInfotable...........................................................................59
4.2.4TheDiagnosticstable..............................................................................60
4.2.5TheDiagnosticstable.TheDataTracekeyword.........................................61
4.2.6TheDiagnosticstable.TheGroupTracekeyword.......................................66
4.2.7TheKSIM_XREFtable.Standardkeywords............................................69
4.2.8TheKSIM_XREFtable.Examples..........................................................73
4.2.9TheKSIM_XREFtable.Anexample:Twodataitems..............................75
4.2.10TheSimLink_XREFtable.......................................................................78
4.2.11TheSubServerstable..............................................................................78
4.2.12TheUpdateRatetable..............................................................................79
1/A3
KONGSBERGK-Spice®
4.2.13TheWatchdogItemstable........................................................................80
4.3ConguringSimLink.NETtoSimLink.NET.......................................................81
4.3.1CongureSubServersTable......................................................................81
4.3.2CongureItemConnectionsinSimLink_XREF.........................................81
4.3.3ActivateSimLinkTWICEfornewconnections..........................................81
4.3.4Conguringunitconversionforlink-to-link...............................................82
5SOFTINGANDMATRIKONOPCTESTTOOLS..................83
5.1TheSoftingOPCclienttool.................................................................................85
5.2ErrormessagesinSoftingOPCclienttool...........................................................90
5.3TheMatrikonOPCServer.....................................................................................91
5.4TwotagsintheMatrikonOPCServer...................................................................92
5.5TwotagsintheOpcDaComlink........................................................................100
5.6TheMatrikonOPCHDAExplorer.....................................................................104
6OPCDCOMCONFIGURATION.......................................112
6.1DCOMcongurationforAbbItsCom................................................................112
6.2Checkthelocalsecuritypolicysettings............................................................121
6.3ModifytheDCOMconguration.......................................................................122
6.4ODBCDataSourceAdministrator.....................................................................125
7VARIABLETRANSFERBETWEENDCSAND
K-SPICE.......................................................................126
7.1DCSconnectionphilosophy...............................................................................126
7.2InterfacestotheDCSServers.............................................................................127
7.3Modelvariablesubscriptions..............................................................................128
7.4DCSdriverfunctionality....................................................................................128
7.5Packingandunpackingvariables.......................................................................128
8THECROSSREFERENCELIST.......................................129
8.1CreationoftheCrossReferencelist...................................................................130
8.2ItemConnections................................................................................................133
8.2.1SourceItemConnections(DCSloopback)..............................................133
8.2.2DcsUnit.................................................................................................133
8.2.3Attributes..............................................................................................134
8.2.4BinaryCopy..........................................................................................134
8.2.5BitAddressing.......................................................................................135
8.2.6ItemconnectionQuality.........................................................................135
9TIPSANDTROUBLESHOOTING....................................136
9.1DOScommands..................................................................................................136
9.2SystemV alues.....................................................................................................137
9.3DisableExplicitReadAfterConnect....................................................................140
9.4ChangingDateandTimesetting........................................................................141
9.5Reconnectsupport..............................................................................................142
41/A
UserGuide
9.6K-SpicePIDControllerconnection....................................................................143
9.7PIIntegration......................................................................................................145
9.8RemotelyStartingControllers............................................................................147
9.9DataorganizationontheOPCserver.................................................................149
9.10UseraccountsinWindows.................................................................................150
9.10.1Sharingthe$Adminfolder......................................................................150
9.10.2SavingCredentialsSecurely...................................................................151
9.11SQLtipsandtricks.............................................................................................153
9.11.1CreatingaSQLqueryintheSimLinkdatabase........................................153
9.11.2RunningQuery......................................................................................154
9.11.3Clearconnectedonallitems...................................................................155
9.11.4Setconnectedforallitems......................................................................155
9.11.5Clearconnectedforaparticularitemnode...............................................155
9.11.6FindingDuplicatesinKsimName............................................................155
9.12BasicTerminology..............................................................................................157
9.12.1DCS......................................................................................................157
9.12.2OPC......................................................................................................157
9.12.3OLEandCOM......................................................................................159
9.12.4DCOM.................................................................................................159
9.12.5PLCandPAC........................................................................................159
9.12.6Sockets..................................................................................................159
9.12.7SCADA.................................................................................................160
9.13FAQs...................................................................................................................161
9.13.1FAQsaboutallSimLinks........................................................................161
9.13.2FAQsaboutOPCDAbasedSimLinks.....................................................163
9.13.3FAQsaboutOpcDaCom.........................................................................163
10SWITCHOVERFUNCTIONALITY...................................164
10.1DCSconnectionphilosophy...............................................................................164
10.2DCSconnectivityrequirements..........................................................................165
10.3CommonDCSinterfacingmodules....................................................................165
10.4BasicDCSCongurations..................................................................................167
10.5Typicalswitchoverprocedure.............................................................................170
1/A5
KONGSBERGK-Spice®
61/A
Introduction
1Introduction
ThisisauserguidefortheDistributedControlSystem(DCS)communicationslink
betweenK-Spice®modelsandanysupportedDCS.Thelinkisaseparateprogramthat
connectstotheK-Spice®SimulationManagerandhandlesallI/Oexchangesbetween
activetimelinesandtheremoteDCS.
SomeofthelinksrelatestoanAPIspeciedbytheDCSvendors.Otherlinksarebased
ontheOPCstandard.TheOPClinkscommunicatewiththeDCSvendormachine
followingtheOPCprotocol.TheDCSvendormachineisthenconguredasanOPC
server.
Mostoftheimagesinthisguidearefromatestmodel,withatestlinkconguration.
Manyoftheimagesarescreenshotsfromrealinterfacingprojects.Effortismadeto
disguisethedataproject’sdatastructureandtherealproject’stagnames.Someof
theseimagesarebitmanipulated,charactersaremovedaround.Somethetagnames
intheimagesareshorteneddownversionsoftherealnames.Typicallyaprojecttag
PI-430–754.PVispresentedintheimageasPI-754.PV ,oraninternetaddress11.45.23.97
ispresentedintheimageas11.11.11.97.Ifthereareerrorsintheimages,orinconsistency
betweenimages,theerrorcouldbetheresultofunfortunateimagemanipulation.
1/A7
KONGSBERGK-Spice®
1.1ControlsystemsandK-SpiceDCSlinks
ThecompaniesthatdelivercontrolsystemshaveproprietaryDCSserversthat
K-Spicecanconnectto.
Table1Existinglinks
K-SpicelinkDCSvendorControl
system
Linktype
AbbItsComABB800xAVendorAPIfor
commandsin
combinationwith
OPCfordata.
AimInterfaceCom
AimWinPsStarter
Kongsberg
Maritime
AIM2000
AutoswitchComlink-to-link
CccOpcComCompressor
Controls
Corporation
OPC
DeltaVComEmersonProcess
Management
DeltaVOPC
ExatifComYokogawaCentumCSVendorAPI
HimaComHIMAHIMAX-OTS
Simulator
OPC
HimaElopIIComHIMAHIMAX-OTS
Simulator
VendorAPIfor
commandsin
combinationwith
OPCfordata.
OpcDaComDatasource:
StandardOPC
OPCDA
OpcHdaComDatasource:
StandardOPC
OPCHDA
ProSimComOyEndatLtdProsimVendorAPI
SimitComSiemensSimaticPCS7
Noinstallerfor
Sim4MeCom
InvensysFoxboroEvoVendorAPIfor
commandsanddata.
SoftLogixComAllen-BradleyControlLogix
TelepermMComSiemensTelepermM
OPC
VendorAPIfor
commandsin
combinationwith
OPCfordata.
81/A
KONGSBERGK-Spice®
1.2Acronymsandconcepts
ThebasicconceptsOPC,DCSandSCADAhaveashortexplanationinthechapterTips
andTroubleShooting.SeeBasicTerminologyonpage157
AcronymFulltextDescription
AspectServernoneNameoftheABBITSdata
servers
BucketBrigade.Int4noneMatrikon.Defaulttagnamein
theMatrikonTesttool.
COMComponentObjectModelStandardinteractiveobject
creationandinterprocess
communication
DCOMDistributedComponent
ObjectModel
Microsoft.Communication
amongapplicationsdistributed
acrossnetworkedcomputers.
DCSDistributedControlSystemStandard
EWSEngineeringWorking
Station
Yokogawa
FCSFieldControlSystemYokogawa
ITSIndustrialTraining
Simulator
ABBITSisthenameofthe
communicationpackageused
ininterfacestotheABBcontrol
system.
OLEObjectLinkingand
Embedding
Microsoft
OPCOLEforProcessControlStandard
PIServernoneOSIsoft.Storageofanyform
ofreal-timedata.
PLCProgrammableLogic
Controllers
Standard
ProplusnoneNameoftheDeltaVsystem
dataservers
SCADASupervisoryControlAnd
DataAcquisition
Standard
WMIWindowsManagement
System
Microsoft.Management
ofdataandoperationson
Windows-basedoperating
systems.
101/A
Introduction
1.3StructureofaDCScommunication
system
TheDCSLinkconnectstoK-Spice®viatheSimulationManager,asshowninthe
gurebelow.TherearedifferentversionsofaDCSLinkdependingontheDCStobe
connectedto,suchasABB,EmersonorYokogawa.However,theinterfacetoK-Spiceis
stillthesame.TheK-Spice®DCSLinkareconnectedtoaMicrosoftAccessdatabase
thatcontainsI/Omappings,alsocalledtheCrossReferenceList,andDCSdriver
connectioninformation.
Figure1K-SpiceDCScommunicationsystem
TheDCScommunicationlinkconsistsoftwolayers.Therstlayerismodelvariable
subscriptions,whichisindependentoftheDCSsystemandconnectedtoSimulation
Manager.Thesecondlayerisacommunicationsdriverwhichistospecictothe
DCSsystem.
1.4DCSdriverfunctionality
TheDCSdriverforaparticularDCSisafunctionalblockwithadenedinterface
towardsthemodelvariablesubscriptionsandinternallogicimplementingthesystem
speciccommunicationtasks.
Thetaskssolvedbyadriverare:
1Transfervaluesbetweentheexternalsystemandthemodel.Tagnamesusedto
identifyavalueintheexternalsystemarefoundasparametersintheentryfora
variableintheIOlist.
2Ifapplicable,convertcommandsreceivedfromthemodelvariablesubscriptions
andforwardthemtotheexternalsystem.Onceacommandhasnished,returnthe
properacknowledgementtothemodelvariablesubscription.
TheappropriatedriverforadenedexternalDCSsystemisaddedthroughtheAccess
databasebyselectingtheappropriateDCSlinkforthecontrolsystem.
1/A11
KONGSBERGK-Spice®
Packingandunpackingvariables
TheDCSdriverisalsoresponsibleforpackingandunpackingdataincaseswhere
multiple,individualmodelvariablesaresharingacommonDCSvariable(forexample,a
maskofvaluelimitswitches.)
ThisHimaElopIIComisalinkforHIMAH41/H51-qSystemsprogramedwithELOP
II.TheinterfacingisdonethroughaVizualizationGatewayapplicationfromKirchner
Softandlogi.calsGmbH.TheHIMAOPCserverisusedfordatacommunicationand
VisualizationGatewaywithstandardWindowsCOMtechnology,isusedforcommands.
ThelinkmustrunonthesamePCasVisualizationGateway.
121/A
SettingupaSimLinkapplication
2SettingupaSimLink
application
HowtoinstallthelinkonthePC
IfyouhaveanolderversionofK-Spiceinstalled,uninstallK-Spice,anduninstallthe
oldlink.
Gotothebuildmachine,andndtheactualversion.DoubleclickonKSpice.exe.
ThendoubleclickonKSpiceExatifCom.exe.
OftenanewversionofK-SpiceandthelinkmustbeinstalledonaPCthatcannotaccess
thebuildcomputerdirectly.Theinstallationprogrammustcopiedtoamemorystick.
Fori.e.theExatifComlink,bringwithyouthefollowinglesanddirectoriesfrom
thebuildmachine:
•KSpice.exe
•KSpiceExatifCom.exe
•directory:packages
•directory:redist
IfyoudonothaveaK-Spicelicenseinstalled,youmustalsobringwithyou:
•KOGTLicenseUtility.exe
2.1ThecreationofaSimLinkapplication
Thisisageneraldescriptionforlinkinstallationandtheinitiallinkconguration.To
makethedescriptioneasiertoread,itisnecessarytoselectanameastheexampleforall
thelinks.TheExatifComlinkandYokogawa’sEngineeringWorkingStationareusedas
examplesinthischapter.Thestepsaremoreorlessthesameforallthelinks.
TheModelPCandtheEWSmachine.
ThenormalcongurationwillbethatalltheK-SpiceexecutablesandtheK-Spicemodel
areinstalledononemachine,calledtheModelPC.TheDCSvendorwillnormallyset
upadataserveronadifferentmachine.ForaYokogawasystem,themachinewiththe
dataserveriscalledaEngineeringWorkingStation(EWS).FortheABBITSsystem,
1/A13
KONGSBERGK-Spice®
themachinewiththedataserveriscalledtheAspectServer.ForDeltaVsystemsthe
dataservers,normallyonecentralserverwithmultiplesatelliteservers,arerunningon
aProplusmachine.
ThelinkrunningonModelPCorontheEWSmachine
Therearetwopossibilitieshere.IfthelinkisinstalledontheModelPC,the
communicationbetweenK-SpiceSimManagerandtheK-SpiceSimLinkissimpleand
straightforward.WiththissetuptheSimLinkmusthavereadandwriteaccesstoaDCS
dataserveronaremotemachine.Therearerewallissuesinvolved.FortheOPClinks
themainissueistoopenupforDCOMaccessontheremotemachine.
SeethesectionDCOMcongurationforAbbItsComonpage112
TheotherpossibilityisthatthelinkisinstalledonthesamemachineastheDCSdata
server.Thissimpliesthecommunicationbetweenthelinkandthedataserver,but
complicatesthecommunicationbetweenSimManagerandtheSimLink.Thelink
hastobestartedbyK-SpiceSimManagerontheremotemachine.Theapplication
SimRemoteLauncher.exe,installedontheremotemachine,isusedtostartthelink
application.TherearerewallissuesandDCOMaccesscongurationforthissolution
also.
Onelinkapplicationortwolinkapplications
Ifthereismorethan1nodeintheOPCserver,thenormalcongurationisthatyou
createoneSimLinkapplicationforeachnode.ToreaddatafromtheHIMAserversin
thegurebelow,onelinkapplicationmustbecreatedtoreaddatafromPLC_1–DA,one
linkapplicationmustbecreatedtoreaddatafromPLC_2–DA.
Figure2TheOPCServerBrowserforaHimaComlink
ToreaddatafromaDeltaVsystemyouwillonlycreateonelinkapplication.The
linkwillinterfacetowhatiscalledtheProplusServer.TheProplusOPCServerwill
communicatewiththeothernodesintheDeltaVsystem.
InstallerfortheK-Spicelink
TosetuptheExatifComlinkitsnecessarytoinstallExatifCom.exeinthedirectory
C:\ProgramFiles(x86)\Kongsberg\K-Spice\bin.
141/A
SettingupaSimLinkapplication
Thedifferentlinksareinstalledwithdifferentinstallationles,i.e
KSpiceExatifCom.exe
EithertheinstallerneedstoberunontheK-SpiceModelPC,ortheinstallerneedstobe
runontheYokogawaEngineeringWorkingStation(EWS)machinewheretheYokogawa
FieldControlStation(FCS)testfunctionsarelaunched.
TheoptionwherethelinkrunsontheK-SpiceModelPC:
Inthedirectory:
\\xray\03208\KSPICE\Installations\KSpiceCombined\Official
Releases\2.8.2.0\Installers\
DoubleclickonKSpiceExatifCom.exe
Theoptionwherethelinkrunsontheremotemachine.
CopythefollowingdirectoriesandlestotheEWSmachine:
From:\\xray\03208\KSPICE\Installations\KSpiceCombined\Official
Releases\2.8.2.0\Installers\
Thedirectory:packages
Thedirectory:redist
Thele:KSpiceExatifCom.exe
Thele:SimRemoteLauncher.exe
Ontheremotemachine,doubleclickonthetwoexecutables.
IfafullK-Spicerunsonaremotemachine:
Inadditiontothetwodirectoriesandthetwolesintheprevioussection,copythe
followingtwoles:
Thele:KOGTLicenseUtility.exe
Thele:KSpice.exe
2.2TheleHostnames.txt
ThesetupoftheExatifComlinkalsoneedsaleHostnames.txttobeplacedinsidethe
projectfolder.ThislecontainsthenamesofthedifferentEWSmachines.
1/A15
KONGSBERGK-Spice®
Figure3Hostnames.txtintheprojectfolder
Thistextleconsistsofnamesoftheremotemachinewherethedifferentlinksare
running.InthiscaseitmustcontaintheYokogawaEWSmachinenamefore.g.
WR1814MDL01.
Figure4Hostnames.txt
161/A
SettingupaSimLinkapplication
2.3SimRemoteLauncher
IfthelinkExatifComisinstalledontheEWSmachine,theSimRemoteLaunchermustbe
launchedontheremoteEWSmachinerunningtheFCStestfunctionspriortostarting
theExatifComlink.
CreateastartupbatchlefortheSimRemotelauncherontheEWSmachine.The
batchlecontainsthefollowingscript.
Figure5ScripttolaunchSimRemoteLauncher
Doubleclickthebatchle.ThiswilllaunchtheSimRemoteLauncherontheEWS
machine.
1/A17
KONGSBERGK-Spice®
2.4CreatealinkapplicationintheK-Spice
project
Tosetupalink,anewlinkapplicationmustbecreatedintheprojectfolder,inparallel
totheProcessModelandotherapplications.Whenthelinkapplicationexists,K-Spice
SimExplorerwilllaunchthelinkapplication,whentheTimelineoftheprojectis
activated.
TheAccessdatabaseinthenew.NETbasedlinks
AnewAccessdatabaseiscreatedbythelinkapplicationwhenyoufollowthesteps
below.Whenthecongurationofthelinkapplicationisnished,theAccessdatabase
hasallthevaluesinit,thatmakesupthecongurationofthelinkintheactualproject.
Thedatabasecreatedinthestepsbelowhasallthenecessarytablesinit.Someofthe
keywordsinthetableshavedefaultvalueswhenthedatabaseisrstcreated.
Preparationsbeforecreatingalinkoftheoldtype.
WiththeoldC++links,anAccessdatabasemustexistintheprojectfolder,beforethe
linkapplicationiscreatedintheK-Spiceproject.Thisisthecasewiththeoldversion
oftheAbbItsComlink,2013andolder.Adatabaseinthe.mdbformat,withalotof
congurationparametersinit,mustbegeneratedupfront,basedondatabasesfromother
projects.Createthefolderbelow,andcopyoverthedatabasele:
C:\K-Spice-Projects\DemoProject\TimeLines\Engineering\
Applications\AbbItsCom\AbbItsCom.mdb
181/A
KONGSBERGK-Spice®
Figure7Setupthelinkasanewapplication
OpentheSimExplorer.RightclickontheTimelineEngineeringandselect→New
Application
201/A
KONGSBERGK-Spice®
ThedialogApplicationPropertieswillcomeupautomaticallywhenyoucreate
theapplication.Enterthefollowing:
Figure9Applicationtype
1SelectExatifComastheApplicationTypefromthedropdownlist.
221/A
SettingupaSimLinkapplication
2ThedefaultvalueisthatEnabledischecked.Acceptthedefaultvalue.When
Enabledischecked,theapplicationwillstartautomaticallywhentheTimelineis
activated
Figure10Enabled
3SelectHostnamefromthedropdownlist.Thislististhemachinenamesinthe
leHostnames.txt.
Figure11Hostname
4SavetheApplicationtypeandHostnamecongurationintheK-Spiceproject.In
K-SpiceSimExplorer:
File→SaveProjectProperties
1/A23
KONGSBERGK-Spice®
NowwhentheTimelineisactivated,theK-SpiceSimManagerwillautomaticallycreate
thenewfolderExatifintheexistingfolderTimelines/Engineering/Applications.
Activationofthetimelinewillalsoopenthemainwindowforthelink,thewindow
K-SpiceExatifCom,normallycalledtheSimLinkGUI
Thersttimeyouactivatethetimeline,theK-SpicedialogProgresswillopenwiththe
textInitializingmodelandarunningaprogressbar.
Figure12Theprogressdialogopenswhenthetimelineisactivated
ThedialogProgress,withtherunningprogressbar,willnotdisappearuntilyouhave
createdthelinkdatabase,andreloadedthedatabase,asdescribedinthenextsection,
Creationofanewdatabase.
Note
TheinitializationoftheK-Spicemodelwillnotnishuntilyouhavealinkdatabaseup
andrunning,asdescribedinthenextsection.
241/A
SettingupaSimLinkapplication
2.5Creationofanewdatabase
Thesearethestepsforall.NETbasedlinks.ThelinkExatifComisusedasexample.
Note
AllSimLinkapplicationsrequirethe32-bitversionoftheAccessDatabaseengineand
donotworkwiththe64-bitversion.Thatalsomakesthemincompatiblewiththe64bit
versionofMSOfce.Consequently,MSOfcefor64-bitcannotbeinstalledonthesame
machineasaSimLink.
Figure13K-SpiceExatifComdialog,alsocalledtheSimLinkGUI
TocreateanewdatabaseclickonFile→CreateemptydatabaseintheSimLinkGUI.The
SimLinkGUIisthedialogwiththetitleK-SpiceExatifCom.
1/A25
KONGSBERGK-Spice®
Figure14Savedatabaseas
Reloaddatabase
Afterthedatabaseiscreated,itisnecessarytoloadthevaluesintothelink.Thisisdone
withthebuttonReloaddatabase
Whenthedatabaseisreloaded,theactivationoftheK-Spicetimelineisnished.The
SimExplorerdialogProgresswiththeprogressbarindicatingthataninitializationis
goingon,willbeclosed.ThedialogcloseswiththetextFinished.
Figure15Reloaddatabase
261/A
SettingupaSimLinkapplication
DirectorystructurewithremotelinkinstallationfortheStandardlinks
Ifalinkisrunningonaremote(DCSvendor’s)server,thecrossreferencedatabasewill
resideinthelink’sworkingdirectoryonthatserver.AnyserverrunningaK-Spicelink
musthaveacopyoftheproject’sfolderstructureinstalled.Thefolderstructuremust
haveapathidenticaltotheonefoundontheModelPC.I.e.ifC:\K-Spice-Projects\”My
project”isusedontheModelPC,thedirectoryC:\K-Spice-Projects\”Myproject”must
befoundontheremoteserveraswell.Theprojectfolderontheremoteservermaybea
leshare,exposingtheprojectfolderontheModelPC.
1/A27
KONGSBERGK-Spice®
2.6Thecommandlineoption—database
-database<name>
Thedefaultdatabasefolderistheapplicationfolderintheprojecttimeline.Thedefault
databasenameisthenameoftheapplicationcreatedfortheSimLink.Forexample,a
projectmightcongureanExatifComlinkwiththenameExatif.Thedefaultdatabase
namewillbeExatif.accdb
Werecommendthatyouusethedefaultfolderanddefaultnameforthedatabase.
However,acommandlineoptionisprovidedtooverridethedefaults.
Thecommandlineoption-database<name>instructstheSimLinktoopenthat
database.
Exampleprojectspecicdatabase:
-database“C:\Configuration\Virtuoso.accdb”
TheK-SpiceprojectcanbeconguredfromSimExplorertoaddthecommandline
optionfortheSimLink.
281/A
TheSimLinkGUI
3TheSimLinkGUI
The.NETlinkdialogforcongurationandmonitoringandtroubleshooting,iscalledthe
SimLinkGUI.ThedialogopensupwhenthetimelinewiththeK-Spicelinkisactivated.
ThetitleofthedialogisK-SpiceExatifComfortheExatifComlink.
TheSimLinkGUIisusedforfourimportanttasks:
•AnewAccessdatabaseiscreatedviatheGUIthersttimethetimelinewithalink
applicationisactivated.
SeeCreationofanewdatabaseonpage25
•TheAccessdatabasethatisusedforlinkconguration,isnormallyopenedfrom
theSimLinkGUI.
•ThefeatureTheOPCServerBrowserintheSimLinkGUIwillndthecorrecturl
adressesoftheexistingOPCservers.
•ThelogwindowintheSimLinkGUIisessentialwhenitcomestomonitoringand
troubleshootingtheinterface.
1/A29
KONGSBERGK-Spice®
Figure16TheSimLinkGUIwithworkspaceLog
301/A
TheSimLinkGUI
3.1BrowseOPCServers.
AnimportantpartoftheOPClinkcongurationistogetthenameandaddressofthe
OPCservercorrectintheCongtableintheAccessdatabase.Theactualkeyword
intheCongtableiscalledOpcServer.
DifferentapplicationswillshowyoutheOPCserversandthecorrespondingurl’sonthe
localnet.YouwillndtheminMatrikonOPCExplorerandinSofting’sSOClient.The
besttoolforgettingthevalueofthekeywordOpcServercorrect,istheSimLinkGUI,and
thebuttonBrowseOPCServers.Seethedetailedstepsbelow.
TheOpcServerconnectionURL
TondtheURL,click→BrowseOPCServersintheSimLinkmainwindow.
Figure17TheSimLinkmainwindow
Whenthepanelopens,clickShow
IftheOPCserverisonanothermachine,entertheIPaddressoftheothermachinein
theeldHostComputer.
1/A31
KONGSBERGK-Spice®
Figure18TheOPCServerBrowserdialog
Figure19TheOPCServerBrowserforaHimaComlink
YoucancopytheOPCserverconnectionURLfromhere.TheURLshallbepastedin
theValuecelloftheoftheOpcServerkeywordinCongtable.TocopytheURLto
clipboard,youmustdouble-clicktheline!
Ifyoudoubleclickonthelineandpastetheurldirectlyfromtheclipboard,asdescribed
above,youaresafe.Ifyouforsomereasonpastetheurltoaneditoranddoactrl-C
intheeditor,andactrl-VintheAccessdatabase,youmustlookoutforextractrl-LF
(linefeed)intheAccessdatabasestring.SeeDcsErroronpage46
Note
UsetheURLastheSimLinkGUIpresentsit.Ifyou,inanOpcDaComlinkGUI,ask
fortheURLforanOPCServer ,therst8charactersofthestringisopcda://Ifyou,in
anOpcHdaComlinkGUI,askfortheURLonthesamemachine,theURLwillstart
withthe9charactersopchda://
321/A
TheSimLinkGUI
ExampleofOpcServervalue
opcda://localhost/Matrikon.OPC.Simulation
/{f8582cf2-88fb-11d0-b850-00c0f0104305}
TheurlofMatrikonOPCServerpresentedaboveistherealandcorrecturl.Pleasenotice
thatmanyscreenshotsinthisguidearemanipulated.Thepolicyhasbeentodisguisethe
realurl’sandtherealnamesandstructuresoftheDCSdatabases.Dataitemsfroma
K-Spicedemoprojectarenormallyuntouched.Namesofdataitemsfromrealprojects
shouldallbemanipulated.TheDCStagnamesaremanipulated,andthecorresponding
K-Spicedataitemnamesaremanipulated.
1/A33
KONGSBERGK-Spice®
3.2SyntaxinSimLinklogles
Anempty><
Thebiggerthansymbolandthesmallerthansymbolisusedinlogmessagesto
demonstrateclearlywhereatextstartsandwherethetextends.Ifalinkoperationfails,
theoperationwilloftenproduceanerrortext.Theerrortextwillbepresentedasa
partofalogmessage,encapsulatedin>and<.Iftheoperationsucceeds,noerrortext
isproduced.Iftheoperationsucceeds,thelogmessagewillhaveanemptytextinit,
thetwosymbols><.
341/A
TheSimLinkGUI
3.3UsingExcelconditionalformattingon
SimLinklogles
ConditionalformattinginExcelcanbeapowerfultoolforanalyzingtheSimLinklogle.
Thelinkusedasanexampleinthissection,isanOPCbasedlink
InExcelthereisaformattingoptioncalledConditionalFormatting:TextthatContains...
Figure20ConditionalFormatting
ThesetupisconguredintheRulesManager:
1/A35
KONGSBERGK-Spice®
Figure21TheRulesManager
Thethreerules:
•Textcontaining"OnUpdateFromServer"getstheyellowhighlighting
•Textcontaining"ToServerHasChanged"getsthegreenhighlighting
•Textcontaining"DestinationUpdate"getsthepinkhighlighting
Inotherwords:
•YellowhighlightingiswhentheSimLinkreceiveddatafromtheOPCServer
•GreenhighlightingiswhentheSimLinksenddatatotheOPCServer
•PinkhighlightingiswhentheSimLinkupdatedvalues
Figure22TheSimLinklogleinExcel
361/A
TheSimLinkGUI
Thetagsintheimageaboveareheavilymanipulatedtodisguiserealdatastructure.The
manipulationhasintroducedinconsistencies.Nodoubt.
Thefollowingwilldemonstratehowavalueofaround60wentthroughthesystem
andthenwasresetbacktoaround5.
Step1
TrackdownwhenthevaluewassenttotheOPCserver.Thatisline1705.
Figure23V aluesent
Step2Backingupfromthere,wherediditcomeintothisSimLink?Inrow1700.Since
thevalueis2457,theprojectisusingGain/Biasonthislink-to-linktag
Figure24Thevaluecomesintothelink
Step3Thisisabidirectionalconnection,59.95098isechoedbacktothesourcelinkat
row1702
Figure25Thevalueisechoed
Step4Notethatdifferenceintimebetween1700and1705ishowlongtheSimLinkhad
thevaluebeforesendingitontotheOPCServer.Approximately1second.
Step5SincethereisasubscriptiontotheOPCitemforread&write,thedataisechoed
backtousatRow1711.Inthemessagetothelogle,weactuallyseethelogmessages
forupdatingtheconnectionforthistagrstatrows1709and1710.Butthesewere
actuallytriggeredbyreceivingthedatafromOPCatrow1711.
1/A37
KONGSBERGK-Spice®
Figure26UpdatedValue
Step6Thevalueof5.207...comesfromtheOPCServeratline1716whichtriggers
sendingittotheconnecteditemonrows1714and1714.
Figure27AnewvalueiscomingfromtheOPCServer
Thatnaleventiswhatwearelookingfor.Whatchangeditbacktoaround5afterwe
setittoaround60?TheansweristheDCS,usingtheOPCServer.Atleastaccordingto
ourdatatracemessages.
381/A
TheSimLinkGUI
3.4WatchanitemintheSimLinkGUI
Addingawildcardselectionoftags
TheSimLinkWatchwindowsupportsaspecialsyntaxforaddingmultipleitems
simultaneously.ThisonlyworkswhenthesearchmethodisWildcard.
Figure28SetsearchmethodWildcard
IfyouendthesearchpatternwithtwoasterisksbeforeclickingAdd,thisinstructsWatch
toaddallmatchingitems.
Thenormalsearchpatternforthisexamplewouldbe*hvm*–whichindicatesthat
Watchshouldshowallitemswithhvminthemiddleofthename
1/A39
KONGSBERGK-Spice®
Figure29SetsearchItem
Byaddingthesecondasteriskattheend,WatchwilladdthemallwhenAddisclicked.
Figure30Searchitemendingwithtwoasterixes
401/A
TheSimLinkGUI
3.5T agconnectionerrors
Thelinkwillgointoadiagnosticmode,whenconnectionerrorsareencountered
ThisisanexamplefromExatifCom.Whenexaminingthelog,youwillseeinformation
similarto:
Figure31LogleintheSimLinkGUIwithconnectionerrors
WhenconnectingtotagsinaStation,Exatifeitherconnectsalltagssuccessfullyorit
connectsnotagswhenanyerrorisencountered.Sotheerrormessagesyouareseeing
maybeforvalidtags.
Whenanerrorisencountered,ExatifComwillenteradiagnosticmodeandconnecttags
onanindividualbasis.Thisissoitcanreporterrors.Itdoesnotautomaticallydisable
theincorrecttagsandconnectonlythecorrectones.Youwillseemessagesinthelog
lesimilarto:
Figure32LogleintheSimLinkGUIwithoneerror
1/A41
KONGSBERGK-Spice®
3.6T agconnectionsuccess
LoglefromatestsetupwithaDeltaVComlinkanddefaultvaluesinaMatrikontest
server
Figure33LogleintheSimLinkGuifromsuccessfulconnection
421/A
TheSimLinkGUI
Figure34Statuslogwith4successfuldcsconnections
Afulltagconnectionsuccessimpliesthatthereisatagconnectedinbothends.Whenthe
connectionsessionstarts,youwillseethismessageasavericationoftagconnection
inbothends,:
ConfigurationDetailsConnecting
dcs(OTS_R9.Global.R9_TAG-TAG-0002_DO)
->ksim(ProcessModel/HimaRead:DisplayValue#-#)
Note
ThevalueintheStatuslogforDCSItemsConnectedrefersonlytoasuccessonthe
DCSsideoftheconnection
TheDCSsideoftheconnectionisnormallyconguredrst,andsettingtheDCStags
correctlyisnormallythedifcultpartofthelinkconguration.Toavoidthatthelogsare
oodedwithwarningsaboutmissingK-Spicedataitems,thestatusloggivesfeedbackof
theDCSpartoftheconguration,only.
SeenextsessionTheksimendoftheconnectionhasfailed
1/A43
KONGSBERGK-Spice®
3.7Theksimendoftheconnectionhas
failed
Ifyouattheendoftheconnectionsession,seeinthestatuslogthat4DCSItemsare
connected,thisisanindicationthattheDCSsideoftheconnectioniscorrect.The
situationcanstillbethattheksimsideoftheconnectionhasfailed.I.e.ifthenameofthe
timelineiswrong,thereisnowarningintheSimLinkGUIlog.Thetimelinenameis
partoftheSubServerkeywordintheSubServerstable.Ifthetimelinenameiswrong,the
ksimendoftheconnectionfails.
IfyouaddtheitemundertheWatchtabintheSimLinkGUI,youwillseethatthereisa
problem.Withaloadedmodel,thelinkcannotndthevalueoftheK-Spicedataitem.
Thevalueofthedataitemisindicatedwith???.
Figure35NovalueintheWatchworkspace
Tagconnectedintheksimend
WhentheksimsideoftheconnectionisOK,youwillseethismessageintheSimLink
GUIlog:
ConfigurationDetailsTagconnected.StatusOK.Type:
TYPE_DOUBLE-ProcessModel/HimaRead:DisplayValue#-#
441/A
TheSimLinkGUI
3.8Missingnode
ThekeyKsimNodeinthetableKSIM_XREFwasnotgiventhecorrectnameofthe
KsimNode.
ConfigurationWarning:Missingnode,unabletoconnectto
HimaRead:Value#-#at1
Figure36MissingnodeintheSimLinkGUIlogle
Figure37KsimNodeintableSubServers
InthetableSubServers,thekeyKsimNodewasgiventhevalueProcessModel.
ProcessModeliscorrectandinagreementwiththemodelnameinK-Spice.
InthetableKSIM_XREFthevalueofthekeyKsimNodewasmisspelledas
ProsessModel.Theresultofthecongurationerrorwasthatthelinkwasnotableto
connecttheHimatagwithaK-Spicedataitem.
Figure38KsimNodeintableKSIM_XREF
1/A45
KONGSBERGK-Spice®
3.9DcsError
Figure39ThelogmessageE_NETWORK_ERROR
Thiserrorwascausedbytwocontrolcharacters,CarriageReturnandLineFeed,inthe
middleofthenameoftheOpcServer.ThestringusedinthekeywordOpcServerinthe
Congtable,wascopiedfromapageinatexteditorwithctrl-Cctrl-V .Tothissimple
string,theAccessdatabaseaddedtwocontrolcharacters.Onlythesecondpartofthe
string,thepartaftertheLineFeed,wasseenintheAccessdatabase.Whentherowwas
madehigher,thefulltext,twolines,wasvisible.
461/A
TheSimLinkGUI
3.10CoCreateInstanceEx
IftheOPCServerisonadifferentmachine,theoptionBrowseOPCServerscanfailwith
themessageinthebitmapbelow.SeeadescriptionoftheBrowseoptioninthechapter
TheSimLinkGUI.SeeBrowseOPCServers.onpage31
Figure40Accessisdenied
TherstpointinthechecklistforDCOMcongurationis:V erifythattheModelPCand
theOPCServeraremembersofthesamedomain.Ifnot,theerrormessageisAccessis
denied.SeeDCOMcongurationforAbbItsComonpage112
1/A47
KONGSBERGK-Spice®
4TheAccessdatabase
TheAccessdatabasechapterisaboutlinkconguration.
Allthecongurationdetailsofthedifferentlinksareorganizedasvalues,called
Keywords,inTablesintheMicrosoftAccessdatabase.Thischapterisadescriptionofthe
detailedcongurationthelink.ThecongurationisstoredwiththeMicrosoftAccess
database.
Somegeneraldatabaseissues:
TheCrossReferenceList
AnessentialpartofaworkinglinkistheCrossReferenceList.Alltagsreceivedfrom
theDCSsystemhasonelineintheCrossReferenceList.Thecorrespondingtagin
K-Spiceiswrittenonthesameline.
CreationandmaintenanceoftheCrossReferenceListforaspecicproject,isatask
thatisnotcoveredinthismanual.
ThisLinkGuideiswrittenwithassumptionthattheCrossReferenceListfortheproject
alreadyexists.
TheCrossReferenceListwillbeimportedintotheKSIM_XREFtableintheAccess
databaseandisanimportantpartofthelinkconguration.Seeasummaryinthechapter
CreationoftheCrossReferencelist.onpage130
ToSubServer
ToSubServerisanimportantbooleankeywordinthetableKSIM_XREF.ToSubServer
denesifK-SpiceisreadingthevaluefromtheDCSsystem,orifK-Spiceiswritingthe
valuetotheDCSsystem..
ToSubServerisinsomedatabasesimplementedasatickbox,inotherdatabasesasan
integer
Note
Read:ToSubServeristrue,tickedon,—1.K-SpicereadsavaluefromtheDCSsystem
Write:ToSubServerisfalse,tickedoff,0.K-SpicewritesavaluetotheDCSsystem
481/A
TheAccessdatabase
Connected
ConnectedisanotherimportantbooleankeywordinthetableKSIM_XREFK-Spicewill
innormaloperationreadavaluefromtheDCSsystemorwriteavaluetotheDCS
systemthroughthelink.ThisisifthevariableisConnected.(-1isconnected).Setting
thekeywordConnectedinthetableKSIM_XREFto0(0isdisconnected)willtakea
variableoutofthetransferofdata.Ifthevariableisdisconnected,thevariableisstilla
denedvariableintheAccessdatabase.Butnosubscriptionorconnectionisestablished.
Nodatawillbetransferredinanydirection.
Connectedisinsomedatabasesimplementedasatickbox,inotherdatabasesasaninteger
Note
Connected:theConnectedboxistickedon,equivalenttothevalue—1
Disconnected:theConnectedboxistickedoff,equivalenttothevalue0
BucketBrigade.Int4andSaw-toothedWaves.Real4
Youwillseethesetagnamesinmanyoftheimagesinthisguide.Thesearedefault
tagnamesinthetestserverMatrikonOPCServer.
Effortismadeinthismanualtoavoidpresentationoftagnamesfromrealprojects.Most
oftheimageswillbefromaK-Spicedemoproject.Andmostoftheimageswillnot
presentdatafromarealDCSsystemAtestserver,calledtheMatrikonOPCServer,is
usedtosimulatearealDCSsystemformostoftheimages.TheMatrikonOPCServer
canbeconguredtosenddatawithtagnamesthatareequalinformtothetagnamesyou
willndinarealDCSsystem.
ButtheMatrikonOPCServerhasalsoasetofdefaulttagnamesthatareconguredby
theMatrikonapplicationitself.Manyoftheimagesandbitmapsinthismanualwill
presentthedefaultMatrikontagnames.YouwillseethemintheItemNameeldinthe
KSIM_XREFtable.ExamplesofdefaultMatrikontagnamesare:
Random.Int4,BucketBrigade.Real8,BucketBrigade.Int4andSaw-toothedWaves.Real4
Savevalues
ItisnotnecessarytoexplicitlysavenewvaluesintheMicrosoftAccessdatabase.Once
anewvalueforakeywordisentered,thenewvalueisimmediatelysaved.Thatisat
leasthowitshouldbe.Thereisasavebutton,justincase.
1/A49
KONGSBERGK-Spice®
4.1Tables
TheOpcDaComandOpcHdaComAccessdatabasesbothhave12tables.
Figure41TablesintheAccessdatabase
Tables
Allthecongurationdetailsofthedifferentlinksareorganizedasvalues,called
Keywords.ATableintheMicrosoftAccessdatabaseisagroupofKeywords.
Thedatabaseusedinaprojectiscreatedaspartoftheinstallationandinitializationof
thelinkapplication.ThedatabaseisactuallycreatedduringtherstActivationofthe
timelinewherethelinkbelongs.SeeCreationofanewdatabaseonpage25
Thecongurationinthedatabasewillvaryfromlinktolink.Therewillbetablesinthe
Accessdatabaseforonelink,thatyouwillnotndintheAccessdatabaseforanother
link.ThetablesintheAccessdatabasearedenedbytheinstallationprogramforthe
linkapplication.
Thedatabasetablesaredescribedinthischapter,onebyoneinalphabeticalorder.The
twomostimportanttablesare:
1Congwithgenerallinkparameters
2KSIM_XREFwiththedescriptionofallthetagsthataresentthroughthelink.
501/A
TheAccessdatabase
Standardtablesvs.Specictables.
MosttablesarecommontoallthedifferentDCSlinks.Thecommontablesaredescribed
inthesectionStandarddatabasetables.InadditiontotheStandardtablessomelinks
haveSpecictables.I.e.theSoftLogixComlinkhasthetwoextratablesAbTypesand
PLC.ThesetwotablesareSpecictables,andwillonlybedescribedintheguidefor
theSoftLogixComlink.
TheOPClinksdonothaveSpecictables.
Standardkeywordsvs.Specickeywords
Manyofthesectionsinthisguide,describingoneandthesametable,aresplitintwo
parts.TherstpartdescribestheStandardkeywordsinthattable.Standardkeywordsare
commontoallthedifferentDCSlinks.Ifthereisasecondpart,thesecondpartdescribes
theSpecickeywords.SpecickeywordsareuniquekeywordsfortheactualDCSlink.
ForexampletheCongtableintheVirtusoComlinkhasakeyword
IntermediateInputClock.IntermediateInputClockisaSpecickeywordforthe
VirtusoComlink.ThiskeyworddoesnotexistintheotherDCSlinks.
1/A51
KONGSBERGK-Spice®
4.2Standarddatabasetables
Thedatabasetablesaredescribedinthissection,onebyone,inalphabeticalorder..
4.2.1TheCongtable.Standardkeywords
Table2TheCongtable,StandardkeywordssharedbyallSimLink.NETapplications
KeywordNotes
ConnectCheckIntervalSeconds•Optional
•Version:2.5.0.15
•Realvaluethatindicateshowofteninseconds
theSimLinkcheckstoseeiftheDCSisstill
connected
•Defaultis30.0
DefaultSubServer•Optional
•ValueisSubServernametouseasdefaultfor
tagshavingblankSubServereld.
•Ifmissing*and*onlyasingle*should-connect*
SubServerisdened,SimLink.NETwilluse
thatSubServerasthedefault
DurationWarningMilliseconds•Optional
•Version:2.82.9
•DcsServertimesmethodcallinitsprocessing
thread.Itlogsanymethodtoexecutethattakes
longerthanthisvalue
•Defaultis200
EpochStart•Optional
•Version:2.9.5.0
•Basedate/timetoaddtomodeltime(usedfor
real-timemodels)
•Formatisyear,month,day,hour,minute,
second
•Defaultis1970,1,1,0,0,0
521/A
TheAccessdatabase
Table2TheCongtable,StandardkeywordssharedbyallSimLink.NETapplications
(cont'd.)
ExitTimeoutMs•Optional
•HowlongtheSimLinkwaitsforDCSto
disconnectwhenshuttingdownorrestarting
•Defaultis10,000ms,butindividual
SimLinksmayhaveadifferentdefault
•ThisoverridesanydefaultbytheSimLink
FullUpdate•Optional
•FullUpdaterateforK-Spicesubscriptionsin
seconds.
•TheSimLinkreceivesanupdateforeverytag
athaschangedvaluesincethelastupdate.
•Defaultisthecommunicationlibrarydefaultof
30(2011/06/10).
ReconnectEnabled•Optional
•Version:2.5.0.15
•Canbetrueorfalse.Defaultisfalse.Iftrue,
supportingSimLinkwillattempttoreconnect
toaDCSthathaslostconnection
ReconnectIntervalSeconds•Optional
•Realvaluethatindicateshowofteninseconds
theSimLinkshouldattempttoreconnectif
ReconnectedEnabledistrue
•Defaultis30.0
SimLinkSaveFolder•Optional
•Defaultisemptyfordisabled.Enablessaving
ofbidirectionalvaluesinaSimLinksavele
(currently/typicallyusedbyOpcDaComright
now)
StepSlipMilliseconds•Optional
•Howmuchearly(inmilliseconds)toacka
SimStep
•Defaultis200
1/A53
TheAccessdatabase
4.2.2TheCongtable.AllOPCclientlinks
Table3TheCongtable.KeywordssharedbyallOPCClientlinks
KeywordNotes
OpcServer•RequiredforOPCLinks
•OPCServerConnectionURL
•Example:
opcda://localhost/Matrikon.OPC.Simulation/
{f8582cf2-88fb-11d0-b850-00c0f0104305}
•BestwaytosetisuseBrowseoptionfromSimLink
tocopytoclipboard.
TheBrowseoptionisdescribedbelow.
EnableDateTimeStamp•Optional
•Version:2.9.4.0
•Defaultstofalse
•Whenenabled,thecurrentmodeltimeissenttothe
OPCDAserverasthetimestampforthedatavalue
EpochStart•Optional
•Version2.9.4.0
•OnlyrelevantifEnableDateTimeStampistrue
•Basedate/timetoaddtomodeltime
•Formatisyear,month,day,hour,minute,second
•Defaultis1970,1,1,0,0,0
SeethechapterTheSimLinkGUIonhowtondthecorrectvalueforthekeyword
OpcServer.SeeBrowseOPCServers.onpage31
1/A55
KONGSBERGK-Spice®
561/A
KONGSBERGK-Spice®
571/A
KONGSBERGK-Spice®
581/A
KONGSBERGK-Spice®
4.2.4TheDiagnosticstable
TheDiagnosticstableintheSimLink.NETdatabasecanbeusedtocongurevarious
diagnosticsavailableinaSimLink.
Table4KeywordsintheDiagnosticstablecommontoallSimLink.NETapplications:
KeywordNotes
ControlItemMonitor•ForSimLinksthatsupportit–Every5minutes,will
writecontrolitemvaluestothelogle.
•Fromversion2.11.2.:AllOPCDAbasedlinks
supportthisdiagnostic.Logscontrolitemvalues
thatareenabledforread-from-OPC-Server.
•Thisisusefulwhendiagnosingaproblemwhere
ControlItemTracesendstoomanymessagestothe
logle.
ControlItemTrace•WhenenabledforSimLinksthatsupportit,enhanced
debugmessagestologleaboutdataupdatesfor
controlitems.SimilartotheDataTracemessages.
•Fromversion2.9.11.0:AllOPCDAbasedlinks
supportthisdiagnostic
DataTrace•Options:semi-colonseparatedlistofItemnames
•Enhanceddebugmessagestologleaboutdata
updatesforitemsintheOptionslist.
•SeeTheDiagnosticstable.TheDataTracekeyword.
onpage61formoreinformation.
GroupTrace•Options:1)<none>indicates“all”
•Options2)semicolonseparatedlistofrates.
•Enhanceddebugmessagestologleaboutitem
groupsbasedonupdaterate.
•Supportdependsonspeciclink
•Fromversion2.10.2.0:OPCDAbasedlink
supportthis.IncludesWriteandOnWriteComplete
messages.
•SeeTheDiagnosticstable.TheGroupTrace
keyword.onpage66formoreinformation.
ThreadRunCounts•Whenenabled,addsaruncountfortheManager
andDCSthreadsrunning.Usedtodetermineifa
threadisfreezing.
601/A
TheAccessdatabase
Figure42TheDiagnosticstable.Anexample.
4.2.5TheDiagnosticstable.TheDataTracekeyword.
TheDataTracediagnosticsisausefultoolforidentifyingdatatransferproblemsina
project.SeeUsingExcelconditionalformattingonSimLinklogles(notwrittenyet)
foranexampleofusingDataTracetoanalyzeanissue.
UseExcel
Typicallyit'seasiertoseethemessageifyouuseExceltoviewthelogleinsteadof
aatexteditor.SeeSimLinkLogles(notwrittenyet)andUsingExcelconditional
formattingonSimLinklogles(notwrittenyet)formoreinformation.
ThetracemessagesinthelogleareofthetypeDebug,toit'seasytolterExceldisplay
toonlyshowthese.
1/A61
KONGSBERGK-Spice®
Figure43SelectMessageTypeDebuginalogleinExcel.
621/A
TheAccessdatabase
Figure44Debugmessagessortedout
WhatdoesDataTracedo?
IfyouenableDataTraceonanitem,itwillautomaticallyenabletracingonanyitemit's
connectedtoandtheconnectionitself.DataTraceenablestracingonanyitemwhosefull
namebeginswiththeoneoftheoptionstringsspecied.Soit'spossibletoinadvertently
enabletracingonmultipleitems.
Forexample,ifyouenabletracingonBucketBrigade,allitemsthatbeingwith
"BucketBrigade"willbeincludedinthetrace.Typically,youwillspecifythe
fullnameoftheitemyouwishtotrace.Inthisexample,tracewasenabledon
SoftLogixCom2/EMU40OTS1EMU02/LP_EMU_2/EMU_IO:6:O.Data[5]
HowdoIgureoutthenametouseforDataTrace?
FindthemessageintheloglethathastheConnectingsource->destinationinformation.
ThismessageshowsthefullnameoftheitemsfortheSimLink.
Figure45TheConnectingsourcemessage
1/A63
KONGSBERGK-Spice®
Here,thesourceitemis
SoftLogixCom2/EMU40OTS1EMU02/LP_EMU_2EMU_IO:6:O.Data[5]
ThedestinationitemisR6/Prog2.PF1_LSIC_270000.Command.man_target
VerifyDataTraceenabledfortheitem
Whenyouturnontracing,youshouldverifyyougotthenameandspellingcorrectby
lookingforthetracingstartupmessages.
Figure46V erifythespelling
DataTracewasenabledfor
SoftLogixCom2/EMU40OTS1EMU02/LP_EMU_2/EMU_IO:6:O.Data[5]which
automaticallyenabledtracingforR6/Prog2.PF1_LSIC_270000.Command.man_target
becausethereisaconnectiondenedforthem.
CommonTracemessages
ThetracemessagesabovearecommontoallSimLinks.Speciclinksmayhave
additiontracemessages.OPCDA-basedlinkshaveadditionalmessages,forexample
DestinationUpdate,OnUpdateSourceandSendValue.
DestinationUpdate
Figure47DestinationUpdate
DestinationUpdateindicatesthatthedestinationitemvalueisbeingupdated.Thevalue
followingthewordsDestinationUpdateisthevaluebeingsenttothedestination.This
valueistheSourcevalueanddoesnotincludeanyinversion,gainorbiasthatmaybe
appliedbythedestination.
641/A
TheAccessdatabase
DataModelTimeisthemodeltimethattheSourceitemhastimestampedforthatvalue.
Ifit'scomingfromamodelsubscriptionupdate,thenmodeltimewassentbythemodel
server.Ifthesourcedataupdatedoesnotincludeamodeltimestamp,theSimLinkwill
useit'scurrentvalueformodeltime,whenitsavesthesourcevalue.
OnUpdateSource
Figure48OnUpdateSource
OnSourceUpdateindicatesthelinkhasreceivedanupdateonthesourcedataitem.The
numberfollowingSourceUpdatesisacounterofhowmanyoftheseeventshavebeen
received.ThismessageistypicallyfollowedbyDestinationUpdatemessageasthe
connectiontakesthesourcevalueandpropogatesittothedestinationitem.
SendValue
Figure49SendV alue
SendValueindicatesthattheSimLinkisgettingthecurrentvalueoftheitemsoitcanbe
transmittedtoitsdestination(ModelServer,DCS,etc).
•ThevaluethatfollowsSendValueisthevaluebeingsent.
•ModelTimeindicatesthecurrentmodeltimeaccordingtothelink.
•dataModelTimeindicatesthattimestampassociatedwithwhenthevaluewas
originallyupdatedbylink.
•ForcedisatrueorfalsevalueindicatingwhethersomecomponentintheSimLink
requestedthatthevaluebesentregardlessofanytolerancevalue.
•Triggerisaninternaltrue/falsevaluewithinthelinkforitemsthatshouldhavetheir
valuessentafterspeciceventsregardlessofanytolerancesetting.
Typically,ifForcedandTriggerarebothfalse,thatindicatesthatvalueisbeingsent
becausethechangeisoutsidetheconguredtolerance.
1/A65
KONGSBERGK-Spice®
OPCTracemessages(OpcDaCom,CccOpcCom,DspiceCom,HimaCom,etc)
OnUpdateFromServerandToServerHasChangedareOPCspecictracemessagefor
allOPC-DAbasedlinks.
OnUpdateFromServer
Figure50OnUpdateFromServer
OnUpdateServerindicatesthattheOPCServerhassentthelinkavaluefortheOPCitem.
ThevalueisdisplayednextinthemessagefollowedbytheQualityfortheitem.
ToServerHasChanged
ToServerHasChangedindicatesthattheSimLinkissendingavaluetotheOPCServer.
Thewritetotheserveroccursalmostimmediatelyafterthismessage.
TSisthetimestampthatissenttotheserver,where"—"indicatesthisfeatureisnot
enabled.
4.2.6TheDiagnosticstable.TheGroupTracekeyword.
GroupTraceisintendedtobeacommondiagnosticforallSimLinkforprovidingtrace
messagesinvolvinggroupsoftags.Itwillbeimplementedasneededovertime.The
rstimplementationisforallOPCDAbasedlinksincludingOpcDaCom,DspiceCom,
CccOpcCom,etc.
GroupTraceisenabledbytheratenumberusedforupdatingtags.Youcanenableitfor
multipleratesbyseparatingthevaluesbysemi-colon.Iftheoptioneldisblank,then
theGroupTraceisenabledforallrates.
GroupsalsogettraceenabledifanytaginthatgrouphasDataTraceenabled.
661/A
TheAccessdatabase
GroupTraceoptions
Figure51Allratesareenabled
Figure52Justthe2000rateisenabled
Figure53Groupswithrate500and2000areenabled
OPCGroupTrace
OPCDAbasedlinkswillgetmessagesforonBeforeWriteandonWriteComplete.
onBeforeWriteisjustbeforetheOPCclientmethodforwriteiscalled.onWriteComplete
occurswhentheserverhasindicatedithascompletedprocessingofthewrite.
EachwritefromagroupincludesatransactionID.TheonWriteCompleteforaparticular
groupwritewillhaveamatchingID
1/A67
KONGSBERGK-Spice®
Figure54onBeforeWriteandonWriteComplete
681/A
TheAccessdatabase
4.2.7TheKSIM_XREFtable.Standardkeywords
1Id–Automaticnumericidentierfortherecord.Usedinternally
2KsimName–Nameofthemodeltag.SomeBlock:SomeV ariable
3KsimNode–SubServer(ModelServer)wheretagexists.Tobeleftblankifthetag
isfromthesubmodeldenedintheCongtableasaDefaultsubserver.Ifthetagis
fromadifferentsubmodelthenthenameofthesubmodelhastobeaddedhere.
4ItemName–NameoftheDCStag.
5ItemNode–Requiredforalllinksthathavea“Nodes”table.Givename
correspondingtooneoftheentriesin“Nodes”.BydisconnectinganodeinNodes,
allvariablesassociatedwiththisnodewillbedisabled.
6Itemtype–NotrequiredforallSimLinks.ForExatif,typeofIO,DigitalorAnalog.
7ItemAttribute–AlternatemethodofenteringAttributes(BinaryCopy,etc).
Optional
8ToSubserver–Whenchecked(-1),thedataisreadfromtheDCStoK-Spicemodel.
9Bidirectional–Whenchecked(-1),ToSubServerisignoredanddataisread/write.
10Connected–InordertotesttheIOithastobeconnected.Thisisdonebychecking
thiscell.IfanIOistobetemporarilydisconnectedorisabadtagthenonecan
uncheck(0)thiscell.
11SourceItemName–SourceDCSitemforwritingdatafromaDCStagtoanother
tag.Inwhichcase,KsimNameshouldbeblank.
12SourceFlag–Whenchecked(-1),ItemNameisusedasasourceofdatafora
SourceItemName.
13StaticValue–ThiscellisusedwhenataghastobetestedontheDCSsidebuta
correspondingK-Spicetagisnotavailable.Astaticvaluecanbeenteredinthiscell
totestifthevaluegoesintotheDCS.Staticvalueisagoodwaytotestunknown
orbadDCStags.ItisastaticvaluetosendtotheDCSinsteadofconnectingtoa
ModelServertag.
14DCSunit-Optional.ThisindicatestheunitinwhichthedataissentfromtheDCS
toK-Spice.Note:TheModelServerdoesanyrequiredconversions
15Tolerance–ThisistheminimumfractionalchangeinthevalueoftheIOrequired
fortheupdatetotakeplace.
16Invert–ABooleansignalcanbeinvertedbychecking(-1)thiscell.
17KsimComment–ThiscellistobelledbytheuserdoingtheIOasthetagsare
addedandtested.TexteldignoredbytheSimLinkavailableforProjectuse
18TestDate–ThiscellistobelledbytheuserdoingtheIOasthetagsareaddedand
tested.IgnoredbytheSimLink
19Sign–ThiscellistobelledbytheuserdoingtheIOasthetagsareaddedand
tested.IgnoredbytheSimLink
20UpdateRate–ThisistherateatwhichtheIOvalueupdateswilltakeplace.
ShouldmatchaRateNameintheUpdateRatetable.ThiscanbechangedtoFast/
Medium/Slowasneeded.
21Length0–Notcurrentlyworking.Usedforautomaticarrayconnections.
1/A69
KONGSBERGK-Spice®
22Length1–Notcurrentlyworking.Usedforautomaticarrayconnections.
Note
Mostofthenamesarestoredinstrings256characterslong.
Note
Beginningwith2.10,theSimLinkwillnowissueanerrorforaninvalidunitanddisable
theDCSitem.
701/A
KONGSBERGK-Spice®
711/A
KONGSBERGK-Spice®
721/A
TheAccessdatabase
4.2.8TheKSIM_XREFtable.Examples
ThistableincludesalltheIOtagnames.
Fourimportantkeywords:
•KsimName–NameoftheK-Spicemodeltag.SomeBlock:SomeVariable
•ItemName–NameoftheDCStag.
•ToSubserver–Whenchecked(-1),thedataisreadfromtheDCStoK-Spicemodel
•Connected–InordertotesttheIOithastobeconnected.Thisisdonebychecking
thiscell.IfanIOistobetemporarilydisconnectedorisabadtagthenonecan
uncheck(0)thiscell.
SeethesectionTheKSIM_XREFtable.Standardkeywordsonpage69foradetailed
descriptionofthecolumnsintheKSIM_XREFtable.
ThetableKSIM_XREFistheimplementationoftheCrossReferenceListintheAccess
database.CreationoftheCrossReferenceListisoutsidescopeofthisDCSLinkGuide.
ThissectionpresentsimagesoftheKSIM_XREFfromdifferentprojects,meantas
areferenceintroubleshootingsituations.SeealsothechapterCreationoftheCross
Referencelist.onpage130
Figure55TheKSIM_XREFtablefromatestofthenewAbbItsComlink
TheItemNamesarefromaMatrikonOPCServersetupforlinktest.
Figure56TheKSIM_XREFtablefromaprojectwithaOpcDaComlink
1/A73
KONGSBERGK-Spice®
Figure57TheKSIM_XREFtablefromaprojectwithaHimaComlink
Figure58TheKSIM_XREFtablefromaprojectwithaSim4MeComlink
Pleasenotethatimagesfromrealinterfacesaremanipulated.Ithasbeenanissue
toprotectthedatastructureinrealsystemsfromexposureinthisguide.Ifthereare
inconsistenciesbetweentagsinanimageandtagsinthetext,thisisprobablynota
resultofinconsistenciesintherealsystem.Thisisprobablytheresultofpoortextand
imagemanipulation.
741/A
TheAccessdatabase
4.2.9TheKSIM_XREFtable.Anexample:Twodataitems
Figure59TwodataitemsintheSOClient
TheItemNamesarefromaMatrikonOPCServerusedforlinktest.Saw-toothedWaves
andBucketBrigadearedefaultitemsintheMatrikonServer.Theitemswillnotneed
anymodicationfromtheuser’sside.Theitemsarethere,andhavevalues,whenyou
startupanyMatrikonServer.
Figure60TwodataitemsdenedinKSIM_XREF
Figure61Twodataitemsconnected
FromtheSimLinkGUIlog.
1/A75
KONGSBERGK-Spice®
Figure62TwodataitemsintheSimLinkGUI
Figure63Finally.TwodataitemsinK-Spicewatchlist
761/A
KONGSBERGK-Spice®
771/A
KONGSBERGK-Spice®
4.2.10TheSimLink_XREFtable.
TheSimLink_XREFtablecanbeleftblankforOPClinks.
ForSimLink_XREFtableisusedinlinktolinkconguration.SeeConguring
SimLink.NETtoSimLink.NETonpage81
4.2.11TheSubServerstable.
TheSubServerstable.
TheSubServerstablemustcontainthenameoftheapplicationcontainingtheK-Spice
model.IntheexamplebelowthesimulationapplicationiscalledProcessModel,part
oftheEngineeringTimelineofK-Spice.
Figure64TheSubServerstable.Anexample
Figure65TheSubServerstable.Anotherexample
781/A
TheAccessdatabase
4.2.12TheUpdateRatetable
Figure66TheUpdateRatetable
ThekeywordUpdateRateintheKSIM_XREFtablecanbemodiedusingthistable.
Note
AsandwhentheIOtags/statictagsaremodiedintheAccessdatabase,thedatabase
hastobereloadedintotheExatifComlinkinordertodotheIOconnectionsbetween
theK-SpicemodelandYokogawaDCS.ThisisdoneusingtheReloaddatabasetabin
theSimLinkGUI.
1/A79
KONGSBERGK-Spice®
4.2.13TheWatchdogItemstable.
2.9.3.0ofSimLinksimplementedawatchdogfeatureforDCSitems.Theusercongures
DCStagsthatshouldbemonitoredbythelink.Ifthosetagsdon'tchangevaluesfor
TimeoutMillisecondswhilethemodelisrunning,itwilltreatedasawatchdogexpiration.
ComponentStatus.WatchdogAnyExpiredwillbesettotrueifanyconguredwatchdogis
expired.Speciclinksmayalsohavebuilt-inwatchdogs(SoftLogixCom,forexample).
ComponentStatus.WatchdogAnyExpiredcanchangebacktotruefromfalseifallvalues
havechangedwithintheirtimeoutperiod.
WatchdogitemsareconguredinthedatabasetableWatchdogItems.Currently
(2.9.3.0),elementsofarraysarenotsupported.
Table5CongurationofWatchdogitems
IdAutomaticrownumber
LocalNameNameoftheDCStag
LocalNodeNotrequiredforallSimLinks.
DCSnodewheretagexists.ThePLCinSoftLogixCom,
forexample.
ConnectedWhenunchecked(0),recordisignored.
UpdateRateUpdaterateofitem.ShouldmatchaRateNameinthe
UpdateRatetable.
TimeoutMillisecondsMaximumtimeinmillisecondsthevaluecanbe
unchangedbeforeawatchdogexpiration.Shouldbeat
leasttwiceaslongasUpdateRate.
CommentTexteldignoredbytheSimLinkavailableforProject
use.
ThisisasampleconguredusedfortestingwithOpcDaComandMatrikonOPCServer
forSimulation.Random.Int4changesfrequently.BucketBrigade.Int4doesnot
automaticallychange,soitwaseasytoseeWatchdogAnyExpiredtogglingbetween
falseandtrue
Figure67SampleofWatchdogItems
801/A
TheAccessdatabase
4.3ConguringSimLink.NETto
SimLink.NET
ThisisasectioninthechapterTheAccessdatabasethatdescribestheconguration
necessaryforsendingdatainoneDCSlinkdirectlytoanotherDCSlink.SeveralAccess
databasetablesareinvolved.ThemostessentialhereisthetableSimLink_XREF.
4.3.1CongureSubServersTable
InordertocongureaconnectionfromoneSimLink.NETtoanotherSimLink.NET,you
mustcongurethetargetSimLinkintheSubServersdatabase.
BelowisaCccOpcComapplicationconguredtoconnecttoanOpcDaComapplication
namedOpc.
Figure68TheSubserverstable.Linktolink.
4.3.2CongureItemConnectionsinSimLink_XREF
TheSimLink_XREFtableissimilartoKSIM_XREFtable.Youshouldcongurethe
SimLink_XREFtablefortaginaSimLinkthataregoingtoreceivedatafromtheremote
SimLink.
BelowisaCCCexamplethatconguresC1\Point2toreceivedatafromOpc\Bucket
Brigade.Real8.
Figure69TheSimLink_XREFTable
4.3.3ActivateSimLinkTWICEfornewconnections
ThersttimeaSimLinktriestosubscribetoaremotedatapoint,theconnectionmayfail
becausethetheremoteSimLinkmaynotknowtomakethepointavailable.However,
theremoteSimLinkwillsavetheinformationsoitcancreatethepointthenexttimeit
starts.ThisinformationissavedinthetableAdditionalDcsItems.
1/A81
KONGSBERGK-Spice®
BelowisanentryfromtheOpcapplicationaftertherstconnectionattempttoBucket
Brigade.Real8.
Figure70ThetableAdditionalDcsItems
4.3.4Conguringunitconversionforlink-to-link
Beginningwithversion2.10.0.0,link-to-Linkcandounitconversions.Inorderto
dotheconversions,youmustconguretheunitcategoryandtheitemunits.The
SimLink_XREFtablehas3eldsforthisconguration.
Conversionwillnotoccurif:
•Invertisset
•Anyoftheunitcongurationeldsareblank
Table6Unitkeywords
FieldPurpose
UnitCategoryTheUnitCategoryfortheitems
Example:temperature
LocalUnitTheunitofthelocalitem
Example:C
RemoteUnitTheunitoftheremoteitem
Example:F
Figure71UnitKeywords.Example
821/A
SoftingandMatrikonOPCtesttools
5SoftingandMatrikon
OPCtesttools
Thesearetwoveryusefultesttools.TheMatrikontesttoolscanbedownloadedfree
frominternet.
Softingtesttool
Softing’sSOClientisusedasaOPCclient.TheprogramreadsdatafromanyOPCsever.
TheSoftingOPCclientreadsthesamedataK-Spicereads.IftheSOClientcanread
them,itisagoodreasontobelievethatK-Spicecanreadthem.
Matrikontesttool
MatrikonOPCisusedtosetupatestOPCserver.
TheMatrikonOPCtestservercanbesetupwithtagswithinsameformatastagsinthe
actualDCS.Thetagsintheserveralsohavevalues.IfK-Spicecanexchangevalues
theMatrikonserver,itisagoodindicationthatK-Spicecanreaddatafromandwrite
datatotheDCSserver.
ThereisalsoaprogramcalledMatrikonOPCExplorerthatreadsOPCdata.The
MatrikonOPCExplorerandtheSOClientaretwoprogramsthatdothesamething.
ThecompanyMatrikonOPCdeliversOPCserversforautomationvendors.Fromtheir
websiteyoucandownloadfreeapplicationsfortestofOPCcommunication.
•MatrikonOPCSimulationServer
•MatrikonOPCExplorer
•MatrikonOPCHDAExplorer
URLstotheMatrikondownloadpages:
IfyoudownloadtheMatriconOPCSimulationServer,itisnotnecessarytodownloadthe
Explorer.TheExplorerispartoftheSimulationServerdownload
www.matrikonopc.com/products/opc-drivers/opc-simulation-server.aspx
www.matrikonopc.com/products/opc-desktop-tools/opc-explorer.aspx
www.matrikonopc.com/products/opc-desktop-tools/opc-hda-explorer.aspx
1/A83
KONGSBERGK-Spice®
Note
Softing’ sSOClient.exeisnotavailableasfreedownload.Askafriendforacopy.
841/A
SoftingandMatrikonOPCtesttools
5.1TheSoftingOPCclienttool
SoftingOPCToolboxhasanapplicationtosetupanOPCtestclient.Theapplicationis
calledSOClient.exe.
TheSOClientcanbeusedtoreadOPCvaluesandwriteOPCvalues.Thesamevalues
thatK-Spiceissetuptoreadandwrite.Theapplicationwillbeatestprogram,in
paralleltoK-Spice.ItcanbeusedintheinitialphasetocheckiftheModelPC,andthen
K-Spice,hasaccesstotheDCSvalues.
SetupforaccesstodatainaMatrikonServeronthelocalPC.
•RunSOClient.exe
•IntheSOClientMainWindow
UndertabOPCServersTreeroot:Local→DataAccessV3(thisisOPCformatversion
3)→MatrikonOPCServerforSimulationandTesting
•RighthandclickonMatrikonOPCServerforSimulationandTesting→AddServer
•Verifythatadefaultsubscriptionopensintheleftwindow.Thedefaultsubscriptionis
calledGroup.
Figure72SoftingOPCToolboxDemoClient
•OpentabDABrowse
•RighthandclickonMatrikonOPCServerforSimulationandTesting→AddItems
forAlltags
•VerifythatthedatasubscriptioncalledGroupislledwithalltheDefaulttagsinthe
MatrikonServer.
1/A85
KONGSBERGK-Spice®
•OpentabDAItemsBothwindowsarelledwithtags.Seethegurebelow.
SetupforaccesstodatainaDeltaVServeronanothermachine.
•RunSOClient.exe
•IntheSOClientmainwindow→ManualTypeintheIPaddressoftheDeltaV
machine.Itcanbetrickytowritetheaddress,clickontheactualeldmorethanonce,
togetintowritemodeforatextstring.
Figure73FindanOPCServerwiththeIPaddress
OpenthetreeforserversanddatainserversontheOPCServermachine.Righthand
clickonthenameonthemachine→AddServertoaddittolistofserversintheleft
eldofthemainwindow.
861/A
KONGSBERGK-Spice®
ComparethevalueintheSOClientwiththevalueinK-SpiceSimExplorer
Thesetupisthis:
•TheDemoProjectisopenedinK-Spice
•TheMatrikonOPCServerisstarted.NodataitemisaddedtotheServer.TheServer
hasonlythedefaulttags,i.eBucketBrigade.Real8
•ThelinkapplicationAbbItsComisaddedtotheDemoProject,underthetimeline
OTS_ABB.
•ACrossReferenceisenteredintheAccessdatabasethatispartoftheAbbItsComlink
TheCrossReferenceisbetweentagBucketBrigade.Real8intheMatrikonServerand
thedataitem23PT0001:MeasuredValueintheK-Spicemodel.
Figure76ThetableKSIM_XREFintheAccessdatabaseforAbbItsCom
ModifytheK-Spicevalue
SetanewvalueinK-Spice,andverifythatthevalueinSOClient,isupdated.
Figure77NewK-Spicetransmittervalue
TheSoClienthasasubscriptiontothetagBucketBrigade.Real8intheMatrikonServer.
BucketBrigade.Real8isnow26.
881/A
KONGSBERGK-Spice®
5.2ErrormessagesinSoftingOPCclient
tool
AboutOPCEnum
TheOPCEnumeratorisabrowserforlocalorremoteOPCserverapplications.The
OPCFoundationisresponsiblefortheapplicationOpcEnum.exe,Theapplicationispart
ofresdistributablepackagesincludedinmostSCADAsoftware.Thisapplicationis
requiredbyOPCServers/ClientstolistdowntheOPCserversinstalledonacomputer.
Theapplicationwillbeinstalledonamachineaspartoftheinstallationofanyofthe
K-SpiceOPCSimLinks.
TheDCOMsecurityisnotopeneduponaDeltaVServer.
TherecanbesituationswheretheSOClientandtheK-SpiceSimLinkcanseeanOPC
Serveronanothermachine,butnodatacanbetransferred.TheOpcEnumproperties
ontheOPCServermachinemustbeopenedupforreadaccess.WhenanOPCClient
applicationconnectstoaremotecomputerandattemptstobrowseforOPCServers,itis
actuallyconnectingtoOpcEnum.exeontheremotePC.OpcEnumretrievesthelistof
OPCServersonthecomputeronwhichitresides.TheinabilitytoconnecttoOpcEnum
istypicallyaresultofauthenticationfailure.SeeModifytheDCOMcongurationon
page122
Figure79FailedtocreatemessageinSoftingtool
901/A
SoftingandMatrikonOPCtesttools
5.3TheMatrikonOPCServer
TheMatrikontesttoolconsistsoftheMatrikonOPCSimulationServerandthe
MatrikonOPCExplorer.TheMatrikonOPCServergeneratessimulatedDCSvalues
inOPCformat,andisthemostimportantofthetwoapplications.TheMatrikonOPC
ExplorerreadsOPCdata.TheSoftingOPCClienttoolandtheMatrikonOPCExplorer
dothesamething.
SeeSoftingandMatrikonOPCtesttoolsonpage83forURLstothedownloadpages.
Figure80TheMatrikonOPCServer
TheMatrikonOPCServerandK-Spicewillnormallyrunonthesamedesktopmachine.
TherecanalsobesituationswheretheDCSvendorhasinstalledaMatrikonOPCServer
ontheDCSmachinefortestpurposes.
TheMatrikonOPCServerisusedtoverifythattheDCOMsettingsontheModelPCare
correct.ThetestwillbeifK-SpicecanreadandwriteOPCvaluesintheMatrikonOPC
Server.Theapplicationwillbeatestprogram,inparalleltotheDCSOPCserver.If
thelinkcanaccesstheMatrikonvalues,itisanindicationthatitalsocanalsoaccess
theDCSvalues.
TheMatrikonOPCServerhastwodifferenttypesofdata.Inthenextsectionisdescribed
howtheservercanbesetuptosendtwoOPCvaluesinYokogawatagformattoK-Spice.
Theothertypeofdataisadefaultsetoftags.Youwillndthedefaultsetoftagson
anyMatrikonOPCServer.Thedefaulttagsethascharacteristicnames,Random.Int4,
BucketBrigade.Real8,BucketBrigade.Int4Saw-toothedWaves.Real4
1/A91
KONGSBERGK-Spice®
Note
IfyouhaveaMatrikonOPCServerinstalledonyourmachine,youcanexperiencethe
thatServerstartsautomatically.Ifalinkasksfordata,theServerwillstart.
Thiswillbethesituationwherethedefaultsettingsofalink,I.E.theHimaComlink,
hasMatrikonasthedefaultOpcServer .IfyoudonotmodifythetheOpcServerinthe
CongtablewhenyourstcreatetheAccessdatabase,andthenactivatethetimeline,
theMatrikonOPCServerwillstart.TheHimaComlinkwillconnecttotherunning
MatrikonOPCServer ,andthelinkwillconnectto4defaultMatrikontags.Atlink
startup,4defaultstaticvalueswillbewrittenfromtheHimaComlinktotheServer .
5.4TwotagsintheMatrikonOPCServer
Starttheserver
StarttheMatrikonOPCSimulationServerfromtheWindowsStartmenu→MatrikonOPC
ServerforSimulation
ImportAliases
Thetestserverwilltypicallybeconguredtosendawholearrayofvalues.Thestarting
pointwillthenbeanExcelsheetwithallthetagsintheactualY okogawaserver.To
simplifythedocumentation,wewillonlyhandletwotagshere.Thestartingpointisthe
leTwoTags.csv,acommaseparatedle,withtwotagsinit.Acommaseparatedlecan
easilybeexportedfromanExcelsheet.
DataType5isdouble.DataType11isboolean.
Figure81TwoTags.csv
InthetheMatrikonOPCServermainwindowFile→ImportAliasesTwoTags.csv
SavetheServercongurationasTwoTags.xml
921/A
SoftingandMatrikonOPCtesttools
CreateAliasesmanually
Onealternativeistoimportacommaseparatedle,theotheralternativeistocongure
theMatrikonOPCServermanually.Withmanualcongurationthestartingpointis
anemptyMatrikonOPCServer.
Inthepaneonthelefthandside,calledCurrentconguration,righthandclickonmenu
itemAliasConguration.SelectInsertAliasGroup.
Figure82InsertAliasGroup
RenamethenewaliasgrouptoPI-602–602.Righthandclickonthenewmenuitem
PI-602–602.SelectInsertAliasGroup
RenamethenewaliassubgrouptoPV .
DoubleclickonthenewmenuitemPV.Inpaneontherighthandside,calledContentsof
aliasgroup‘PV’,doubleclickontheemptyline.ThedialogInsertNewAliaspopsup.
1/A93
KONGSBERGK-Spice®
InthedialogInsertNewAliasllinName:PVandDataType:REAL8andUpdate
Rate:100.Savethesettings.
Figure83
CongurethesecondaliasPI-604–604inthesameway.
SavetheServercongurationasTwoTags.xml
ImportAliasesvs.CreateAliasesmanually.
Thereisnodifferencebetweenthetwowaysofsettingupthecongurationforthe
MatrikonOPCServer.Theresultisthesame.ThelesTwoTags.xmlcreatedwitha
commaseaparatedle,andTwoTags.xmlcreatedmanually,areidentical.
941/A
SoftingandMatrikonOPCtesttools
Figure84TheleTwoTags.xmlsavedfromMatrikonOPCServer
TheMatrikonOPCExplorer
IntheMatrikonOPCServermainwindowclickthebuttonViewOPCT agsforthisServer.
Figure85StarttheMatrikonOPCExplorerfromtheServer
IndialogMatrikonOPCExplorer(Group0)addtagsbyclickingonPI-602–602inthe
windowAvailableItems
InthewindowAvailableTagsdoubleclickonPV .
1/A95
KONGSBERGK-Spice®
Figure86AvailabletagsintheExplorer
VerifythatPI-602–602.PViswritteninthewindowTagstobeadded.Addbothtags.
961/A
KONGSBERGK-Spice®
Figure88Group0inTwoTagsSession.
Figure89TheleTwoTagsSession.xmlsavedfromMatrikonOPCExplorer
SetvaluesintheMatrikonOPCServer
IntheMatrikonOPCExplorermainwindow,doubleclickonPI-602–602.PV,inwindow
ContentsofGroup0.V erifythatthedialogWriteValuesopens.
InthedialogWritevaluessetPI-602–602.PVtoV alue22
DothesameforPI-604–604.PVandsetthatV alueto33.
981/A
KONGSBERGK-Spice®
5.5TwotagsintheOpcDaComlink
ThissectioncontinuestheexamplewithTwotagsintheprevioussection.TheTwotags
conguredintheMatrikonOPCServer,isreadinK-SpiceviathelinkOpcDaCom.
CongurationoftheOpcDaComlinkinK-Spice
SeeCreatealinkapplicationintheK-Spiceprojectonpage18foramoredetailed
description.ThefollowingisashortdescriptionofthethreerelevanttablesintheAccess
database.
ThersttableconnectsthevariableswiththeRealTimetimeline,viathekeyword
KsimNodeinthetwotablesSubServersandCong.
Figure91TheSubServerstabledenesthetimelineofthevariablesintheAccess
databasefortheOpcDaComlink
TheCrossReferenceListissetupasdifferentkeywordsintheKSIM_XREFtable
Figure92TheKSIM_XREFtableintheAccessdatabase
K-SpiceconnectstotheMatrikonOPCServerwiththeinformationintheCongtable.
1001/A
KONGSBERGK-Spice®
StartK-SpiceandreadtheTwotags
ThenextstepistoopentheprojectinK-Spice.ActivatetheRealTimetimeline,and
loadthemodel.
Figure94ActivetimelinewithanOpcDaComlink
WatchtheSimManagerconsole,andlookforerrormessages.TheSimLinkGUI,the
mainwindowfortheOpcDaComopens.
Openthelogleforthelink.V erifythattheOPCtagsandtheK-Spicetagsare
connected.
Intheloglebelowthemessageswithoutinterest,arelteredout.
1021/A
SoftingandMatrikonOPCtesttools
Figure95TheloglefortheOpcDaComlink
SetanewvalueintheOPCServer
DoubleclickononeofthetwotagsintheMatrikonOPCExplorer,andenteranewvalue
inthedialogWriteValues,asexplainedabove.TheK-SpicemodelcanbeinPause.
VerifythatthenewvaluesfortheTwotagsintheOPCservercomethroughto
K-Spice.
Figure96ThenewOPCServervaluesinK-Spice
1/A103
KONGSBERGK-Spice®
5.6TheMatrikonOPCHDAExplorer
VericationoftransferofdatafromanOPCHistoricaldatabasewithMatrikonOPC
HDAExplorer
UrltoMatrikon:
www.matrikonopc.com/products/opc-desktop-tools/opc-hda-explorer.aspx
DirectlinktoMatrikon
AfterrunningMatrikonOPCHDAExplorer,selectyourtargetserverinthedropdown
andthenclicktheconnecticon.
Figure97Connecttoserver
Thenright-clickontheserverintheconnectiontree.ThenleftclickonAddItems
1041/A
KONGSBERGK-Spice®
Figure99Additemstotaglist
YoucanalsotypethenameintheItemIdtextbox.Thenclickthebluearrow.
1061/A
KONGSBERGK-Spice®
Figure101AddmoreitemstotheMatrikonOPCHDAExplorer
1081/A
KONGSBERGK-Spice®
Figure103UseReadrawtogetdata
Enterastarttimeandanendtimeinthedialogbox.MaxNumValuesof0instructsthe
servertoreturnalldatawithintimerange.ClickReadRawtogetthedatafromtheserver.
Figure104SetintervalintheReadRawdialog
Ifsuccessful,MatrikonOPCHDAExplorerwillshowtheresults.
1101/A
KONGSBERGK-Spice®
6OPCDCOMconguration
Aboutthischapter.
Therearethreeimportantsectionsinthischapter.
DCOMcongurationforAbbItsComonpage112.Thenamesarespecicforthe
ABBITSsystem.ThestepsshouldberelevantforconguringDCOMcommunication
onanysystem.
Checkthelocalsecuritypolicysettingsonpage121andModifytheDCOMconguration
onpage122ThesetwosectionsaremoreorlessanalternativetothesectionDCOM
congurationforAbbItsCom.Thesetwosectionshavefocusonopeningupanysecurity
settingthatcanblockthecommunication.
6.1DCOMcongurationforAbbItsCom
Aboutthissection
ThisisadescriptionspecicforthetheAbsItsComlink.Ifyouareworkingwith
otherlinks,therearethingsinthissection,thatcanberelevant.Sothissectionisnot
proledtobepartofthelinkguidefortheAbsItsComlink,only.Thissectionispartof
allthelinkguides.
TheOPCservernameITSOPCDASERVER.ITSOPCDASurrogate.1isastandardname
onABB’sAspectServers.OnaHIMAServerthecorrespondingnameoftheOPC
ServercanbeHIMA.PLC_1.DA.1
Forgeneraldescriptionofinstallationofalink,SeeCreatealinkapplicationinthe
K-Spiceprojectonpage18
InstallationofABBsoftware
TheABBsoftwarepackagecalled"800xASimulatorLinkStandaloneClient"mustbe
installedontheModelPC.Notethatinolderversionsof800xA,thissoftwareiscalled
"ITSLinkStandaloneClient".Thepackageisalsoreferredtoasthe“ITSlink”
Thetextbelowrefertotheuseraccount800xAServiceAccount.Onotherinstallations
theuseraccountiscalled800xAServAcc!Y oucanopenServicesontheAspectServerto
ndthenameoftherelevantuseraccount.
1121/A
OPCDCOMconguration
OnsomeplantstheOPCDataServercanbeinstalledonathirdmachine,theEngineering
PC.InthissituationtheOPCDataServerontheEngineeringPCisareplicaofthe
OPCDataServerontheAspectServer.
Therearenoguresinthechecklistsbelow.Inthiswaythelistsarecompactandeasyto
read.Y ouwillndtherelevantguresattheendofthesection.
1/A113
KONGSBERGK-Spice®
DCOMcongurationforAbbItsCom
Checklistonbothmachines
1VerifythatboththeModelPCandtheAspectServeraremembersofthesame
domain.
Youcanverifythecomputer’sdomaininacmd.exewindow.Writesetuand
return.YouwillgettheUSERDOMAIN
Thecomputer’sdomainisalsoveriedintheControlpanel→User
Accounts→ManageUserAccounts
DomainonWindowsServer2003and2008
WindowsServerscanbesetupwithActiveDirectoryandDomains.TheServers
canalternativelybesetupwithonlyUsersandGroups.Iftherearenodomain,the
setuinthecommandwindowwillshowUSERDOMAINandthemachinename.
2Verifythattheclocksaremoreorlesssynchronized.
3TheWindowsusermusthaveAdministratorrightsonbothmachines.
ThisisnecessarywhentheAbbItsComlink,installedontheModelPC,startsthe
ITSOPCserver,ontheAspectServer.TheITSOPCserveristheapplication
ITSOPCDASurrogate.exe.
YoucansettheAdministratorrightsbyopeningAdministrativeTools→Computer
ManagementandndLocalUsersandGroups→Groups
1141/A
OPCDCOMconguration
DCOMcongurationforAbbItsComcontinued
ChecklistontheAspectServer
4Verifythattheuserortheuser’sgroupispartoflocalgroupAdministrators.
YoucandothatbyopeningComputerManagementandndLocalUsersandGroups
→Groups
5IftheWindowsFirewallisenabled,makeanExceptionfor
ITSOPCDASurrogate.exe.
ExceptiononaWindows7andServer2008:
ThisisdoneintheControlpanelOpenAdministrativeTools→WindowsFirewall
→AllowaprogramorafeaturethroughWindowsFirewall
IndialogAllowedPrograms:ChangesettingsAllowanotherprogram.IndialogAdda
program:Browse.LocateITSOPCDASurrogate.exe.Addtheprogramtothelist
ofallowedprogramswiththebuttonAdd.LeavetheBrowserwithOKandverify
thatITSOPCDASurrogateislistedinthewindowPrograms.
VerifythatITSOPCDASurrogateisinthelistAllowedprogramandfeaturesand
thatthebuttonDomainischecked.Seegurebelow:K-SpiceABBITSCominthe
listAllowedPrograms.
ExceptiononWindowsXPandServer2003:
MakeanExceptionintheWindowsFirewall.Seethegurebelow:Excpetions
onaWindowsServer2003machine.
6ITSOPCDASurrogatemustbesettorunasuser800xAServiceAccount.
Beforeyoucandothis,youmustknowthepasswordfortheuser
800xAServiceAccount.
Tosettheuser800xAServiceAccount:
StartwiththeControlpanel.OpenAdministrativeTools→ComponentServices.
IndialogComponentServices:GotoConsoleRoot→ComponentServices
→Computers→MyComputer→DCOMCongYouwillseeaeldoficonshere.
YoucanchangetheiconstoalistviewwitharightclickonDCOMCong.→View
→Details
FindITSOPCDASurrogate
RighthandclickontheiconITSOPCDASurrogateorthecorrespondinglistitem,
then→Properties
IndialogITSOPCDASurrogateProperties:OpentabIdentifySelectThisuserEnter
User:800xAServiceAccountandPassword.
1/A115
KONGSBERGK-Spice®
DCOMcongurationforAbbItsComcontinued.
ChecklistontheModelPC
7AddthekeyHKEY_LOCAL_MACHINE\Software
\Classes\ITSOPCDASERVER.ITSOPCDASurrogate.1intheRegistry.
Awaytodothisistostartregedit.exeontheAspectServer,andexportthe
actualkeyasa.regle.Thenimportthe.regletotheregistryontheModelPCby
copyingtheleovertotheModelPCanddoubleclickonit.
Thisisanexampleofa.regle:
OPC/Vendor:ABBAS
CLSID:{023CD2A3–43BA-4435–BBF6–ECBC2D6BDDCE}
Seethegurebelow,RegistryleforaHimalink.
8IftheWindowsFirewallisenabled,itmaybenecessarytoopenTCPport135.
9IftheWindowsFirewallisenabled,makeanExceptionforAbbItsCom.exe.
ExceptiononaWindows7andServer2008:
ThisisdoneintheControlpanelOpenAdministrativeTools→WindowsFirewall
→AllowaprogramorafeaturethroughWindowsFirewall
IndialogAllowedPrograms:ChangesettingsAllowanotherprogram.IndialogAdda
program:Browse.LocateAbbITSCom.exe.Addtheprogramtothelistofallowed
programsthebuttonAdd.LeavetheBrowserwithOKandverifythatK-SpiceABB
ITSComislistedinthewindowPrograms.
VerifythatK-SpiceABBITSComisinthelistAllowedprogramandfeaturesand
thatthebuttonDomainischecked.Seegurebelow:K-SpiceABBITSCominthe
listAllowedPrograms.
ExceptiononWindowsXPandServer2003:
MakeanExceptionintheWindowsFirewall.Seethegurebelow:Excepetions
onaWindowsServer2003machine.
10Itmightbenecessarytoaddtheuser800xAServiceAccountunderDefaultAccess
permissionsandLaunchandActivationPermissions.
However,thisisoftenthestandardifbothcomputersareinthesamedomain.
ThisisdoneintheControlpanel(InControlpanelwith8items,openSystemand
security.)OpenAdministrativeTools→ComponentServices.
IndialogComponentServices:GotoConsoleRoot→ComponentServices
→Computers→MyComputer
ThesettingsforaddingauserisfoundinCOMSecurity:
RighthandclickonMyComputer→Properties→COMSecurity.
IndialogMyComputerPropertiesselecttabCOMSecurity
11CheckthatthenameoftheABBOPCserveriscorrectinthecongtableinthe
Accessdatabase.
WhenAbbItsComisrunningontheModelPCandconnectingtothe
OPCserverrunningontheAspectServer,thecorrectOPCnameis
ITSOPCDAServer.ITSOPCDASurrogate.1
1161/A
KONGSBERGK-Spice®
TwodialogsforsettingException:
Figure106AllowedProgramswithK-SpiceABBITSComonaWindows7machine
1181/A
KONGSBERGK-Spice®
NameoftheOPCServerintheCongtable.
ThistableisfromtheoldC++versionoftheAbbItsComlink.
Figure108NameoftheOPCServerwhentheServerisrunningontheModelPC
Figure109RegistryleforaHIMAlink
File:PLCA.reg
Pleasenoticethatmanyscreenshotsinthisguidearemanipulated.Thepolicyhasbeen
todisguisetherealnamesandstructuresandtherealurls’softheDCSdatabases.Data
itemsfromaK-Spicedemoprojectarenormallyuntouched.Dataitemsnamesfrom
realprojectsarenormallymanipulated.
HIMA.PLCA.1and{AA8326BC-8FAA-8FAA-8FAA-8325832FB733}areboth
manipulations.TheformatisthesameastheformatfortherealHimadatabase.Usethe
functionalityBrowseOPCServersintheSimLinkGUItondtherealvalues.
1201/A
OPCDCOMconguration
6.2Checkthelocalsecuritypolicysettings
ThissectionisrstpartofaWikipagecalledOPCDCOMconguration
SeethesecondpartoftheWikipageinthenextsectionModifytheDCOMconguration
onpage122
ThefollowingsettingmaybeusedtoopenupOPCcommunications
•GototheStartmenu→ControlPanel
•OpenAdministrativeTools
•OpenLocalSecurityPolicy
•IndialogLocalSecurityPolicy:
•BrowsetoSecuritySettings→LocalPolicies→SecurityOptions
IndialogLocalSecurityPolicy,pagePolicy
RightclickonDCOM:MachineAccessRestrictionsandselect→Properties
•ClickonEditSecurity
•IndialogAccesspermission:
•AddAnonymous,Everyone,Interactive,Network,Systemwithalllocalandremote
permissionssettoAllow.
•ClosethedialogwithOK
RightclickonDCOM:MachineLaunchRestrictionsandselect→Properties
•ClickonEditSecurity
•IndialogLaunchandActivationPermission:
•AddAnonymous,Everyone,Interactive,Network,Systemwithalllocalandremote
permissionssettoAllow
•ClosethedialogwithOK
RightclickonNetworkaccess:LetEveryonepermissionsapplytoanonymoususersand
select→Properties
•IndialogNetworkaccess:LetEveryonepermissionsapplytoanonymoususers:
•SelecttheEnabledradiobutton
•ClosethedialogwithOK.
1/A121
KONGSBERGK-Spice®
6.3ModifytheDCOMconguration
ThissectionisthesecondpartofaWikipagecalledOPCDCOMconguration
SeetherstpartoftheWikipageintheprevioussectionCheckthelocalsecuritypolicy
settingsonpage121
ModifytheDCOMconguration.
GototheStartmenuandrundcomcnfg.exe:
•InthebottomeldwiththetextSearchprogramesandlesenterdcomcnfgandenter .
ThiswillbringuptheComponentServicesbrowserwindow.
MycomputerProperties
•IndialogComponentServices:
•BrowsetoConsoleRoot→ComponentServices→Computers→MyComputer
•RightclickonMyComputerandselect→Properties
InthedialogMyComputerProperties:
ThetabDefaultProperties
•EnableDistributedCOMonthiscomputer
•SetDefaultAuthenticationLeveltoConnect
•SetDefaultImpersonationLeveltoIdentify
ThetabDefaultProtocols
•Connection-orientatedTCP/IPshouldbetheonlyonelisted.
ThetabComSecurity
InframewithsubtitleAccessPermissions
•ClickonEditDefault
•IndialogAccessPermission:
•AddAnonymous,Everyone,Interactive,Network,Systemwithalllocalandremote
permissionssettoAllow.
•ClosethedialogwithOK
•ClickonEditLimits
•IndialogAccessPermission:
•AddEveryonewithalllocalandremotepermissionssettoAllow.
•ClosethedialogwithOK
InframewithsubtitleLaunchandActivationPermissions
•ClickonEditDefault
•IndialogLaunchandActivationPermission:
1221/A
OPCDCOMconguration
•AddAnonymous,Everyone,Interactive,Network,Systemwithalllocalandremote
permissionssettoAllow.
•ClosethedialogwithOK
•ClickonEditLimits
•IndialogAccessPermission:
•AddEveryonewithlocalandremotepermissionsforbothlaunchandactivationset
toAllow.
•ClosethedialogwithOK
OpcEnumProperties
•IndialogComponentServices:
•BrowsetoConsoleRoot→ComponentServices→Computers→MyComputer→DCOM
Cong
YoucanrighthandclickonDCOMCong→View→DetailsYouwillseetheobjectsin
alist,notobjecticons
•Findtheicon/entryOpcEnum.RightclickonOpcEnumicon/entryandselect
→Properties
InthedialogOpcEnumProperties:
ThetabGeneral
•SetAuthenticationlevelto→Default
ThetabLocation
•SetRunapplicationonthiscomputerto→On
ThetabSecurity
•SetLaunchandActivationPermissionsto→UseDefault
•SetAccessPermissionsto→UseDefault
•SetCongurationPermissionsto→Customize
ThetabSecurityintheframewiththesubtitleCongurationPermissions
•ClickonEdit
•IndialogChangeCongurationpermissions:
•AddAnonymous,Everyone,Interactive,Network,Systemwithalllocalandremote
permissionssettoAllow.
•ClosethedialogwithOK
ThetabIdentity
•SetThesystemaccountto→On
1/A123
KONGSBERGK-Spice®
RSLinxProperties
RSLinxisthenameofaspecicOPCServer.DothiscongurationfortheactualOPC
Server.
YouwillndRSLinxonthesamepagethatyoufoundOpcEnumintheprevioussection.
Ifyoustartfromthetop,youwillndRSLinxhere:
•IndialogComponentServices:
•BrowsetoConsoleRoot→ComponentServices→Computers→MyComputer→DCOM
Cong
YoucanrighthandclickonDCOMCong→View→DetailsYouwillseetheobjectsin
alist,notobjecticons.
•Findtheicon/entryRSLinx.RightclickontheRSLinxicon/entryandselect
→Properties
InthedialogRSLinxProperties:
ThetabGeneral
•SetAuthenticationlevelto→Default
ThetabLocation
•SetRunapplicationonthiscomputerto→On
ThetabSecurity
•SetLaunchandActivationPermissionsto→UseDefault
•SetAccessPermissionsto→UseDefault
•SetCongurationPermissionsto→Customize
ThetabSecurityintheframewiththesubtitleCongurationPermissions
•ClickonEdit
•IndialogChangeCongurationpermissions:
•AddAnonymous,Everyone,Interactive,Network,Systemwithalllocalandremote
permissionssettoAllow.
•ClosethedialogwithOK
ThetabIdentity
•SetThesystemaccountto→On
•ClosethedialogwithOK
Note
Rebootthecomputer
1241/A
OPCDCOMconguration
6.4ODBCDataSourceAdministrator
Fortheoldlinks,thedirectoryfortheAccessdatabasemustbeaddedasacomputer
systemconguration.ThisisthecasefortheoldAbbItsComlink,andotheroldlinks.
Thiscongurationmustbemodied,ifnexttimeanotherlinkshallrunonthecomputer.
OnaWindows7machine,run:C:\Windows\SysWOW64\odbcad32.exe
Ona32bitmachine,run:C:\Windows\System32\odbcad32.exe
IndialogODBCDataSourceAdministratorbuttonAdd
IndialogCreateanewDataSource:select→MicrosoftAccessDriver(*.mdb,*.accdb)
andFinish
IndialogODBCMicrosoftAccessSetup:DataSourceName:AbbItsComandDatabase:
Select
IndialogSelectDatabasebrowseto
C:\K-Spice-Projects\Demo_ABB_CPP\TimeLines\OTS_ABB_CPP
\Applications\ABB\AbbItsCom.mdbExitwithOK
Figure110ODBCconguredtoreadtheAbbItsComdatabase
1/A125
KONGSBERGK-Spice®
7Variabletransfer
betweenDCSand
K-Spice
Thisischaptercoversthebasicdatatransferfunctionalityinthelinks.Notcovered
inthismanualareissueslikeTiming,Firewallghting,onewayversustwoway
communication,historicalvalues,IPaddresses,Handshakeprotocols,Portsandmore.
7.1DCSconnectionphilosophy
TheideaofconnectingaK-Spicedynamicsimulationmodeltoa“soft”controller
implementationofaDCSistostimulate(provideequivalentsignalrepresentations)the
systemsoitoperateslikeitisactuallyconnectedtoarealplant.Thissituationallows
themodeltorununderDCScontrolwithmodelvariablesbeingconnectedtotheeld
inputsandoutputsofthesystem.
TheDCSlinkshouldincludethefollowingfunctionality:
•Conguringthefrequency(samplingrate)ofamodelvariable.
•Conguringtheindividualtoleranceofavariabletodetermineiftherehasbeen
signicantchangesinthemodelthatrequiresthetransferofavariable.
•MappingofvariablesbetweentheK-SpicemodelandK-Spice®.
•Scalingofvariables.
•SendingstaticvaluestoselectedDCSinputs.
Thecontrolsignalsrequiredtobemappedareusuallybetweentransmitters,valves,
electricmotors,localcontrolloopsandemulatedsequences.Thesafetysignalsfrom
K-Spice®arealsousuallyconnectedtoshutdowninputsonvalvesandelectricmotors.
Thebelowgureshowsasimplediagramdepictingtwocommonconnectionsbetweena
K-SpicemodelandaDCSsystem,wherethetransmittersignalinthemodelissentto
theDCScontrolfunctionblock.TheoutputoftheDCSfunctionblockshown,avalve
controlsignal,issentbacktothemodeltoregulatethecontrolvalve.
1261/A
VariabletransferbetweenDCSandK-Spice
Figure111AK-Spice/DCSinterface
AtypicalK-SpiceandDCSconnectionforasimplecontrolloop(I-1isatransmitterin
K-Spice).ThetransmittersignalissenttothefunctionblockintheexternalDCSsystem.
TheDCSsendsavalvecontrolsignalbacktoK-Spice.
7.2InterfacestotheDCSServers
TheK-SpicecommunicationwiththeDCSServerconsistsofdatatransfertwotypes.
Onetypeofdatatransferisgettingprocessdatafromthesystem,temperatures,pressures
etc.Theothertypeofdatatransferistwodirectional,sendingcommandslikeRun,
Pause,SaveConditions,LoadConditions.
ThedifferentDCSvendorsofferdifferentinterfacestotheirDCSdata.
•OPC.Thisisastandardinterfaceforgettingprocessdata.Thisinterfacemayexistin
paralleltoapropritarystandardfortwodirectionaltransferofcommandsbetween
theDCSsystemandK-Spice
•Propritaryinterfaces.
DCStoDCSlinks
TheSimLinkscanbesetuptogetdatafromoneDCSServer,andsendittoanother
DCSServer .Thisisusedwhentheprocesshastwodifferentcontrolsystemsthatcover
twodifferentsectionsoftheprocess.Intheactualsituationoneofthecontrolsystems
willnormallysenddataofsomekindtotheothercontrolsystem.Itcanbetransferof
processdataliketemperaturesetc.Link-to-linkistypicallyusedfordatabetweencontrol
systemstothelatencyofbringingittoamodeltagrst.Italsosavesonhavingto
createthosemodeltags.
ThisdatatransfercanbesimulatedwithaK-SpiceSimLinksendingdatafromonepart
ofthesimulatedprocess,toanotherpartofthesimulatedprocess.
1/A127
KONGSBERGK-Spice®
AutoswitchComutilizeslink-to-linktomanageautomaticallyswitchingbetween
historicaldataandcurrentdataforreal-timesystems.
7.3Modelvariablesubscriptions
ModelvariablesubscriptionsperformgeneraltaskscommontoallDCSconnections,
whichinclude:
•organisingvaluestobeexchangedintogroupsaccordingtotransferdirection,value
typeandsamplerate(modelvariabletolerancerelated).
•allowingeachgrouptobeconnectedtoadenedexternalsystem.
•deninghandlingcharacteristics(foreachvaluewithinagroup)forthatparticular
variablebysettingvaluesonattributesassociatedwitheachvariable.
•conveyingcommandsissuedinthesimulatortotheexternalDCSsoitispossibleto
actinsyncronisationwiththemodel(commandsincludeRun,Freeze,Change
Speed,SaveandLoadSnapshot).
Thegroupscontainingexchangevariablesforaparticularprocessmodelinstanceare
organisedinanAccessdatabase,whichisdenedinalatersection.
7.4DCSdriverfunctionality
TheDCSdriverforaparticularDCSisafunctionalblockwithadenedinterface
towardsthemodelvariablesubscriptionsandinternallogicimplementingthesystem
speciccommunicationtasks.
Thetaskssolvedbyadriverare:
•Transfervaluesbetweentheexternalsystemandthemodel.Tagnamesusedto
identifyavalueintheexternalsystemarefoundasparametersintheentryfora
variableintheIOlist.
•Ifapplicable,convertcommandsreceivedfromthemodelvariablesubscriptionsand
forwardthemtotheexternalsystem.Onceacommandhasnished,returntheproper
acknowledgementtothemodelvariablesubscription.
TheappropriatedriverforadenedexternalDCSsystemisaddedthroughtheAccess
databasebyselectingtheappropriateDCSlinkforthecontrolsystem.
7.5Packingandunpackingvariables
TheDCSdriverisalsoresponsibleforpackingandunpackingdataincaseswhere
multiple,individualmodelvariablesaresharingacommonDCSvariable(forexample,a
maskoflimitswitches.)
1281/A
TheCrossReferenceList
8TheCrossReferenceList
Scopeofthisguide
TheCrossReferenceListisessentialwhenthelinkisupandrunning.Onelineinthelist
hastwomainitems.OneitemisaDCSvalue.TheotheritemistheK-Spicedataitem
intheK-Spicesimulator.ThelinkwillreadtheDCSvalueandwritethevalueinthe
K-Spicedataitem.Orthereadandwriteistheotherwayround.
SettinguptheCrossReferenceListisoftendonewithqueriesandtablesinaseparate
Accessdatabase,suchprojectspecictablesandqueriesshouldnotbeenteredin
thelinkdatabaseitself.AftertheCrossReferenceListiscreated,theCrossReference
Listwillbecopiedintothelink’sAccessdatabase.Thenallistiscopiedtothetable
KSIM_XREF.
SettinguptheCrossReferenceListisoutsidescopeofthisguide.MakingaCross
ReferenceListisadifculttopictodocument.Muchoftheworkisbasedonexperience
andpersonalskills.Notmuchiswrittendown.
Note
ThetextinthisguideisbasedontheassumptionthattheCrossReferenceListalready
exists.
1/A129
KONGSBERGK-Spice®
8.1CreationoftheCrossReferencelist.
ThisguidewillnotcoverthecreationoftheCrossReferencelist.But4guresonthe
topicareshownbelow,asareferencetotheworkwiththelists.ThechaptercalledThe
AccessdatabasehaveexamplesofthetableKSIM_XREFfromdifferentlinktests.
SeeTheKSIM_XREFtable.Examplesonpage73
andCongurationoftheOpcDaComlinkinK-Spiceonpage100
Thefollowing4gures,areextractsofessentialpartsofthecreationoftheCross
Referencelist.
Importblockinstances
EachK-SpicesimulatorapplicationcontainsaBlockInstances.txtle.Thislecontains
alistofallthetagsintheapplication.
ClickontheImportBlockInstanselebutton.ThiswilllltheBlockModuletable
withvalidsimulatortags.
Figure112AnAccessformwiththebuttonImportBlockInstancele.inthedatabase
CrossReferenceList
1301/A
TheCrossReferenceList
ThetableItemConvert
ItemConvertisatableusedtomatchtheDCStagtotherelevantK-Spicetag.
TheDCS_Itemcolumnisahandmadelistoftextstringsthathavebeenextractedfrom
theDCSIOtags.TheDCS_V arcolumnisahandmadelistoftextstringsthatdenotethe
functionofthesignal.TheKsimTagcolumnisahandmadelistoftextstringsthatwillbe
usedbythescriptformatchingwithrelevantK-Spicetags.
Figure113TherstpartofthetableItemConvertinthedatabaseCrossReferenceList
1/A131
KONGSBERGK-Spice®
ThetableConnectRules
ConnectRulesisatableusedtoconverttheDCStagtotherelevantK-Spicetag.
TheModulecolumnisahandmadelistofK-Spicemodules.TheDCS_V arcolumnisa
handmadelistoftextstringsthatdenotethefunctionofthesignal.TheKsimDataItem
columnisahandmadelistofK-Spicemodulevariablesthatwillbeusedbythescriptfor
matchingtheDCSIOsignalwiththerelevantvariable.
Figure114ApartofthetableConnectRulesinthedatabaseCrossReferenceList
ACrossReferencelistforanOpcDaComlink
SeeCongurationoftheOpcDaComlinkinK-Spiceonpage100
ThisgureisfromthechapterMatrikonComdesktoptoolsintheDcsLinkGuidefor
OPClinks:
Figure115TheKSIM_XREFtableintheAccessdatabaseforaOpcDaComlink
1321/A
TheCrossReferenceList
8.2ItemConnections
ThelinkcongurationisnishedwhenanyiteminthelistofDCStagshasbeencoupled
toaK-SpicetaginthelistKSIM_XREF.
Thiswillbeconrmedinthelink’slogle.TherearenomorewarningsNotconnecting.
8.2.1SourceItemConnections(DCSloopback)
Youcongurethesourceofthedataby:
•SpecifytheDCSconnectioninfoinItemNodeandItemName
•ChecktheToSubServersetting
•ChecktheSourceFlagsetting
•LeaveKsimNameandKsimNodeblank
YoucongureaconnectionfromthesourceitemtoanotheriteminthesameDCS.
•CongurethetargetitemwithItemNodeandItemName
•ToSubServershouldbeunchecked
•PutthefullItemNode/ItemNameasSourceItemName
•LeaveKsimNameandKsimNodeblank
Figure116DcsLoopback
8.2.2DcsUnit
TheunitconversionisdonebytheModelServer.Ifitdoesn'tsupporttherequestedunit,
thereisawarningintheloglebutthesubscriptioncompletesandtheunconverted
valueisused.
Figure117Warningunitdoesnotexist
Link-to-Link(SimLink_XREF)doesnotcurrently(2013/07/03)supportunitconversion.
Note
Beginningwith2.10,theSimLinkwillnowissueanerrorforaninvalidunitanddisable
theDCSitem.
1/A133
KONGSBERGK-Spice®
8.2.3Attributes
ThissectiondescribesthecongurationoptionsfortheitemnamesinKSIM_XREFand
SimLink_XREF.Itappliestothefollowingelds:
•KSIM_XREF.ItemName
•SimLink_XREF.LocalName
•SimLink_XREF.RemoteName
Itemnamescanincludeattributesformodifyingtheconnection.Theseattributes
appearimmediatelyafterthename(nospaces)withincurlybraces.Anitemmayhave
multipleattributesiftheyarecompatiblewitheachotherbyseparatingthemwitha;.
{A1;A2;A3}forexample
Figure118Itemnameswithattributes
8.2.4BinaryCopy
Syntax:BinaryCopy(ConversionType,NumberDcsElements)
Where:
ConversionTypeisthedesiredtypefortheconversion(ModelServerorotherSimLink).
Notethatthisisnotnecessarilythedatatypeofthetaginthepartner.Forexample,if
theDCSisstoringFloatvaluesinabufferofInt16values,youuseFloatasthe
ConversionTypeevenifyouareconnectingtoaDoubleinthepartnerapplication.
Validvaluesare:
•Double
•Float
•Int32
NumberDcsElementsisthenumberofelementsrequiredintheDCStarget.
NumberDcsElements*sizeof(DCS-Type)shouldequalthe
sizeof(ConverstionType).
Forexample,connectionaFloattoanINTinSoftLogixComrequires2DCSElements.
Examples:
Int32Tag{BinaryCopy(Float,1)}
Thisconnectsa4-byteFloatfromthepartnertoa4-byteintegerintheDCS.
Int16Array[2]{BinaryCopy(Float,2)}
Thisconnectsa4-byteFloatto2elementsinaInt16arraybeginningatelement
#2.Thatis,thebinarycontentsofafloatarecopiedto/fromInt16Array[2]and
Int16Array[3].
1341/A
TheCrossReferenceList
Figure119Binarycopy
8.2.5BitAddressing
Thesyntaxforbitaddressis{.N[:S]}whereNisthestartingbitnumberandSis
thenumberofbits.
Bitsarenumberfrom0beginningwiththelow-orderbit.
Figure120Bitaddressing
{.1}indicatesthatthemodelisconnectingtoBit#1oftheItem.Thisitemwill
haveavalueof0or1.
{.2:2}indicatesthatthemodelisconnectingtoBits2and3.Thisitemwillhavea
valueof0-3.
8.2.6ItemconnectionQuality
Toconnecttothequalityassociatedwiththedata,usetheattributeQuality.Notall
SimLinksprovideaquality.SeeArethedataqualityagssupported?onpage163
Figure121Dataquality
1/A135
KONGSBERGK-Spice®
9Tipsandtroubleshooting
TheCrossReferencelist
TheCrossReferenceListisessentialwhenthelinkisupandrunning.Onelineinthelist
hastwomainitems.OneitemisaDCSvalue.TheotheritemistheK-Spicetagwhere
thisDCSvalueisreceivedintheK-Spicesimulator.SettinguptheCrossReference
ListisnormallydonewithqueriesandtablesinanAccessdatabase.AftertheCross
ReferenceListiscreated,itwillbecopiedintothelink’sAccessdatabase.Settingupthe
Crossreferencelistisnotdocumentedinthisguide.CreationofaCrossReferenceList
willbedocumentedlaterinaseparateguide.
9.1DOScommands
setu
Willdisplaytheuserandthedomain.
Figure122setu
ipcong/all
UsedtondtheIPaddressofthemachine.Thisisavirtualmachine10.0.0.3,on
atestnet.
1361/A
Tipsandtroubleshooting
Figure123ipcong/all
9.2SystemValues.
Thisisalistof"systemvalues"supportedbythe.NETSimLinksthatareavailable
forsubscription.
rwisreadfromtheSimLinkand/orwritetotheSimLink
Componentstatus
Table7Componentstatus
NameNotes
ComponentStatus.ExternalConnected•boolean
•read
•Version:2.5.0.15
1/A137
KONGSBERGK-Spice®
Table7Componentstatus(cont'd.)
•booleantrueindicatestheDCSis
connected
ComponentStatus.LinkHealthGood•boolean
•read
•Version:2.9.3.0
•booleantrueifLinkHealthisgood.
Incorporatesconnectionstatus,
watchdogstatusandotheritemssetby
speciclink
ComponentStatus.WatchdogAnyExpired•boolean
•read
•Version:2.9.3.0
•booleantrueifanywatchdogis
currentlyexpired.Cangobacktofalse
ifamonitoredvaluechanges
Bucket
Table8Bucket
NameNotes
SimLink.Bucket.TestBool•boolean
•read/write
•Version:2.5.0.15
•Bucketbooleanvalue
SimLink.Bucket.TestDouble•double
•read/write
•Version:2.5.0.15
•Bucketbooleanvalue
SimLink.Bucket.TestInt•ont
•read/write
•Version:2.5.0.15
•Bucketbooleanvalue
1381/A
Tipsandtroubleshooting
ModelTime
OADatevaluesarecalculatedbyrstconvertingtheK-Spicetimetoadate/timeandthen
convertingthattoOADate.TheK-SpiceconversionusestheEpochStartconguration
foundinTheCongtable.Standardkeywordsonpage52
Table9ModelTime
NameNotes
ModelTime.Step.KSpice•double
•read
•Version:2.9.5.0
•Laststeptime(K-Spiceseconds)received
fromSimManager
ModelTime.Step.OADate•double
•read
•Version:2.9.5.0
•Laststeptime(OADate)receivedfrom
SimManager
ModelTime.SimLinkRun.KSpice•double
•read
•Version:2.9.5.0
•Laststeptime(K-Spiceseconds)
acknowledgedtoSimManager
ModelTime.SimLinkRun.OADate•double
•read
•Version:2.9.5.0
•Laststeptime(OADate)acknowledgedto
SimManager
Figure124SystemV alues.AnExample.
Inthisexample,theyarebeingsenttoDCSitems
1/A139
KONGSBERGK-Spice®
9.3DisableExplicitReadAfterConnect
Aftertestingforsomedayswehaveseenthatsomesignalsarenottransferedcorrectly
fromABBandintothelink/model.OneexampleisasignalsentfromABBwiththe
value255,lookingatthesameinthelink/modelshowsthevalueFALSE,noteven
anIntegerbutaBoolean.
Aftertryingtoputthetroublesignalsinit'sownUpdateRategroupitlooksbetter.But
moreandmoresignalsfailedandnewUpdateRategroupswereadded.Alltrouble
signalswereputinit'sowngroup.
Afteralotoftestingandcheckingafunctioninourlinkhandlingsomethingcalled
"ExplicitReadAfterConnect"wasdisabled,anditlooksliksthishavesolvedtheproblem.
Thisfunctionisdenedinacommondllforallthelinksandthereareobviouslysome
linkswhorequirethisfunction,butnottheABBlink.
1401/A
Tipsandtroubleshooting
9.4ChangingDateandTimesetting
Figure125TimeformatinTimelineproperties
Thelinkwassendingthedate01.01.1970toABBandthiscausedproblemswiththe
AlarmsontheABBside.WetriedtoacknowledgealarmsandthensaveIC,butafter
reloadofICthealarmswereunackedagain.
TheTimeformatwasthenchangedfromEngineeringtoDateAndTimetosolvethis.
RightclickandselectpropertiesontheTimelineEngineering.Onlypossibletochange
TimeformatwhentheTimelineisdeactivated.
1/A141
KONGSBERGK-Spice®
9.5Reconnectsupport
SimLinkssupportingReconnect
Table10Reconnect
NameVersion
OpcDaCom2.5.0.15
OpcHdaCom2.5.0.15
1421/A
Tipsandtroubleshooting
9.6K-SpicePIDControllerconnection
ConnectingOPCserveroutputtoK-SpicePIDControllerOutput
GotostartofmetadataInsomecaseswehavetosetvaluesofPIDcontrolleroutput
fromtheremotecontrolsystemviaOPCserver.Anexampleofsuchacaseiswhen
theK-Spicemodelisusedforoptimizationpurposebyconnectingittoanexternal
optimizerusinganOPCserver
InsuchacaseifwetrytoturntheK-SpicePIDcontrollerintomanualmodeand
writetothePIDControllerOutputfromtheOPCserver,itdoesnotallowitasthe
"ControllerOutput"isanOutputdataitemandtheinternalcodepreventsitfromgetting
writtenthroughanOPCservervalue.
Inordertomakethiswork,theuserneedstodothefollowing.
TheOPCserveroutputhastobemappedtoPIDController"ManualOutput"inthe
OpcDaComdatabase.
Figure126Pidcontrolleroutputtoconnectto
IntheK-Spicemodelweneedtosettheparameter"Optionsforuseofmanualoutput"
to"Usenotwriteback"
1/A143
KONGSBERGK-Spice®
Figure127PidControllerControlsetting
PleaserefertoOpcDaComsetupK-SpiceformoreinformationonOpcDaComlink
setup.
ThiscanalsobedonebysettingthecontrollertoComputermodeandconnecttheOPC
signaltoComputerOutputofthecontroller.
1441/A
Tipsandtroubleshooting
9.7PIIntegration
TheK-spicemodelwillcommunicatetothePIhistorianthroughanOPC:
Figure128DataowfromthePIdatabasetoK-Spice
Note
TheclientisresponsibletoensurethatthePIDatabaseisconguredinsuchawaysothe
valuesinPIaretruereectionsoftheprocessstateinreal-time.OPCinterface(orOPC
server)providedbyClientshouldhaveallrequesteddatatagscongured.Tagname
listtobeprovidedtoKongsbergtocongureOpcDaandOpcHdaComs.ThePIOPC
Interfacemustsupportconnectionfromexternalclients.
IfPIispopulatedbatch-wise,thenensurethatcompletesetispopulatedwithcorrect
timestamp–partialupdatewillcreateinconsistenciesinthemodelwheresomedatais
realtimeandsome30minutesolderforexample.theK-SpicesimulatorassumesPIdata
isrealtimeandneedsacompletesetofconsistentdatatorunthesimulator.Seethe
gurebelow.
ThefollowingparametersarecongurableaspectsofthePIhistoricalbackll
service:
Figure129PIcongurationparameters
ThePIservershouldbesynchronizedbasedonUTCtime,thisisdonebyconguring
ascanclassinthePIOPCInterface.Thecorrectunitforeachmeasurementmustbe
providedintheHistorian.
1/A145
KONGSBERGK-Spice®
Itshouldbecheckedtoseeifitispossibletogetsomekindofstatussignal/timetag
fromPIshowingwhenthelastbatch-wiseupdatewasdoneinPI.KOGTrecommends
tocongurethisifpossible.(Thiswillbeusefulforusertoseewhichdatasetthe
modelisworkingwith)
IfadataqualitycodetagisavailableasanindependentOPCobject,itisrecommended
tocongurethisinPIsoitcanbetransferredtotheK-Spicemodel.
IftheK-Spicesimulatorshouldfollowrealtimedata(withsoftrealtimeconstraints),
therewillbeacertaindelaybetweenthedataaretransferredfromtheDCSandpopulated
intoPI.Ifthesimulatorisruninrealtimemodel,thelinkOpcDaCommustbecongured
torequestdataafterPIhascollectedthefullbatchoftags.Thiscanbedonebyincreasing
OpcDaComreadinginterval(From15to60se.g.).
K-Spicewillbeconguredtoreaddatawithagiventimestamp.Forthesystemthatwill
readdataonlineitisimportanttosetatimestampsufcientlyhightoallowtransferofa
fulldatabatchfromDCStoPIdatabase.ThedatapointsavailableinPImustreectthe
realprocesssignals,datalteringandaveragedvaluesshouldbehandledwithcare.
ForhistoricalrunsandofinecalibrationtheOpcHdaComisused.ThePIOPCinterface
shouldhaveOPCHDAserverforthistowork.
1461/A
Tipsandtroubleshooting
9.8RemotelyStartingControllers
InanOperatorTrainingSimulator(OTS)setting,itispreferabletotolaunchall
processesfromasingleinstructorstation.Thereareafewrequirementstolaunching
FCSandSCStestfunctionsremotely.Theusermusthavesufcientprivileges,the
instructionmustuseasuiteoftoolscalledPSTools,andtheYokogawamachinemust
sharethe$adminfolderwiththeinstructor.
Thersttaskistoensuretheinstructormachinehassufcientprivileges.Theaccount
mustbeanadministratorontheinstructormachineandeitherbeanadministratoron
theYokogawamachineortheusermusthaveaccesstoanadministrativeaccount.If
youdonotwanttheusertohaveadministrativeprivilegesontheYokogawamachine,
youcancreateatextdocumentwhichusesWindowsPowerShelltocreateanencrypted
stringthatcontainstheusernameandpasswordoftheaccountwithadministrative
privileges.Seealsotheguidetocreatingthetextdocumentwhichcontainsthesecure
accountpasswordunderTipsandtroubleshootinginsectionSavingCredentialsSecurely
onpage151.PlacetheleintheKongsbergdirectoryoftheYokogawamachinefor
usebythenalPowerShellscript.
Next,downloadthePSToolssuitefromtheMicrosoftwebsite:
http://technet.microsoft.com/en-us/sysinternals/bb897553
PlacetheseintheKongsbergfolderoftheinstructormachine.ThePSExecprogramis
whatwillallowyoutorunascriptonaremotemachine.Checkthewebformoredetails
onhowtousePSExecForthisprocedure,itiseasiesttocopy/pastethefollowingtext
intoabatchle(i.e.RunControllers.bat):
RunControllers.bat
D:
cdKongsberg
psexec\\computer[-uuser][-ppassword][-i[session][-w
directory]powershell[arguments]
Finally,youcanensurethattheYokogawamachineissharingthe$adminfolder.See
Sharingthe$Adminfolderonpage150Itrequiresyoutoedittheregistry
Aftercompletingthestepsabove,thetaskisassimpleasusingabatchscript
torunPSExec(i.e.RunControllers.bat)whichwillinturnrunabatch
script(i.eControllersBegin.bat)thatreferstoaPowershellscriptthat(i.e.
ControllersRunAs.ps1)containsinformationaboutthecredentialsandthenal
batchscript(FCSnSCS.bat)thatcontainsthecommandsthatwillrunthevarioustest
functions.
1/A147
KONGSBERGK-Spice®
1481/A
Tipsandtroubleshooting
9.9DataorganizationontheOPCserver
Thedataserverhasthreedivisions:
•Server-Containsallofthegroupobjects
•Group-MaintainsinformationaboutitselfandcontainsandorganizestheOPCitems
•Item-Containsauniqueidentierheldwithinthegroup.Theidentieractsasa
referencefortheindividualdatasource,aswellasvalue,quality,andtimestamp
information.Thevalueisthedatafromthesource.Thequalitystatusgives
informationaboutthedevice.Thetimestampisthetimethatthedatawasretrieved
AnOPCapplicationaccessesallitemsthroughtheOPCgroupratherthanthroughthe
itemitself.Thegroupalsocontainsaspecicupdaterateforitself,whichtellstheserver
atwhatratetomakedatachangesavailabletotheOPCclient.Adeadbandspecicfor
eachgrouptellstheservertorejectvaluesiftheyhavechangedbylessthanaspecied
deadbandpercentage
Clientsoftwaredevelopersandusersoftheseapplicationshavegreaterexibilityin
implementingasolutionthatistailoredtotheirneedsbecausedataisorganizedinto
groupsandthenaming,ortagging,ofdatapointsisdeterminedbytheclientsoftware.
Groupingisbenecialindealingwithlargesetsofdatasourcesbecauseitprovides
greaterorganizationofthedataaswellaseasyreferencetosimilarsetsofdata.Inan
OPCapplication,ataggivesauniqueidentiertoanI/Opoint.BasedontheOPC
specication,theclientorserversoftwareisresponsiblefornamingtags.Thesoftware
canprogrammaticallynametagsorspecifythattheusernametags.Thisexibilityisa
signicantfactorintheabilityofclientsoftwaretoprovidesolutionsthataretailoredfor
high-channel-countapplications.
Clientsoftwarealsospeciestherateatwhichtheserversuppliesnewdatatotheclient.
Becausetheserverisresponsiblefordatapublication,theclientsoftwaredoesnotneed
toperformtime-consumingdatapolling,whichfreesupmoretimeforanalysisanddata
logging.Moreover,theclientsoftwareinsteadbecomesareactiveobjectthatwaitsfor
newdatatoarrive.Therefore,theclientbecomesevent-drivenandhandleslargesets
ofdatamuchmoreefciently.
Theclientalsospeciesdeadbandsontheserver,whichallowstheclienttodetermine
whichdataisimportantandthendisregarddatathatisinsignicant.Deadband
percentagesrejectvaluesthatdonotchangemorethanacertainpercentagefromthe
previousvaluerecorded.Byestablishingmoderatedeadbandvalues,theclientreceives
onlyinformationaboutchannelswhichtheclientdeemsessential.Thispreventsthe
clientfrombeingoodedwithsuperuousinformation.Inthisway,theclientcan
monitoramuchgreaternumberofchannels.
1/A149
KONGSBERGK-Spice®
9.10UseraccountsinWindows
9.10.1Sharingthe$Adminfolder
Accesstosomelesandprogramsarerequiredwhenperformingtasksacrossmultiple
servers,suchasremotelyrunningascriptorexecutableusingPSExec.Evenwhen
sufcientcredentialsareprovided,the$Adminfolderisnotshared.
1Openthestartmenu
2SearchforRegEdit.exe
3Opentheprogram,itmayaskforelevatedprivileges.
4Onceintheregistry,locatethefollowingdirectory:
HKLocalMachine\Software\Microsoft\Windows
\CurrentVersion\Policies\System
5CreateanewDWordcalledLocalAccountTokenFilterPolicy.
6Double-clickonthenewlycreatedDWordtoedititsproperties
7Enteravalueof1(Hexadecimal)
8ClickOKandexitRegEdit
Figure130RegistrysettingLocalAccountTokenFilterPolicy
Forfurtherinformation,pleaseseethisarticle:fromwhichallinformationwastaken.
1501/A
Tipsandtroubleshooting
9.10.2SavingCredentialsSecurely
VariousWindowstasksrequireadministrativeprivilegesbutthereareinstancewhen
theusermaynothaveaccesstoasufcientaccount.Itispossibletoautomatesome
proceduresusingasavedcredentialensuringthatalluserscanperformrequiredtasks
withoutexposingthepassword.
CreatingtheSecureString
TheencryptedpasswordmustbesavedonthedesiredserverorPC.Itcannotbecreated
onadifferentmachineandthentransferredtoanotherserverorPC.
•OpenPowershellasanAdministrator
Pleasenote,thismeansusingtheRunasAdministratoroption,openingPowershell
whenloggedinasanadministratorisnotsufcient.
•Copy/Pastethefollowingcommand:
read-host-assecurestring|convertfrom-securestring|out-file
D:\Kongsberg\securestring.txt
Youmaychangethesavedirectoryinthenalpartofthecommand
•Enterthepasswordthatyouwouldliketosave.
Thetextwillappearasasterisks
•AfterpressingEnter,thereshouldbeanewtextlecalledsecurestring.txt
WhencreatingaPowerShellscript(*.ps1),youcanusethefollowingvariablestostore
credentials:
$username="domain01\admin01"
$password=catD:\Kongsberg\securestring.txt|
convertto-securestring
$cred=new-object-typename
System.Management.Automation.PSCredential-argumentlist
$username,$password
Usingthe-credentialargumentalongwiththenewlycreated$credvariableshould
allowascripttorunwithsufcientprivilegeswithoutpromptforapassword.Besureto
changethesecurestring.txtdirectoryifitwasnotsavedinD:\Kongsberg
Exampleoftheuseofaleforcredentials
Thefollowingexampleshowstheuseofthe"securestring.txt"leforcredentialswhen
tryingtousetheRestart-Computercmdletonaremotecomputer.
RestartModel.ps1
$username="Kongsberg\admin"
$password=catD:\Kongsberg\securestring.txt|
convertto-securestring
1/A151
KONGSBERGK-Spice®
$cred=new-object-typename
System.Management.Automation.PSCredential-argumentlist
$username,$password
Restart-Computer-computerBGFOTS1MDL01-credential$cred-force
1521/A
Tipsandtroubleshooting
9.11SQLtipsandtricks
9.11.1CreatingaSQLqueryintheSimLinkdatabase.
WiththeSimLinkdatabaseopeninAccess,clickontheMainMenuCreateandthen
thebuttonQueryDesign.
Figure131Createanewquery
WhentheQuery1editordisplaystheShowTabledialog.ClickClose
Figure132TheQuery1editor
RightclickontheQuery1tabandthenclickonSQLView.
1/A153
KONGSBERGK-Spice®
Figure133Query1SQLView
YourQuery1editscreenshouldlooklikethis:
Figure134Thequery1editscreen
YoucantypeinthedesiredSQLstatement.
9.11.2RunningQuery
PresstheRunbuttontoruntheSQLquery.
Figure135Runthequery
1541/A
Tipsandtroubleshooting
9.11.3Clearconnectedonallitems
UPDATEKSIM_XREFSETConnected=0
9.11.4Setconnectedforallitems
Yes/Novalues(booleans)inAccesstypicallyhaveavalueof0or-1.
UPDATEKSIM_XREFSETConnected=-1;
9.11.5Clearconnectedforaparticularitemnode
NoticethattheItemNodenameisinsinglequotes
UPDATEKSIM_XREFSETConnected=0WHERE
ItemNode='SIM1_AA_AA2/VRR_Train_1';
9.11.6FindingDuplicatesinKsimName
UseQueryWizardfromCreateMenutondduplicatesinKsimName.Thiscanbeuseful
tondtwosignalsconnectedtovalvecontrolsignalinputoramotorstart/stopsignal.
Figure136SelecttableinFindduplicatesquerywizard
1/A155
KONGSBERGK-Spice®
Figure137SelecteldinFindduplicatesquerywizard
Continuewithnexttoaddanymoreeldswiththeduplicatedata.Thiswillgeneratea
tablewithduplicatevaluesinKsimName.
1561/A
Tipsandtroubleshooting
9.12BasicTerminology
ShortexplanationsofthebasicconceptsinDCSinterfacing
9.12.1DCS
DistributedControlSystem
DistributedControlSystemisacomputerizedcontrolsystemusedtocontrolthe
productionlineintheindustryTheentiresystemofcontrollersisconnectedbynetworks
forcommunicationandmonitoring.Theentiresystemofcontrollersisconnectedby
networksforcommunicationandmonitoring.
9.12.2OPC
OPC=OLEforProcessControl
OPCisasoftwareinterfacestandardthatallowsWindowsprogramsto
communicatewithindustrialhardwaredevices.
OPCwasdesignedtoprovideacommonbridgeforWindowsbasedsoftwareapplications
andprocesscontrolhardware.Standardsdeneconsistentmethodsofaccessingeld
datafromplantoordevices.
OPCisimplementedinserver/clientpairs.TheOPCserverisasoftwareprogramthat
convertsthehardwarecommunicationprotocolusedbyaPLCintotheOPCprotocol.
TheOPCclientsoftwareisanyprogramthatneedstoconnecttothehardware,suchas
anHMI.TheOPCclientusestheOPCservertogetdatafromorsendcommandsto
thehardware.
OPCisdesignedtobeanabstractionlayerbetweenindustrialnetworksandproprietary
PLCdrivers.TheOPCstandardspeciesthebehaviorthattheinterfacesareexpected
toprovidetotheirclients;andtheclientsreceivethedatafromtheinterfacesusing
standardfunctioncallsandmethods.Consequently,aslongasacomputeranalysis
ordataacquisitionprogramcontainsanOPCclientprotocol,andanindustrialdevice
driverhasanassociatedOPCinterface,theprogramcancommunicatewiththedevice.
Thespecicationalsoincludesaprotocolforworkingwithdatacontrolsystemsand
applicationdatabases,aswellasonlinedataaccess,alarmandeventhandling,and
historicaldataaccessforallofthesedatasources.
1/A157
KONGSBERGK-Spice®
OPCDataAccess
OPCDAisapartoftheOPCstandardthathandlesrealtimedata.Otherpartsofthe
OPCstandardhandleshistoricaldataandalarmsandevents.Therearethreeattributes
associatedwithOPCDA.Theseare(1)avalue,(2)thequalityofthevalue,and(3)
atimestamp.TheOPCDAspecicationstatesthatthesethreeattributeshavetobe
returnedtoanOPCclientmakingarequest.Therefore,ifthedatasourceisnotcapable
ofprovidingatimestamp,forexample,theOPCDAservermustcreateatimestamp.
OPCHistoricalData
InadditiontotheOPCDAspecication,theOPCFoundationalsomaintainstheOPC
HDA(HistoricalDataAcscess)specication.Incontrasttotherealtimedatathatis
accessiblewithOPCDA,OPCHDAallowsaccessandretrievalofarchiveddata.
OPCAlarmandEventhandling
TheOPCserveralsoprovidesalarmandeventhandlingtoclients.Withinaserver,
analarmisanabnormalconditionofspecialsignicancetotheclient-acondition
associatedwiththestateoftheserver,agrouporanitemwithintheserver.Forexample,
ifadatasourcevaluethatrepresentsthereal-worldtemperatureofamixerdropsbelowa
certaintemperature,theOPCserverwillsendanalarmtotheapplication,sothatthe
applicationwillproperlyhandlethelowtemperature.Eventsaredetectableoccurrences
thatareimportanttotheserverandclient,suchassystemerrors,systemconguration
changes,andoperatoractions.
1581/A
Tipsandtroubleshooting
9.12.3OLEandCOM
OPC=OLEforProcessControl
OLE=ObjectLinkingandEmbedding
COM=ComponentObjectModel
OLE
Objectlinkingandembedding(OLE)isaMicrosofttechnologythatfacilitatesthe
sharingofapplicationdataandobjectswrittenindifferentformatsfrommultiplesources.
Linkingestablishesaconnectionbetweentwoobjects.OLEisadenedstandardforthe
interfacebetweentheclientandtheserver.Theserverhasasetofroutinesitwillanswer.
Theclientusestheseroutinestogetdatafromtheserver.OLEisapartofmoregeneral
standardforinterprocesscommunication,calledComponentObjectModel,COM,.
9.12.4DCOM
DistributedComponentObjectModelisaproprietaryMicrosofttechnologyfor
communicationamongsoftwarecomponentsdistributedacrossnetworkedcomputers.
DCOM,whichoriginallywascalled"NetworkOLE",extendsMicrosoft'sCOM,and
providesthecommunicationsubstrateunderMicrosoft'sCOM+applicationserver
infrastructure.
9.12.5PLCandPAC
ProgrammableLogicControllersandProgrammableAutomationControllers
Mostsuppliersofindustrialdataacquisitionandcontroldevices,suchasProgrammable
LogicControllers(PLCs)andProgrammableAutomationControllers(PACs),are
designedtoworkwiththeOPCFoundationstandard.
9.12.6Sockets
Twoapplicatonsthatinterchangedata,usesockets,alsocalledports,tosetup
thecommunication.
Asocketisaphysical,existingareainsideacomputer.Theapplicationthatsenddata
willsetupelectricalsignalsonadenedsocket.Theapplicationthatreadsdatawill
listenforelectricalsignalsonthesamesocket.Thetwoapplicationssharethesocket.
Otherapplicationscannotaccessthesocket.Thesocketisalsoreferredtoastheport
numberusedforwriteorread.Fortwowaycommunication,anothersocketisassigned
forsignalsgoingintheotherdirection.Ifthesignaliscomingfromanothermachine,the
electricalsignalistransferredviawirestoasocketinthemachinethathasanapplication
thatreadthedata.ThestandardforInternetcommunicationfromsocketononemachine
1/A159
KONGSBERGK-Spice®
tosocketonanothermachine,isTCP/IP .OPCdoesnotuseTCP/IP.Adirectconnection
isestablishedbetweentheOPCserverandtheOPCclient.Dataistransferredwith
standardnetworkprotocols.ThecommunicationisbasedontheOPCstandards.
TheK-Spiceapplicationsandsockets
ThedifferentK-Spiceapplicationscommunicateviasockets.TheSimulationManager
willlistenforlogonrequestsfromanyapplicationonsocket16000.IfSimExplorer
isstartedwithInstance2,SimExplorerwillsendalogonrequesttotheSimulation
Manager.ThenSimExplorerwilllistenforlogonacceptfromtheSimulationManageron
port16202.IfSimExplorerisstartedwithInstance3,SimExplorerwilllistenforlogon
acceptfromtheSimulationManageronport16203.IftwoinstancesofSimExplorer
isrunningonthesamemachine,theymustlistenontwodifferentsockets.Thetwo
instancesofSimExplorermustbestartedwithtwodifferentinstancenumbers.
9.12.7SCADA
Supervisorycontrolanddataacquisition
ThetermSCADAusuallyreferstocentralizedsystemswhichmonitorandcontrolentire
sites,orcomplexesofsystemsspreadoutoverlargeareas(anythingfromanindustrial
planttoanation).MostcontrolactionsareperformedautomaticallybyRTUsorby
PLCs.Hostcontrolfunctionsareusuallyrestrictedtobasicoverridingorsupervisory
levelintervention.Forexample,aPLCmaycontroltheowofcoolingwaterthrough
partofanindustrialprocess,buttheSCADAsystemmayallowoperatorstochange
thesetpointsfortheow,andenablealarmconditions,suchaslossofowandhigh
temperature,tobedisplayedandrecorded.Thefeedbackcontrollooppassesthroughthe
RTUorPLC,whiletheSCADAsystemmonitorstheoverallperformanceoftheloop
1601/A
Tipsandtroubleshooting
9.13FAQs
9.13.1FAQsaboutallSimLinks
Doesitrun/hasitbeentestedonWindows7?
Yes
Arethereanysoftwareenvironmentrestrictions?
SimLinkshavethesameinstallationandOSrequirementsastherestofK-Spice.
Howisthecrossreferencingdone-isthisadatabase,spreadsheet,atle?
SimLinksuseanAccessdatabasetostorecongurationinformation
Canwehavedifferenttaggroupsrunningatdifferentupdatetimes?
Yes
Doesitsupportunitsconversionbothwaysordotheunitsneedtobeconsistent?
SimLinkssupportunitconversionbetweenalinkandaModelServer.Unitconversion
betweenlinks(Link-to-Link)isnotsupportedasof2.8
Beginningwith2.10,theSimLinkwillnowissueanerrorforaninvalidunitanddisable
theDCSitem.
ArethereoptionsonlinkstartforsynchronisingthemodeltagswiththeDCStags?
Therearenouseroptionsforsynchronisingdata.Whenaconditionleorsnapshotis
loaded,allitemssendtheirdatatoanysubscriber.
CanweeditthetaglistdynamicallyordoesthisneedaKSpicerestart?
Dynamically,butyoushouldunderstandtheimpact
IftheSimLinkhasbeenstartedasaninteractiveprocess,thereisaoptiontoReload
Database.ThisoptiondisconnectsfromtheDCSandthenreconnectsinordertouse
anyupdatedcongurationinformationinthedatabase.IftheSimLinkisforaDCSwith
apersistentinstance(SoftLogixCom,OpcDaCom),thenthereshouldbenoimpact
fromthereload.
However,iftheSimLinkisforaDCSthatisstartedbytheconnection(ProSimCom),
thenafreshinstanceoftheDCSiscreated.Thisinstancemaynothaveanyvaluesfrom
aconditionleloadorfromtheresultsofrecentmodelexecution.
DoestheSimLinkrunasaseparateprocessoristhisintegratedintomodel
server/simulationmanager?
EachinstanceofaSimLinkisaseparateprocessthatcanberunonthesamemachine
asthemodeloronadifferentmachine.
1/A161
KONGSBERGK-Spice®
Isthecommunicationstasksynchronizedwiththemodelexecution?
Asaseparateprocess,DCScommunicationdoesnotblockModelServerexecution.
SimManagerdoesensurethattimingremainssynchronizedamongallKSpice
applications.Thatis,SimManagerwillnotallowthemodeltotakeanotherstepuntilall
application(SimLinks,ModelServer,etc)acknowledgecompletionofthemodelstep.
(KSpicedoessupportacongurationforhowmanystepsmaybepending.)
IftheSimLinkrunsasaseparateprocess,canthisbeputonadifferentcore?
Yes,but...
Unlessyou'veseenaperformancewhitepaperorKongsberghasconductedextensive
testing,it'srecommendedthatyoudonotassignapplicationstospeciccores.Microsoft
hasspentthousandsofhoursoptimizingtheoperatingsystemforautomaticassignment.
Ifthecommunicationstaskissynchronised,willdelayedDCSresponseslowdown
themodelexecutionspeed?
Asaseparateprocess,datacommunicationwiththeDCSdoesnotblockmodel
execution.IftheSimLinkactivelyusesDCStimingtoacknowledgestepsbackto
SimManager,thenadelayedresponsefortimingwillslowdownmodelexecutionspeed.
LinksthatactivelymonitorDCStimingincludeProSimComandHimaCom.
IsitpossibletomeasuretheDCSresponsetime?
Currentlythereisnodiagnostictodothis.
Whatdiagnosticsareavailableineventthatwegetproblemswiththelink?Are
theseaccessiblewithinthemodel?
TheSimLinkhasLog,WatchandStatustabsthatcanbeusedtomonitorsomeaspectsof
SimLink.ForadditionaldiagnosticsSeeTheDiagnosticstableonpage60.
Otherthanlinkstatus,SimExplorerhasnodiagnosticsforaSimLink.Amodelcan
subscribetosystemvaluesdescribedinSystemV alues.onpage137andcongure
watchdogsaccordingtoTheWatchdogItemstable.onpage80
Doesthelinkautomaticallyreconnectafteradisconnection?Ifsowillit
automaticallypollalltagsafterareconnection?
SeealsoReconnectsupportonpage142
1621/A
Tipsandtroubleshooting
9.13.2FAQsaboutOPCDAbasedSimLinks
Whatdatatypesaresupported
•Integer
•Boolean
•FloatingPoint
•String
Arethedataqualityagssupported?
Yes.YoumaysubscribetothequalityagcomingfromtheOPCserver.Seealsothe
qualitysectioninItemconnectionQualityonpage135
Dothesystemsneedtobeinthesamedomain/Workgroup?Woulditbeadvisable
touseatunnellertopreventproblemshavingtosetupDCOM?
PreferredinstallationisOpcDaComisonthesamemachineasOPCServeryouare
connectingto.ThisallowsOpcDaComtoactastheOPCtunnellerforK-Spice.Ifthis
isnotfeasible,theprojectwillneedtogureoutDCOMsecurityissuesorpurchasea
tunneller.
Doesitsupportexceptionbasedupdatesorarealltagspolled?
Exceptionbased
9.13.3FAQsaboutOpcDaCom
Howisclient/serverfunctionalityhandled?Weneedonlyclientsupport.Isthis
thedefault?
Thisisclientonly
1/A163
KONGSBERGK-Spice®
10Switchoverfunctionality
InK-Spice,commonmodulesthatreceivesignalsfromtheDCShavethefunctionality
toswitchoverfromlocalcontrol(i.e.,controllersinternalinK-Spice)toremotecontrol
(signalsfromtheDCS).Thisswitchoverfunctionalityiseasilyaccessedbyleft-clicking
onasymbolinK-Spiceandbringingupthedefaultfaceplatethatcontainstheseswitches.
10.1DCSconnectionphilosophy
TheideaofconnectingaK-Spicedynamicsimulationmodeltoa“soft”controller
implementationofaDCSistostimulate(provideequivalentsignalrepresentations)the
systemsoitoperateslikeitisactuallyconnectedtoarealplant.Thissituationallows
themodeltorununderDCScontrolwithmodelvariablesbeingconnectedtotheeld
inputsandoutputsofthesystem.
TheDCSlinkshouldincludethefollowingfunctionality:
1Conguringthefrequency(samplingrate)ofamodelvariable.
2Conguringtheindividualtoleranceofavariabletodetermineiftherehasbeen
signicantchangesinthemodelthatrequiresthetransferofavariable.
3MappingofvariablesbetweentheK-SpicemodelandDCSLinks.
4Scalingofvariables.
5SendingstaticvaluestoselectedDCSinputs.
Thecontrolsignalsrequiredtobemappedareusuallybetweentransmitters,valves,
electricmotors,localcontrolloopsandemulatedsequences.Thesafetysignalsfrom
DCSLinksarealsousuallyconnectedtoshutdowninputsonvalvesandelectricmotors.
Thebelowgureshowsasimplediagramdepictingtwocommonconnectionsbetweena
K-SpicemodelandaDCSsystem,wherethetransmittersignalinthemodelissentto
theDCScontrolfunctionblock.TheoutputoftheDCSfunctionblockshown,avalve
controlsignal,issentbacktothemodeltoregulatethecontrolvalve.
1641/A
Switchoverfunctionality
10.2DCSconnectivityrequirements
ConnectingtocontrollersviaObjectLinkingandEmbeddingforProcessControl(OPC)
supportsthefollowingcommands:
1
2Run
3Freeze
4StepI.e.,steponetimestep,notnecessaryformostsystems
5Loadsnapshot/initialcondition
6Savesnapshot
7SettimeI.e.,ifK-Spiceneedstosynchronizewithanexternalclock
AllthecommandsarereservedOPCcommandswithinK-Spice.Iftheexternalsystem
doesnotsupportthesecommandsviaOPC,thecommandscanbesent‘outside’theOPC
link.TheexternalsoftcontrollerswillalsoneedtoSetandGetmodelvariables.
Note
NotalllinksuseOPC
10.3CommonDCSinterfacingmodules
K-SpicemoduleswhichcommonlyhaveDCSI/O:
Table11TheCommonDCSinterfacemoduletable
ModuletoDCSfromDCS
FieldTransmitterMeasuredValue
ControlSignalOut
ControlValveIsDenedOpen
IsDenedClosed
ValveStemPosition
RemoteControlSignalIn
MotorOperatedValveIsDenedOpen
IsDenedClosed
ValveStemPosition
RemoteOpen
RemoteClose
RemoteStop
PulseControlledValveIsDenedOpen
IsDenedClosed
ValveStemPosition
RemoteSetOpen
RemoteSetClosed
TrueClosesValveIsDenedOpen
IsDenedClosed
ValveStemPosition
RemoteOffOn
TrueOpensValveIsDenedOpen
IsDenedClosed
ValveStemPosition
RemoteOnOff
PulseControlledAsynchronousMachineMachineStatusRemoteControlSignalIn
RemoteSetOn
RemoteSetOff
1/A165
KONGSBERGK-Spice®
Table11TheCommonDCSinterfacemoduletable(cont'd.)
ModuletoDCSfromDCS
TrueStartsAsynchronousMachineMachineStatusRemoteOnOff
RemoteControlSignalIn
TrueStopsAsynchronousMachineMachineStatusRemoteOffOn
RemoteControlSignalIn
DcsPidControllerDcsMode
DcsSetpoint
DcsOutput
1661/A
KONGSBERGK-Spice®
Figure139Acascadecontrolconguration
ForcongurationbringupthefaceplateforthePulseControlledAsynchronousMachine
(20MA03),theMasterController(20LIC103),theslavecontroller(20FIC03),theDCS
MasterController(20LIC03dcs)andtheDCSSlaveController(20FIC03dcs).
1681/A
KONGSBERGK-Spice®
10.5Typicalswitchoverprocedure
Whentheprocessmodelisrstbuilt,simplecontrollogicisimplementedtokeepthe
modelstablewhennotconnectedtotheDCS.WhenconnectingtoaDCS,rstallthe
I/Ovariablemappingsarecompleted,i.e.,matchingtheDCStagstotheprocessmodel
variables.
Usingacontrolvalveasanexample,toswitchoverthevalvetoremoteDCScontrol,
openthevalve’sfaceplateandselecttheremoteradiobutton,asshowninthebelow
gure.IftheDCSconnectionissuccessful,thevalvewillfollowtheDCSsignalbeing
senttothatvalve.
Figure141AK-Spicevalvefaceplatewithswitchingoptions
K-Spicevalvefaceplatewithlocal,remoteandmanualsignalswitchingoptions
highlighted.
1701/A
KONGSBERGK-Spice®
1711/A
©2014KongsbergOil&GasTechnologiesAS