Академический Документы
Профессиональный Документы
Культура Документы
Thishandbookisacollectionofprogrammingoverviews,notes,helps,
cheatsheetsandwhateverthatcanhelpyou(andme)programanAllen
BradleyPLC.
IfyouhaveexperiencewithABthenpleasecontribute.
AnIntroductiontoRSLogix5000Tags
TagsarethemethodforassigningandreferencingmemorylocationsinAllenBradleyLogix5000
controllers.NolongerarethereanyphysicaladdressessuchasN7:0orF8:7whichusesymbolsto
describethem.Thesehavebeenreplacedwithtagswhichareapuretextbasedaddressingscheme.This
isadeparturefromthemoreconventionalwaysofprogrammingPLCs,whichincludesAllen
BradleysearlierlineofPLC5andSLC500controllers.
Oneofthehardesttransitionsfromtheoldersystemsisrealizinghowthetagdatabaseworks.The
personwithexperienceinAllenBradleysystemswillrecognizemanyoftheinstructionsandbeat
homewiththeeditorinRSLogix5000.Understandingthetagdatabaseisthefirstmajorhurdlein
becomingcomfortablewiththeControlLogixandCompactLogixsystems.Soletsdiginandget
started.
TheWayWeUsedToBe
EarlierAllenBradleyPLCsprogrammedwithRSLogix5andRSLogix500softwarehaddatafilesto
storeI/Oandotherinternalvalues.Thesedifferentdatafilescouldonlyholdonedatatype.Adatatype
definestheformatandthesizeofthestoredvalue.
DefaultDataFiles
DataFileDescriptions
File#
Type
Description
O0
Output
Thisfilestoresthestateofoutputterminalsfor
thecontroller.
I1
Input
Thisfilestoresthestateofinputterminalsforthe
controller.
S2
Status
Thisfilestorescontrolleroperationinformation
usefulfortroubleshootingcontrollerandprogram
operation.
B3
Bit
Thisfilestoresinternalrelaylogic.
T4
Timer
Thisfilestoresthetimeraccumulatorandpreset
valuesandstatusbits.
C5
Counter
Thisfilestoresthecounteraccumulatorand
presetvaluesandstatusbits.
R6
Control
Thisfilestoresthelength,pointerposition,and
statusbitsforcontrolinstructionssuchasshift
registersandsequencers.
N7
Integer
Thisfileisusedtostorebitinformationor
numericvalueswitharangeof32767to32768.
F8
FloatingPoint
Thisfilestoresa#witharangeof1.1754944e38
to3.40282347e+38.
Whilethismethodmadeiteasyforusinginstructions,itprovidedachallengeforlogicallygrouping
differentdatatypestogetheraccordingtofunction.Forinstance,inmachinecontrol,amotormayhave
astart,stop,speedandalarmcodeeachwithitsowndatatype.Thus,thedatawasscattered
throughoutthedatafiles.
File#
Name
DataType
I1
Start
Input
I1
Stop
Input
F8
SpeedSetpoint
FloatingPoint
N7
AlarmCode
Integer
ComparingtheOldandNew
TheLogix5000controllershavedoneawaywithdatafilesandinitsplaceisthetagdatabase.Thetag
databaseorganizesmemorylocationsinoneplace.Eachtagisassigneditsowndatatype.Thetable
belowshowstheassociationbetweenthecurrentdatatypesandtheoldersystemswithdatafiles.
RSLogix5/500
File#
Type
O0
Output
RSLogix5000
Inputandoutputmodules,whenconfigured,
I1
Input
S2
Status
B3
Bit
T4
Timer
C5
Counter
R6
Control
N7
Integer
F8
Floating
Point
automaticallycreatetheirowntagslike
Local:0:I.Data.0
UsetheGSVandSSVinstructionstogetstatus
informationsuchastheCPUtime,modulestates
andscantimes.
AssigntheBoolean(BOOL)datatypetothe
tag.
AssigntheTIMERdatatypetothetag.
AssigntheCOUNTERdatatypetothetag.
AssigntheCONTROLdatatypetothetag.
Assignthedoubleinteger(DINT)datatypeto
thetag.
AssigntheREALdatatypetothetag.
CreatingaTag
OnewaytocreateanewtagisrightclickontheControllerTagsintheControllerOrganizerandselect
NewTag.EvenfasteristheCtrl+Whotkey.
Thefollowingdialogboxpopsup.
TheNamegiventothetaghasthefollowingrules:
onlyalphabeticcharacters(AZoraz),numericcharacters(09),andunderscores(_)
muststartwithanalphabeticcharacteroranunderscore
nomorethan40characters
noconsecutiveortrailingunderscorecharacters(_)
notcasesensitive
Whiletagsarenotcasesensitive,itisgoodpracticetomixcasesforreadability.Itismucheasierto
readLine1_StartthenLINE1STARTorline1start.
Inaddition,thetagdatabaselistsortsalphabetically.Therefore,itisbesttousesimilarstarting
characterswhenyouwanttagstobetogetherinthemonitorlist.
TagsNamedfor
Grouping
Level_High
Level_Low
Insert_Nut
Knife_Stop
TagsNotNamedfor
Grouping
High_Level
Insert_Nut
Knife_Stop
Low_Level
UsetheDescriptionfieldforalongerdescriptionofthetag.Itisbesttokeepnamesshortyetnot
cryptic.Tagnamesaredownloadedandstoredinthecontrollerbutthedescriptionisnotasitispartof
thedocumentationoftheproject.
ThetagTypedefineshowthetagoperatesintheproject
Base
Atagthatactuallydefinesthememorywherethedatais
stored
Alias
Atagthatrepresentsanothertag
Produced
Senddatatoanothercontroller
Consumed
Receivedatafromanothercontroller
Aliastagsmirrorthebasetagtowhichtheyrefer.Whenthebasetagvaluechangessodoesthealias
tag.Usealiasesinthefollowingsituations:
programlogicinadvanceofwiringdiagrams
assignadescriptivenametoanI/Odevice
provideamoresimplenameforacomplextag
useadescriptivenameforanelementofanarray
Producedandconsumedtagsmakeitpossibletosharetagsbetweencontrollersinthesamerackorover
anetwork.Thisarticledoesnotcoverthisaspect.
SelectaDataTypeforthetagbytypingitinorbyclickingontheellipsisbuttonandselectingitfrom
thelist.Adatatypeisadefinitionofthesizeandlayoutofmemoryallocatedforthecreatedtag.Data
typesdefinehowmanybits,bytes,orwordsofdataatagwilluse.
ThetermAtomicDataTypereferstothemostbasicdatatypes.Theyformthebuildingblocksforall
otherdatatypes.
DataType
Abbreviation
Memorybits
Range
Boolean
BOOL
01
ShortInteger
SINT
128to127
Integer
INT
16
32,768to32,767
DoubleInteger
DINT
32
2,147,483,648to
2,147,483,647
RealNumber
REAL
32
+/3.402823E38to
+/1.1754944E38
Logix5000controllersaretrue32bitcontrollers,meaningthememorywordsare32bitswide.No
matterwhat,atagalwaysreserves32bitsofmemoryevenifitisaBooleanorintegerdatatype.For
thisreason,itisbesttouseaDINTwhendealingwithintegers.Furthermore,aLogix5000controller
typicallycomparesormanipulatesvaluesas32bitvalues(DINTsorREALs).
ALogix5000controllerletsyoudivideyourapplicationintomultipleprograms,eachwithitsowndata.
TheScopeofthetagdefinesifatagisglobal(controllertags)andthereforeavailabletoallprogramsor
local(programtags)toaselectprogramgroup.Paycarefulattentiontothisfieldascreatingitinthe
wrongareamayleadtosomeconfusionlateronastoitslocation.
ControllerTagsareavailabletoallprograms.Youcannotgowrongusingcontrollerscopedtagsunless
youeasilywanttocopyandpasteprograms.AtagmustbecontrollerscopedwhenusedinaMessage
(MSG)instruction,toproduceorconsumedataandtocommunicatewithaPanelViewterminal.
ProgramTagsareisolatedfromotherprograms.Routinescannotaccessdatathatisattheprogram
scopeofanotherprogram.Havingprogramtagsmakeiteasytocopy/pasteprogramsandnothaveto
worryaboutconflictingtagnames.Makesurethoughthatnocontrollertagsarenamedthesameas
programtags.
Styleistheforminwhichtodisplaythetagbydefault.Thefollowingtableprovidesyouwith
informationonthebaseandnotationusedforeachstyle.
Style
Base
Notation
Binary
2#
Decimal
10
Hexadecimal
16
16#
Octal
8#
Exponential
0.0000000e+000
Float
0.0
EditandMonitorTags
ToeditexistingtagsselecttheLogic>EditTagsmenuitem.Aspreadsheetlikeviewletsyoucreate
andedittags.
Clickingthe+signnexttoatagrevealsitsstructure.ForaDINTtagthisisthe32individualbitsthat
makeupthetagwhichwillnotbeofinterestifyouareusingthetagasanumberratherthenindividual
bits.Ifyoudowishtousetheindividualbitsthenyoucanaddresstheminthiswaywiththetagname
followedbyaperiodandthenthebitposition(e.g.MyTag.5).Shownbelowistheexpandedstructure
foraTIMER.NoticeitismadeoftwoDINTsandthreeBOOLs.Inthiscase,theBooleansarepacked
intooneDINTandthereforeatimerusesthreeDINTsofmemory.
AnEasierWaytoCreateTags
Theeasiestwaytocreatetagsisontheflywhileprogramming.Whenaninstructionisfirstuseda?
willindicatedtheneedforatag.Therearethreeoptionsatthispoint:
1. Doubleclickonthe?
andselectanexistingtagfromthedropdownbox.
2. Rightclickonthe?
andselectnewtag.
3. Doubleclickonthe?
andtypeinthetagname.Ifitdoesnotallreadyexist,thenrightclick
onthetagnameandselectCreateNewTagName
.Becarefulwiththismethodnottouse
spacesorspecialcharacters.
ThenicethingaboutallthesemethodsisthatRSLogix5000willautomaticallyfillinthecorrectdata
typeaccordingtotheinstructionused.
Anotherquickmethodistodraganddropanexistingtagtoanewinstruction.Makesuretoclickonthe
tagnameratherthentheinstruction.
Conclusion
Thesearethebasicsoftags.Theadvantagesare:
1. Tags,ifdoneright,createalevelofdocumentationthatisstoredinthePLC.
2. Thesoftwaredoesanautomatichousekeepingofmemorylocations.Theresnomore
worryingaboutphysicaladdressingandmemoryconflicts.
3. Structurescanbemoreeasilyputtogetherbasedonfunctionratherthendatatype.
Advancesubjectsincludearrays,userdefineddatatypes(UDT)andAddOnInstructions.Hopefully,
youwillcontinuetolearnmoreaboutthepoweroftags.Thereisnodoubtthatifyougraspthe
principlespresentedhereyouwillbewellonyourwaytousingandtroubleshootinganyLogix5000
controller.
AQuickTutorialonRSLogixEmulator5000
RSLogixEmulator5000isasoftwaresimulatorfortheAllenBradleylineofLogix5000controllers
(ControlLogix,CompactLogix,FlexLogix,SoftLogix5800andDriveLogix).Thegoalisto
mimicthefunctionofaPLCwithouttheactualhardwareandthusdoadvanceddebugging.More
informationcanbefoundintheABpublicationLGEM5KGR015AENP.
Asaquickintroductionwellgothroughasimpleexampleofsettingupasimulation.Thisinvolves
threemajorsteps.
1. Settingupthechassismonitor.
2. CreatingaconnectioninRSLinx.
3. Creatingaprojectwithassociatedemulationhardware.
SettinguptheChassisMonitor
TostarttheChassisMonitor,clickStart>Programs>RockwellSoftware>RSLogixEmulate5000
>RSLogixEmulate5000ChassisMonitor.
Whentheemulatoropensupyoureconfrontedwithwhatlookslikeanemptychassis.Inslot0isan
RSLinxmodulewhichhastobetherefortheemulatorcommunicationstowork.Yourslot1might
haveanotherirremovableRSLinxmoduledependingifyouarerunningRSLogixEnterprise.
Fromherewesetupourhardwareconfigurationforsimulation.OurfirststepwillbetoaddtheCPU.
InthiscaseitisaspecialonecalledanEmulationController.
1. ClickSlot>CreateModule.
2. ChoosetheEmulatorRSLogixEmulate5000Controller.
3. Choseslot2forthecontroller
4. ClickOKtoaddittothechassismonitor.
5. Atthispointyoumaybeaccostedwithamessageaboutpreviousconfigurations.Justselect
ResettheConfigurationtoDefaultValuesandclickNEXT.
6. Thenexttwodialogscreensareforsettingupthecontrollerdetails.ClickNEXTandFINISHto
acceptallthedefaults.
Nextwelladdsomeinput/outputsimulation.
1. ClickSlot>CreateModule.
2. Choosethe1789SIM32PointInput/OutputSimulator.
3. Choseslot3forthesimulatorandclickOK.
4. AcceptthedefaultsforthesetupbyclickingNEXTandFINISH.
Thechassismonitorwillnowhavetwoemulationmodulesinitreadytogo.
CreatingaconnectioninRSLinx
1. StartRSLinxunderStart>Programs>RockwellSoftware>RSLinx>RSLinxClassic
2. ClickCommunications>ConfigureDrivers.
3. SelecttheVirtualBackplane(SoftLogix58xx)driverfromtheAvailableDriverTypeslist.
4. ClickAddNew.TheAddNewRSLinxDriverdialogboxappears.ClickOK.
5. ThenewdriverappearsintheConfiguredDriverslist.ClickClose.
UsingRSLogixEmulatorinaProject
Tousetheemulatorinaprojectyoumustsetupthehardwarecorrectly.
1. StarttheRSLogix5000softwareandcreateanewproject.
2. UndertheNewControllerwindowtypeselectanEmulatorRSLogixEmulator5000
Controller.GiveitanameandassignittothesameslotastheoneyouputintheChassis
Monitorwhichinourexampleisslot2.ClickOK.
3. InRSLogix5000'sControllerOrganizer,rightclickontheI/OConfigurationfolder,andthen
clickNewModule.ThesoftwaredisplaystheSelectModulewindow.
4. OpentheOtherfolder.Selectthe1756MODULEfromthemoduleslistandthenclickOK.
5. ThesoftwaredisplaystheNewModulewindow.
a.AddaNameforthecard.
b.IntheSlotfieldputthenumberthatcorrespondswiththeChassisMonitor.
c.FortheConnectionParametersputinthefollowingandclickOK
Assembly Size
Instance
Input
Output
16
Configuration
6. OnthenextModulePropertiesscreenmakesuretochangetheRequestedPacketIntervalto
50.0ms.
Ready,Set,Go
YouarenowreadytousetheemulatorjustlikeyouwouldanyotherPLC.OpenWhoActiveandset
thepathtotheRSLogix5000Emulator.
TheinputscanbesimulatedintheemulatorsChassisMonitorbyrightclickingonthemoduleand
selectingProperties.UndertheI/ODatatabistheabilitytotoggleeachoftheinputsonoroff.
Note:
RSLogixEmulatorissometimeserroneouslycalledRSEmulator.
GettingStartedwiththeLogix5000PIDE
FunctionBlock
ThePIDE(EnhancedPID)isanAllenBradleyLogix5000family(ControlLogix,CompactLogix,
FlexLogix,SoftLogix)functionblockthatimprovesonthestandardPIDfoundinalltheircontrollers.
Firstimpressionsofthisfunctionblockarequiteintimidating.Ifyoutrytodiveintoitheadfirstyou
mayjustendupbangingyourheadagainstawall.Manywillbequitehappytostickwiththetried
andtruePIDinstructionbuttocompetewiththemoreadvancedprocesscontrolapplicationsthePIDE
boaststhefollowing.
ItusesthevelocityformofthePIDalgorithm.Thisisespeciallyusefulforadaptivegainsor
ItusesthevelocityformofthePIDalgorithm.Thisisespeciallyusefulforadaptivegainsor
multiloopselection.
ControloftheinstructioncanbeswitchedbetweenProgramandOperatormodes.
Bettersupportforcascadingandratiocontrol.
Builtinautotuner(requiresextrakey)
Supportfordifferenttimingmodes
Morelimitingandfaulthandlingselections.
Stillinterested?WhatwewanttodohereisbasicallygetyouoffthegroundwiththePIDE,distillall
theoptionstotheessentialsandgetitworking.
ThePIDEisonlyavailableasafunctionblock(sorry,noladder).LikethePIDinstructionitisbestto
setitupinitsownperiodictask.Theperiodofthetaskautomaticallybecomesthesamplerate
(DeltaT)ofthePIDloop.JustmakesurewhenaddingthenewroutinetothetasktoselecttheTypeas
"FunctionBlockDiagram."
AddingthePIDEFunctionBlock
ThePIDEinstructioncanbeaddedfromtheInstructionToolbarundertheProcesstab.
Onceyouplopafunctionblockontoasheetitautomaticallycreatesaprogramtagfortheinstruction
whichstoresallthesettings.Theparameterscanbesetormonitoredbywiringinputandoutput
referencesorbyclickingontheellipsisboxinthetoprightcornertorevealtheblockproperties.
OpeningtheblockpropertiesforthePIDEinstructionbeforeRSLogix5000version15meantyou
wouldbeaccostedwithalonglistofparameters.
Version15hasatleastorganizedsomeofthemorecommonsettings(butnotall)undertabsandgroups.
Themostessentialsettingsare:
Name
V15Location
Description
.PV
Mustbewiredin
fromatag.
TheProcessVariableisthereading(temperature,pressure,flow,
etc.)thatistobecontrolledbythePIDloop.
.PVEUMax EUs/Limittabin
.PVEUMin theEngineering
UnitsScaling
group
TheProcessVariableEngineeringUnitsMaximumand
Minimum.ThevalueofPVandSPwhichcorrespondsto100%
spanoftheprocessvariable.
.SPProg
.SPOper
TheSetPointisthetheoreticalperfectvalueoftheprocess
variable.SPProgisthevaluetousewheninprogrammodeand
SPOperisusedwheninoperatormode.
Shouldbewired
inorsetinthe
tag.
.SPHLimit
.SPLLimit
EUs/Limittabin
theSPLimits
group
TheSetPointHighLimitandSetPointLowLimitclampthe
maximumandminimumvaluesofthesetpoint.IfSPHLimit>
PVEUMaxorSPLLimit<PVEUMinthenafaultwilloccur.
.PGain
General
Configurationtab
intheGains
group
Proportionalgain.Enter0todisable.
.IGain
General
Configurationtab
intheGains
group
Integralgain.Enter0todisable.
.DGain
General
Configurationtab
intheGains
group
Derivativegain.Enter0todisable.
Program/OperatorControl
ThefirstthingtounderstandwhenprogrammingaPIDEblockisthedifferentcontrolsandmodes
available.
TheProgram/OperatorcontrolletsyoutransfercontrolofthePIDloopbetweentheuserprogramand
anoperatorinterfacesuchasanHMI.Eachcontrolhasseparatesetpointsandmodecontrols.It's
importanttounderstandthatwheninProgramControlthesetpointisdeterminedbySPProgwhilein
OperatorControlitsSPOper.TheSPoutputindicatesthesetpointthatthefunctionblockisactually
using.
Controlisdeterminedbythefollowinginputs:
Name
Description
.ProgProgReq
AprogramrequesttogotoProgramcontrol.
.ProgOperReq AprogramrequesttogotoOperatorcontrol.
.OperProgReq AnoperatorrequesttogotoProgramcontrol.
.OperOperReq AnoperatorrequesttogotoOperatorcontrol.
TheProgOperoutputindicatesthecontrolofthePIDEinstruction.Iftheoutputisa1thenitisin
Programcontrolandiftheoutputisa0thenitisinOperatorcontrol.TheProgramrequestinputstake
precedenceovertheOperatorrequestssothattheprogramcanlockoutanyoperatoroverrides.The
ProgValueResetinputclearsallinputrequests.
OperatingModes
ThePIDEinstructionsupportsthefollowingmodes.
Mode
Description
Manual
WhileinManualmodetheinstructiondoesnotcomputethechangeinCV.The
valueofCVisdeterminedbythecontrol.IfinProgramcontrol,CV=CVProgand
ifinOperatorcontrol,CV=CVOper.SelectManualmodeusingeither
OperManualReqorProgManualReq.TheManualoutputbitissetwhenin
Manualmode.
Auto
WhileinAutomodetheinstructionregulatesCVtomaintainPVattheSPvalue.
Ifinprogramcontrol,SP=SPProgandifinOperatorcontrol,SP=SPOper.
SelectAutomodeusingeitherOperAutoReqorProgAutoReq.TheAutooutputbit
issetwheninAutomode.
Cascade/Ratio WhileinCascade/RatiomodetheinstructioncomputesthechangeinCV.The
instructionregulatesCVtomaintainPVateithertheSPCascadevalueorthe
SPCascadevaluemultipliedbytheRatiovalue.SPCascadecomesfromeitherthe
CVEUofaprimaryPIDloopforcascadecontrolorfromthe"uncontrolled"flowof
aratiocontrolledloop.SelectCascade/RatiomodeusingeitherOperCasRatReq
orProgCasRatReq.TheCasRatoutputbitissetwheninCascade/Ratiomode.
Override
WhileinOverridemodetheinstructiondoesnotcomputethechangeinCV.CV=
CVOverride,regardlessofthecontrolmode.Overridemodeistypicallyusedto
seta"safestate"forthePIDloop.SelectOverridemodeusing
ProgOverrideReq.TheOverrideoutputbitissetwheninOverridemode.
Hand
WhileinHandmodethePIDalgorithmdoesnotcomputethechangeinCV.CV
=HandFB,regardlessofthecontrolmode.Handmodeistypicallyusedtoindicate
thatcontrolofthefinalcontrolelementwastakenoverbyafieldhand/auto
station.SelectHandmodeusingProgHandReq.TheHandoutputbitisset
wheninHandmode.
IfafaultoccursinthePIDEsettingsthenitisforcedintoManualmodeandsetsacorrespondingbitin
theStatuswords.TheInstructFaultoutputistheindicatorofafault.Formoredetailopentheblock
propertiesandlookattheStatusatthebottomofthedialogbox.RefertotheLogix5000Controllers
ProcessControlandDrivesInstructions(pub1756RM006DENP)fordetails.
BasicExample
Here'sanexamplewherejusttheessentialsareused.Thisisatemperaturecontrolapplicationifyou
hadn'tguessedallready.I'vechangedthelookofthefunctionblockbygoingintotheblock
properties,selectingtheParameterstabandcheckingon(oroff)theboxesintheViscolumnbesides
theinputsandoutputsthatareofconcern.
Here'stherundownoneachoftheinputs.
Input
Description
PV
TheprocessvariablecominginfrommyTCcard
PVEUMax
PVEUMin
Thespanofthetemperatureinputthatequals0to100%.Inthiscasethetemp
goesfrom0to1200degC.
SPHLimit
SPLLimit
Wecouldlimitthesetpointbutinthistestcasejustsetitequaltothe
PVEUMax/Min.
SPProg
I'vedecidedtouseProgramControlsotheSetPointneedstocomeinonthis
inputratherthenSPOper.
CVProg
WheninmanualmodetheCViscontrolledbythisinput.
DependIndepend IprefertheDependentformofthePIDalgorithm.
PGain
IGain
Dgain
TheessentialPIDsettingsofProportion,IntegralandDerivative.
ProgProgReq
SettherequesttouseProgramControl.
ProgAutoReq
ProgManReq
Sincewe'reinProgramControltheseinputscontroltheAutoandManual
modes.TorunthemoffoneswitchtheBNOTblockisusedtoinvertthebit.
Nowfortheoutputs.
Output
Description
CVEU
TheControlVariableoutputinengineeringunits.EveryPIDcontrolneedsan
output.Inthiscaseitgoesfrom0to100%.
SP
TheactualsetpointwhichinthiscaseequalsSPProg.
ProgOper
Iwanttoseea1herejusttomakesurewe'reinProgramControl
Auto
Manual
Indicatestheoperatingmode.
InstructFault IfIscrewsomethingupthenthisbitwillcomeon.
CommonProblems
Nooutput
ThePIDloopisinmanualmode.Putitintoautomodeusing
ProgAutoReq.
NotinprogramcontrolorSPProgisnotset.UseProgProgReqtogointo
programcontrolandsetSPProg.
Novaluesornotenoughproportion(PGain)orintegral(IGain).
Outputis
limitedat100
TheSPHighLimitisstillsetatthedefaultof100.Changethevalueof
SPHLimit.
Conclusion
Hopefullythisbasicintroductionhasgottenyouofftheground.Halfthebattleisjustgettingitto
work.OncethatisdoneyoucannowreallystarttotinkerwiththepowerofthePIDEfunctionblock.
FurtherReference
Logix5000ControllersProcessControlandDrivesInstructions(Publication1756RM006DEN
P)
UsingthePIDEInstruction(PublicationLOGIXWP008AENPAugust2005)
UsingaLogixControllerforBarrelTemperatureControlonPlasticInjectionMoldingand
ExtrudingMachines(PublicationRAAP015AENPFebruary,2004)
InstallandTestaMVI46MCMModbus
ModuleforSLC500
byNugrohoBudifromcontrolmanuals.com
TheMVI46MCMisaModbuscommunicationmoduleprovidedbyProSoftTechnology.Themodule
canbeinstalledinaSLC500racksoitcancommunicatetootherModbusdevices.
ThisarticleassumesyouhaveanAllenBradleySLC5/03,5/04,or5/05processorwithapowersupply
ofadequatecapacityfortheMVI46MCMplusanyInput/Output(I/O)modulesyouintendtouse.
ofadequatecapacityfortheMVI46MCMplusanyInput/Output(I/O)modulesyouintendtouse.
Forthepurposesofthislab,andtomatchthesuppliedsampleladder,wewillassumeaconfigurationas
follows:
AB1747L5515/05Processor16KMemory,OS500
AB1746A77SlotChassis(rack)
AB1746P1/P7PowerSupply
Ifdifferenthardwareisused,modificationstothesampleladderfile,MVI46MCM.RSSwillneedtobe
madetoobtainaproperlyfunctioningprogram.
InstallingtheModule
1. BeforeinstallingtheMVI46MCMintotheSLCchassis,checkthepositionoftheInterface
ConfigurationJumpersonthebottomofthemodule.
TheSetupJumperisonlynecessarywhenusedtoflashafirmwareupgradeontothemodule.
Fornormalconfigurationandoperation,thisjumpermustbepositionedasshowninthediagram
above.WewillbeusingtheRS232interface,socheckthatthePRT2andPRT3jumpersare
positionedasshownabovesothemodulewillcommunicateinRS232mode.
2. NOTE:Forthisstep,andatanytimewhenyouareinstallingorremovinghardwaretoorfrom
thechassis,youMUSTdosowiththePOWEROFF!SLCmodulesareNOTHOT
SWAPABLE.Attemptingtoinsertorremovemoduleswhilethechassisispoweredupcan
resultindamagetothemodule,theprocessor,thePowerSupply,and/ortheChassisitself!
Chassisslotsarenumberedsequentially,lefttoright,startingatzerofortheleftmostslot.The
processoralwaysgoesinSlot0.InstalltheMVI46MCMmoduleintotheslotnexttothe
processor.ThiswillplacethemoduleinSlot1.Therestofthechassisslotsshouldbeleft
empty,fornow.Ifdonecorrectly,yourinstallationshouldlooksimilartothefollowing
illustration:
3. SettheprocessorkeyswitchtotheREMpositionandpowerupthechassis.
Afteritsbootcycle,theprocessorwillbereadytoacceptprogramming.Atthispoint,youmay
ignoreanyREDLEDsindicatingprocessorormodulefaults.Untilavalidproject(program)is
loadedintotheprocessoritmayshowafault.
ConfigureRSLinxtoTalktoSLC
1. Attachanullmodemcable(ortheABCP3programmingcable)fromyourPCserialporttothe
serialportonyourSLCprocessor,calledChannel0.
2. OpenRSLinx.ClickontheCommunications
dropdownmenu.Clickonthe
ConfigureDrivers
option.IfyourerunninganewerversionofRSLinx,youllsee
adialogboxlikethisone:
IfyoualreadyhaveaRS232DF1driverconfigured,skiptotheAutoConfigureinstructionsin
Step5.
3. ClickthedownarrowintheAvailableDriverTypes:
optionboxandclickonRS232
DF1devices
,asshown,andclicktheAddNew
button.
4. Youwillnowbepromptedtonameyourdriver.Formostcases,thedefaultnamewillbe
acceptable.Tomatchthesampleprojectusedinthislab,acceptthedefaultnamebyclicking
theOK
button.
5. Next,youwillseethedriversetupdialogbox.
a. First,clickthedownarrowintheCommPort:
optionboxandclicktheCommport
thatmatchesthenumberonyourPC(usuallyComm1,Comm2,Comm3,orComm4).
b. Then,clickthedownarrowintheDevices:
optionboxandclicktheSLC
CH0/Micro/PanelView
option.
c. Finally,clicktheAutoConfigure
button.RSLinxwillthenquerytheprocessor,
establishacommunicationslink,andadjustthedriversparameterstomatchthe
processorscurrentportconfiguration.Dontworryiftheparametersinyour
driverdontmatchtheonesshowninthefollowingexample.Aslongasthewindow
driverdontmatchtheonesshowninthefollowingexample.Aslongasthewindow
reportsAutoConfigurationSuccessful!
,whateverparametersappearforbaudrate,
parity,errorchecking,etc.willbecorrect.Asuccessfulresultwilllooksomethinglike
this:
Insomeinstances,RSLinxwillfailtoAutoConfigure.Ifthishappenstoyou,firstcheck
thatyourcableisOK,properlyconnected,andthatyouareselectingthecorrectComm
port.Oncethisisverified,ifAutoConfigurefails,youwillneedtocompletelywipethe
processormemoryandresetittofactorydefaults.ConsulttheABproduct
documentation,theABwebsite,orABTechSupportforinstructiononhowtodo
this.Oncedone,theRSLinxshouldbeabletoAutoConfigure.
ClickingonOK
willreturnyoutothisdialog:
IfthedriverstatusisRunning
,youhavenowsuccessfullyconfiguredRSLinxto
talktotheprocessor.ClicktheClose
buttontoclosethisdialogandthenexitbut
donotshutdownRSLinxbyclickingtheFile
menuoptionandthenExitand
Shutdown
.BesuretoclicktheExit
option.
UseRSLogix500toModifytheSampleProject
1. Next,wewillloadandconfigurethesampleladderlogicprogramanddownloadittothe
processor.StartRSLogix500.Itshouldcomeuptoablankwindow,likethis:
2. ClickontheFile
dropdownmenu,clickOpen
andbrowsetothefolderwhereyou
savedthesampleladderanddoubleclickthefile,MVI46MCM.RSS
thatisincludedonthe
MVI46MCMCD.
Thiswillopenthesampleproject.Wecannowconfigurethesampleladdertogetitreadyfor
thenextexercise.
3. Youllgetawindowthatlookslikethis.Ifnot,thenclickontheView
Menu,and
makesuretherearecheckmarksbesideStandard
,Online
,andTabbed
InstructionBar
options.
4. IntheleftpaneProjectTreearea,undertheControllerfolder,doubleclickontheIO
Configuration
icon.ThiswilldisplaytheI/OConfigurationdialogbox:
5. ClickonOTHER
inSlot1,asshown,thenclicktheAdvConfig
button.
Makesurethevaluesareasshown.Iftheyarenot,setthemtothesevalues.Otherwise,the
modulewillnotfunctionproperly.DetailsonmodulesetuparecontainedintheUsers
ManualinSection3.3SettingUptheModule
.Afteryouverifythevalues,click
OK
orCancel
toclosethisdialogbox.ClickontheExiticon( )intheupper
rightcorneroftheI/OConfigurationdialogtocloseitandreturntothemainwindow.
6. IntheleftpaneProjectTreearea,undertheDataFilesfolder,doubleclickontheN10MCM
CFGicon.Setthevaluesinthisfiletomatchtheonesshownbelow.
MCMPorts1&2Cmds
Port1/Port2
N10:10/N10:40PortEnable/Disable
N10:11/N10:41PortType
N10:12/N10:42FloatFlag
N10:13/N10:43FloatStart
N10:14/N10:44FloatOffset
N10:15/N10:45Protocol
N10:16/N10:46BaudRate
N10:17/N10:47Parity
N10:18/N10:48DataBits
N10:19/N10:49StopBits
N10:20/N10:50RTSOnDelay
N10:21/N10:51RTSOffDelay
N10:22/N10:52Min.ResponseDelay
N10:23/N10:53UseCTSLine
N10:24/N10:54SlaveID
N10:25/N10:55BitInputOffset
N10:26/N10:56WordInputOffset
N10:27/N10:57OutputOffset
N10:28/N10:58HoldingRegisterOffset
N10:29/N10:59CommandCount
N10:30/N10:60Min.CommandDelay
N10:31/N10:61CommandErrorPointer
N10:32/N10:62ResponseTimeout
N10:33/N10:63RetryCount
N10:34/N10:64ErrorDelayCount
N10:35/N10:65Reserved
N10:36/N10:66GuardBand
N10:37/N10:67GuardBandTimeout
ThisconfigurationdatawillsetmodulePort1tobeaModbusMasterandPort2tobeaModbus
Slave.BothportswillbesetforModbusRTUmode,57,600baud,noparity,8databits,1stop
bit.Hardwarehandshakingwillbedisabled(RTS/CTSnotused.)Wewillbeabletouseup
to5ModbusCommandsandanyModbusCommandErrorswillbesenttomodulememory
beginningatregisteraddress300,whichwillthenappearinSLCdatatableN31,beginningat
N31:100.Withthisconfiguration,wecanuseasecondnullmodem
cableandtwoDB9MtoRJ45pigtailstoconnectthetwoportstogether,whichinturnwillallow
ustosendandgetdatafromthemodulewithoursampleladder.ClickontheExiticon( )in
theupperrightcorneroftheDataFileN10(dec)dialogtocloseitandreturntothemainwindow.
7. WewillnowconfigureourModbuscommandsforPort1.IntheleftpaneProjectTreearea,
undertheDataFilesfolder,doubleclickontheN11P1CMDSicon.Setthevaluesinthis
filetomatchtheonesshownbelow.
MCMPorts1&2Cmds
Port1/Port2
N11:0/N12:0CmdEnable
N11:1/N12:1InternalAddress
N11:2/N12:2PollIntervalTime
N11:3/N12:3Count
N11:4/N12:4SwapCode
N11:5/N12:5NodeAddressDeviceID
N11:6/N12:6FunctionCode
N11:7/N12:7DeviceAddressRegister
ThiscreatesoneModbuscommandforPort1,ourMasterport.Thiscommandwillsenda
requestoutPort1totheModbusSlaveatSlaveID2(ourPort2),asconfiguredinN10.The
commandwillgettwenty16bitwords(registers)ofdatafromDestinationAddress0,ourmodule
address0,thefirstwordofourWRITEDATAarea,andmoveitoutPort2,inPort1,andstoreit
inInternalAddress200,ourmoduleaddress200,thefirstwordofourREADDATAarea.This
commandwillexecuteonceeachsecond.Thisway,anyvalueswepokeintodatatable
addressesN32:0throughN32:19will,afterashortdelay,appearinthecorrespondingaddresses
indatatableN31.ClickontheExiticon( )intheupperrightcorneroftheDataFileN11
(dec)dialogtocloseitandreturntothemainwindow.
8. IntheleftpaneProjectTreearea,undertheDataFilesfolder,doubleclickontheN12P2
CMDSicon.SetallthevaluesinthisfiletozeroandclickontheExiticon( )intheupper
rightcornertoclosethiswindowandreturn.
9. IntheleftpaneProjectTreearea,undertheDataFilesfolder,doubleclickontheN32
WRITEDATAicon.Setthevaluesinthisfileasshown.
ThiswillgiveussomebeginningdatavaluesfortheModbuscommandwejustcreated.Click
ontheExiticon( )ittheupperrightcornertoclosethiswindowandreturn.
10. IntheleftpaneProjectTreearea,undertheDataFilesfolder,doubleclickontheN31READ
DATAicon.Setthevaluesinthisfiletozerosothatwewillknowthatanyvaluesthatappear
therearetheresultofourladderlogicexecution.ClickontheExiticon( )intheupperright
cornertoclosethiswindowandreturn.
11. Wearenowreadytosaveournewprojectbeforedownloading.Inthemainwindow,clickon
File
,thenSaveAs
togettheSaveAsdialogbox.IntheFileName:box,type
46Test1
,asshown,andclicktheSavebutton.
Congratulations!Younowhaveafunctioningprogramthatwillmovedatatoandfromthemodule.
DownloadingandTestingtheModifiedSampleProject
1. Makesureyournullmodemcable(orCP3programmingcable)isstillattachedbetweenyourPC
CommportandtheprocessorRS232port.TakethetwoDB9MtoRJ45pigtailsandtheother
nullmodemcableandconnectthelowertwoportsontheMVI46MCMmodule,
P2APPLICATIONandP3APPLICATION,withthesecables.
2. SettheprocessorkeyswitchtothePROG
position.InRSLogix500,clickthedown
arrownexttotheOFFLINE
statusandclickDownload
fromthemenu.
Whenyouseetheconfirmationdialog,clicktheYes
button.
Thesampleladderiscurrentlyconfiguredfora1747L551SLC5/05.Ifyouareusinga
differentprocessor,whenyoutrytodownload,youwillseethefollowing:
Ifyougetthiswarningscreen,clicktheOK
button.RSLogixwillautomatically
determinetheactualprocessortypeyouareusingandadjusttheIOConfigurationtomatchyour
installedprocessor.Youshouldthenseethefollowingwindow:
Whenitcomesup,makesuretheClearI/O
boxisNOTchecked,asshown,andclick
OK
.ADownloadProgressdialogwillflashthroughseveralprogressbarsasvariousparts
oftheprogramareloaded.Eventually,youshouldsee:
ClicktheYes
button.TheRSLogixstatusboxwillchangetoshowyouareonlinelive
withtheprocessor.Youcanalsotellyouareonlinewhenyouseethecoloredblocksand
ladderrotatinginthestatusbox.Thefastertheyrotate,thehigheryourconnectionspeed.It
shouldlooklikethis(withanimatedladder):
Ifyouhadtochangeyourprocessortype,nowwouldbeagoodtimetoresavetheprogram.
3. Next,wewillchangetheSLC500processorkeyswitchfromPROG
toRUN
and
backtotheREM
position.Ifyouhaveagoodprogram,theprocessorRUNLEDwill
lightupsolidgreenand,ontheMVI46MCMmodule,theOKLEDwillchangefromredtogreen,
theAPPSTATUSandBPACTLEDswillbeamberandtheLEDsforP2andP3willflashgreen
aboutonceeverysecond.TheRSLogixstatusboxshouldlooklikethis:
If,however,theprocessorFAULT
LEDflashesredandyouseethis,
itindicatessomekindofhardwareorsoftwareproblem.Commoncausesinclude:hardware
failure,ladderlogicerrors,andinstallingtheMVI46MCMmoduleinadifferentchassisslotthan
theoneselectedintheI/OConfiguration,I/Omodulesintheconfigurationthatarenotactually
installedinthechassis,andmore.Assumingyouarestillonlinewiththeprocessor,tosee
whatmightbecausingtheproblem,youcanchecktheProcessorStatus
dialogforthe
MajorErrorCodecausingthefault.IntheProjectTree,underthe
Controller
folder,clickonProcessorStatus
thenclickontheErrors
tabtosee
thefault.Anexampleofhavingthemoduleinthewrongslotisshown.Yourerrormaybe
different.
Dowhateverisrequiredtofixtherootcauseofthefaultandthenturnthekeyswitchfrom
REM
toPROG
toRUN
andbacktoREM
togettheprocessorrunning
normally.
4. NOWWerereadyforsomerealfun.TakeafewminutestolookatthethreeLADfiles
inourtestprogram.Foradetailedexplanationofwhatthesefilesdo,lookatChapter4
LadderLogicintheUsersManual,beginningonpage25.
Now,lookinLAD4MCMCMDSatrungs0002and0003.BitB3:0/0inrung0002is
calledtheColdBootbit.BitB3:0/1inrung0003iscalledtheWarmBootbit.Eithermaybe
toggledtoforcethemoduletorestart,reloaditsconfigurationandanyModbuscommands.
Thisisahandyfeaturethatmakesiteasytochangeandtestdifferentconfigurationsand
commands.Itsquickerandsafertotogglethesebitsthantorecycletheprocessoror
powerdownandpowerupthechassistoaccomplishthesamething.Togglingeitherofthese
bitsallowsconfigurationandcommandchangestobeperformedwithouthaltingtheprocessor.
Thiscanbeveryusefulwhenaddedoneofourmodulestoanexistingapplicationalreadyinuse
atacustomersite.Asweprogressthroughtherestofthisexercise,wewillbereturningtothis
ladderandtheserungsoftenaswemodifyandtestourprogram.
ToggleoneofthesebitsnowandwatchtheLEDsonthefrontofthemoduleasyoudoso.You
shouldseetheP2andP3LEDsstoptheregularblinkingtheyhadbeendoing,theOKLEDwill
brieflyturnredthengobacktogreen,andthentheP2andP3LEDsshouldresumetheirblinking
onceasecond.
Totogglethebit,rightclickonitspicturethenclickonToggleBit
atthebottomofthe
contextmenu,asshown.BesuretowatchthefaceoftheMVI46MCMmoduleasyouclick.
5. Nowwecanchecktobesureourprogramismovingthedataasitshould.Remember
previouslythatwezeroedoutourREADDATAtableandputtestvaluesinourWRITEDATA
table.Ifourprogramisworkingcorrectly,weshouldnowhavethesamevaluesinthesame
relativeaddressesinourREADDATAasintheWRITEDATA.First,letscheckthe
WRITEDATAtabletobesureourtestvaluesarestillthere.IntheProjectTree,undertheData
Filesfolder,doubleclickN32WRITEDATA
.
Yep!Ourtestdataisstillthere,justthewayweleftit.Now,forthemomentoftruthdoes
ourN31READDATAtablelookthesame?
6. DoubleclickonN31READDATA
andletssee.Ifyourtablesoverlapeach
other,youcanclickandholdontheblueTitleBarofeitherone,dragittoadifferentpositionin
thewindow,andrelease.Ready,GO!
YES!!!!!TheyMATCH!Now,thatwaseasy,wasntit?Youcanexperimentfurther
withtheabovebychangingthevaluesinDataFile32,N32:0throughN32:19.WiththePLCin
RunModethevaluesinDateFile31,N31:0throughN31:19should,afteraveryshortdelay
matchthoseinDataFile32.
UsingModScantosimulatetheModbusMaster
1. UsingWindowsFileExplorer,gototheCDandexpandtheyellowfolderintheleftsidetree
panetitledUtilitiesundertheInRAxfolderuntilyouseeafoldertitledModscan.
2. DoubleclickonthecompressedfolderintherightsideExplorerpanetoextractitscontents.
Chooseorcreateanewfoldertocontainthesefiles.Asuggestionwouldbetocreateanew
foldertitledModscan,andthenextractthecompressedfilesintothisnewfolder.
3. AfterextractingtheModscanfiles,locateanddoubleclickonthefiletitledModscan.exe.You
shouldseethefollowingprogramappear.
4. ThisistheWindowsprogramcalledModscan.Thisisasharewareprogramandcanbeusedfor
30days,afterwhichyouareaskedtopurchaseit.
5. Tousetheprogram,clickeitherCancelorOKtocloseouttheRegistrationInformation
dialogwindow.Youmayhavetoclickonceinsidethewindow,andthenclickOK.Repeatif
necessary.Nowwearereadytousetheprogram.
6. RemovetheshortRJ45pigtailcablefromPort1ontheMVI46MCMandthendisconnectitfrom
theRS232NullModemcable.NowconnecttheRS232NullModemcabledirectlytotheCOM
1portonyourcomputer.Ifyoucurrentlyhaveanothercableconnectedto
yourcomputersCOM1portforinterfacingtotheSLC500,firstgoofflinewithRSLogix
500software,thendisconnectthatcableandconnecttheRS232NullModemcablethatwas
previouslyconnectedtoPort1oftheMVI46MCMmodule.WeshouldnowhaveCOM1on
ourPCconnectedwithaRS232NullModemcabledirectlytoPort2onourMVI46MCM
modulewhichisconfiguredasaModbusSlavedevice.
7. IntheModscanprogram,clickonthemenuchoicecalledSetup
,andthenclickon
Serial.Configurethesettingsasshownbelow.ClickOKwhendone.
8. NowclickSetup,thenDisplayandmakesurethatDataandDecimalhavecheckmarksbeside
them.ClickonSetup,thenProtocolandmakesureRTUischeckedalso.
9. Nowconfigurethemainwindowasbelow.
10. NowclickonthemenuitemAction
,thenStartPoll.Youmayhavetoclearapopup
windowfirst,butyoushouldseeresultslikebelowwhichshowsouroriginaldatathatwasinour
DataFile32.
Theregisteraddressesareontheleftandlisted40001through40020andeachregistersvalueis
directlytotherightofit.
Congratulations,youhavejustusedaWindowssoftwareprogramcalledModscanactingasaModbus
MasterdevicetogooutandreaddatafromourMVI46MCMmodulesPort2whichisaModbus
Slavedevice.
NOTE:BasedonmyexperiencetheMVIMCMforSLC500isunabletobeaSlaveandmustbeA
MASTERtocommunicatewithotherModbusPLC/Devices(Scadapack32,Micromotion,
UltraSonicFlowMeterGM868..)
LearnLadderLogicwithaFreeVersionof
RSLogix500andRSEmulator500
Oneofmymostcommonquestionsis,WherecanIgetafreedownloadofRSLogix500?
For
anyseriousdevelopmentwithSLC500orMicroLogixthereisnofreeoptionbutthereisanicefree
optionifyouonlywanttolearnand/orprogramaMicroLogix1000or1100.Programminga
MicroLogixisveryverysimilartoprogrammingaSLC500orinthatcaseaPLC5too.
AllenBradleyoffersasafreedownloadasoftwarepackagecalledRSLogixMicroStarterLitewhichis
essentiallythesameprogrammingenvironmentasRSLogix500.Ontopofthat,theyalsooffer
RSLogixEmulateforfreesothatyoudontevenneedaPLCtorunandtestyourladderlogic.
KeepreadingandIllshowyouhowtogetthesoftwareandsetitup.
GettingtheSoftware
TheRSLogixMicroStarterLitesoftwareisonlyavailableasadownloadat
http://www.ab.com/programmablecontrol/plc/micrologix/downloads.html.Ifyouarestartingfrom
scratchanddonothavetheRSLinxsoftwarethendownloadthekitbundledwithRSLinxClassic
Lite.FYI,IfinditabitconfusingbuttheyalsosellsoftwarecalledRSLogixMicroStarterwhich
supportsthefullMicroLogixrange.
IfyoudonothaveaMicroLogix1000or1100toplaywiththendownloadtheRSLogixEmulate500
software.YoullbeabletousethistosimulatearealPLC.
NoteforWindowsXPusers:ThebundledversionofRSLinxonlyinstallsonWindows
ProandisnotsupportedonWindowsXPHomeversions.TogetaroundthisI
downloadedanolderversionofRSLinxLite2.50fromtheAllenBradleysoftwareupdate
pagehttp://www.rockwellautomation.com/support/webupdates/
OnceyouvedownloadedthesoftwareandextractedittheninstallRSLogixMicrofollowedbythe
RSLinxClassicLitesoftware.Next,installtheRSLogixEmulate500software.
FirstStepswithRSLinx
RSLinxisthesoftwareRSLogixwillusetocommunicatewithyourPLCorinourcasetotheemulator.
LetsstartbyrunningtheRSLinxsoftwareundertheSTART>AllPrograms>RockwellSoftware
>RSLinx>RSLinxClassicshortcut.Followthesestepstosetitup:
1. UndertheCommunicationsmenuselectConfigureDrivers.
2. UndertheAvailableDriversTypesselecttheSLC500(DH485)Emulatordriver
andclick
theAddNewbutton.
3. YoucangivethedriveranamebutIjustleaveitatthedefaultofEMU5001.
4. LeavetheconfigurationoptionsasStationNumber00andclickOK.
Yourdrivershouldnowberunningandlooklikethepicturebelow.
Ok,thatsreadytogo.ClosetheConfigureDriversdialogboxandcloseRSLinx.Actually
RSLinxisnowrunninginthebackgroundandyoullprobablyseeitslittleiconinthesystemtray.
RSLogixMicroStarterLite
Nowforthemomentweveallbeenwaitingforcreatingsomeladderlogic.OpentheRSLogix
MicrosoftwarewiththeSTART>AllPrograms>RockwellSoftware>RSLogixMicroEnglish>
RSLogixMicroEnglishshortcut.CreateabrandnewprojectbypullingdowntheFilemenuand
selectingNew.Everyprojectmuststartwithadesignatedprocessor.
InmycaseIvechosenthesimplestMicroLogix1000andthenclickedtheOKbutton.FYI,if
youeverworkwiththepurchasedversionofRSLogix500thentherewillbealotmoreitemsinthis
hardwarelist.Ablankprojectnowopensup.
Letsmakeasimplerungtotestinouremulator.Makesurethecursorisontherungwiththe
ENDonitandthenclicktheNewRungiconintheinstructiontoolbar.
NowclickontheExamineifClosed
instructiontoaddittotherung.Doubleclickonthe
questionmarkaboveitandenterI:0/0asitsinputaddress.Justleavethedescriptionpopupbox
emptybyclickingOK.
Next,clickontheOutputEnergize instructiontoaddittotherightsideoftherung.Doubleclick
onthequestionmarkaboveitandenterO:0/0asitsoutputaddress.Justleavethedescriptionpopup
boxemptybyclickingOK.
Youshouldnowhavesomethinglikebelow.
ThenextveryimportantstepistoverifytheprojectwiththeEdit>VerifyProjectmenuitem.This
willcompiletheprojectandgetitreadyfortheemulator.
SavetheprojectassomethinglikeTest.RSSinaneasyplacetofindlikeMyDocuments.
RSEmulator500
TheemulatorletsustestourworkbyrunningavirtualPLC.Wellbeabletodownloadour
programtoitandrunitinaverysimilarfashiontoarealPLC.StarttheemulatorwiththeSTART>
AllPrograms>RockwellSoftware>RSLogixEmulate500>RSLogixEmulate500shortcut.The
emulatorispicturedbelow.Iknow.Itdoesntlooklikemuchbutitgetsthejobdone.
SelectFile>OpenandopentheRSLogixprojectyoucreatedearlier(InamedmineTEST.RSS).In
thedialogboxthatpopsupputtheStation#as1andclickOk.
Believeitornotbuttheemulatorisnowready.Leaveitrunningandgobacktoyourprojectin
RSLogixMicro.
TestingtheLadderLogic
InRSLogixMicroStarterselecttheComms>SystemCommsmenuitem.Thefollowingdialogbox
willpopup.
Inthelefthandpane,drilldownandselectthe01,MicroLogix1000,TEST
processor.Yours
mightlookalittledifferentifyouselecteddifferenthardwareorgavetheprocessoradifferentname.
ForgoodmeasuremakesureApplytoProjectischeckedandthenclickonDownload.When
promptedtogoOnlineclickonYes.
Ifsuccessfulyoullseetheladderpicturespinningroundontheonlinetoolbar.Toscantheladder
logicputtheprocessorintoRunmodebyclickingonthearrowtotherightofmodestatus(REMOTE
PROGRAM).
Totesttheladderlogic,changetheinputstatebyrightclickingontheaddressandselectingtogglebit.
Youwillseetheinstructiongogreenindicatingitistrueanditwillmaketheoutputinstructionturn
greenalsoindicatingtheoutputisturnedon.
Thatsit!Yougetallthatforthecostofadownload.Nowbreakoutthemanualsandstart
learningaboutallthedifferentinstructions.
RSLogix5000TipsandTricks
Everybodyenjoysniftylittletipsandtrickstogettheirworkdonefaster.ThislistingisforAllen
Bradley'sRSLogix5000software.Feelfreetoaddyourowntipsandtricksusingthe'addcomment'
link.
General
ToaccessReleaseNotesforthisversionofsoftware,chooseReleaseNotesfromtheHelpmenu.
TheQuickViewPane,locatedbelowtheControllerOrganizer,provides"thumbnail"information
fortheselectedcomponent.
TheWatchPane,locatedbelowthelanguageeditorwindow,providesmonitoringforalltags
referencedintheactiveroutinewindow.
TheControllerOrganizerisdockable.Thatis,youcandragittotheleftorrightsideofthe
screen,orfloatitsomewhereinbetween.
Hide/showtheControllerOrganizerviaatoolbarbuttontomakemoredisplayareaforeditors.
RSLogix5000supportsCut/Copy/Paste/Drag/DropofcomponentswithintheController
OrganizeraswellastootherinstancesofRSLogix5000.
DoubleclickingonerrormessagesdisplayedintheErrorWindowwillnavigateyoutowherethe
errorwasencountered.F4andShiftF4canbeusedtomovebetweenerrors.
Youcanreorderthecolumnsinthetageditorbyclickingonthetitleanddraggingittoanew
position.
Tosimultaneouslydisplaylogicinmultipleroutines,selectWindow>NewWindowandthen
arrangethewindowsmanually.OrselectWindow>TileHorizontal.
Toremoveayellowtrianglewarningsymbolonadevice,firstchecktheconnectionstatus.Ifthe
statusis"Connectionisnotscheduled",reopentheRSNetWorxsoftware.ReturntoRSLogix
5000softwareandtheyellowtriangleshouldbegone.
Ononecomputer,youcaninstallandsimultaneouslylaunch(run)multipletranslatedversionsof
RSLogix5000software.
Onceyoudoapartialimportofrungs,addoninstructions,oruserdefineddatatypes,youcan't
undotheimport.Iftheimportdidn'tworkasexpected,closetheprojectwithoutsaving.
Whenyouselectapartialimport,makesuretoselectthecorrectrungortrendfile.Bothfiles
haveL5Xextensionsandthesoftwaredoesn'tpreventyoufromselectingthewrongfile.Ifyou
trytoimportarungwhereatrendisexpected,orviceversa,thesoftwaredoesdisplayanerror
thattheimportfailed.
Partialimportofrungsworksinallladderroutines,includingAddOnInstructions.
Inversion15,theTagEditoraddedsupportforNewWindow.
Tosimultaneouslydisplaylogicinmultipleroutines,selectWindow>NewWindowandthen
arrangethewindowsmanually.OrselectWindow>TileHorizontal.
Keyboard
KeyboardshortcutsarelistedintheOnlineHelp,underthe"NavigatingtheSoftware"topic.
YoucanuseCtrl+PageDownandCtrl+PageUptomovebetweentabsinadialogorroutine
window.
YoucanuseCtrl+TabandShift+Ctrl+TabtomovebetweenmultipleRSLogix5000views.
YoucanuseCtrl+GtoinvoketheGoTodialog.TheGoTodialogisconvenientfornavigating
thesoftware.
YoucanuseAlt+InserttoopentheLanguageElementbrowserinanyofthelanguageeditors.
YoucanalsoinvokethisbrowserbypressingtheInsertkeyintheLD,SFCandFBDeditors.
YoucanuseCtrl+SpacetoinvoketheTagbrowserfromwithintheSTeditor.
YoucanusetheGoTodialog(Ctrl+G)toquicklynavigatetoroutinescalledbythecurrent
routineandtoroutinesthatcallthecurrentroutine.
IntheSequentialFunctionChartEditor,youcanusetheRoutineOverview(Ctrl+B)tooltoview
yourentireSFCandhelpnavigatetoaspecificareaofyourchart.
DoubleclickingonerrormessagesdisplayedintheErrorWindowwillnavigateyoutowherethe
errorwasencountered.F4andShiftF4canbeusedtomovebetweenerrors.
TheLanguageElementbrowserisashortcuttoaddinglogic.Intheanyofthelanguageeditors:
useAlt+Insert,typetheinstructionmnemonic,andpressEnter.Youcanalsoinvokethisbrowser
bypressingtheInsertkeyintheLD,SFCandFBDeditors.Thisshortcutcanbemuchquicker
thanusingtheinstructiontoolbar.
Asyouusethekeyboardtomovethecursoraroundgridcells,pressAlt+Downarrowtoactivate
anycontrolsthatareactiveforthatcell.Thisworksinallgridbasededitors,suchastheTag
Editor,DataMonitor,etc.Thisgivesyouawaytoaccesscellcontrolsviathekeyboard,rather
thanusingthemouse.
ControllerProjects
WheneveryougoonlineusingRSLogix5000,changesmadetocontrolleraresimultaneously
madetoatemporarycopyoftheprojectfile(.ACD).Savemakesthesechangespermanent.
Therefore,anuploadisonlynecessarytoobtainthelatestcopyofthetagdatainthecontroller.
BothRockwellAutomationandthirdpartysampleprojectsareinstalledwithRSLogix5000.You
canfindthemintheRSLogix5000Samplesfolder.Theseprojectsdemonstrateprogram
techniquesandcodethatyoucanusetoprogramselectmodules.
Avoidpointingonealiastagtoanotheraliastagtoensuretheapplicationmaintainsthe
appropriatereferencesafteranupload.
Avoidpointingmultiplealiastagstothesamebasetagtoensuretheapplicationmaintainsthe
appropriatereferencesafteranupload.
Alltagnamesaredownloadedandresidentinthecontrolleralongwithyourlogic.
Ondownload,iftheControlNetschedulestoredintheofflineRSLogix5000projectfileisold,
RSLogix5000willretrievethelatestControlNetschedulefromtheassociatedRSNetWorx
projectfile.TomakeanassociationtoanRSNetWorxprojectfile,usetheRSNetWorxtabinthe
ModulePropertiesdialogoftheControlNetscanner.
RSLogix5000supportsmovingyourprojectfromoneLogixplatform/controllertoanother.
ACD,L5K,CSV,andL5XfilesareindependentofwhichtranslatedversionofRSLogix5000
importsorexportsthefile.Thesoftwaredoesn'tcreatelanguagespecificimport/exportfiles.
UseanytranslatedversionofRSLogix5000softwaretogoonlinetoacontrollerwithouthaving
toredownload.
Inasafetycontroller,standardtagsinasafetymappedrelationshipfollowsafetyrestrictedstates.
Forexample,astandardtagmappedtoasafetytagisreadonlyinasafetylockedstate.
UseAddOnInstructionstoinitializetagvaluestospecificvaluesatthebeginningofeachroutine
orprogramscan.ThensourceprotecttheAOItoassurethatvaluesarecorrectlyinitializedand
notoverwrittenmanually.
TheorderofmemberswithinaUserDefinedDataTypeaffectthememorysizeofthedatatype.
WithintheUDT,keepmembersofthesamedatatypetogether.
I/OConfiguration
ModuleiconsintheI/OConfigurationfolderchangetoindicatethemodulehasfaultedorthe
connectiontothemodulehasbeeninterrupted.
Toremoveayellowtrianglewarningsymbol,firstchecktheconnectionstatus.Ifthestatusis
"Connectionisnotscheduled",reopentheRSNetWorxsoftware.ReturntoRSLogix5000
softwareandtheyellowtriangleshouldbegone.
ToeasilyfindamoduleintheSelectModuleTypedialog,simplystarttypinganypartofthe
modulenameordescription.Whenyoustarttyping,theFindModuledialogislaunched
automatically.
UserackoptimizedcommunicationformatsfordigitalI/Omodulestominimizeamountof
controllermemoryandcommunicationsoverheadassociatedwiththesemodules.
RSLogix5000automaticallycreatescontrollertagswhenyoucreateaninputoroutputmodule.
Youcanreferencethesetagsdirectlyinyourlogic.
Usealiastagstoassignnamestospecificinput/outputdataand/ortoprovideashortalternativeto
lengthystructuremembernames.
WhenyouconfigureananalogI/Omodule,holdtheshiftkeyasyoumovetheslidertoincrement
HH,H,L,andLLvaluesinwholenumbers.
CopyI/OdatatoaUserDefinedType(UDT)soyoucansynchronizeI/Odatawithprogram
scan.TheUDTalsoenableseasiermappingofphysicalI/O.
Tasks,ProgramsandEquipmentPhases
AneventtaskinLogixissimilartotheprocessorinputinterrupt(PII)inthePLC5.Multiple
eventtaskscanexistinthecontroller,eachconfiguredtoexecuteattheinitiationofindependent
triggers.
AperiodictaskinLogixissimilartotheselectabletimedinterrupt(STI)inthePLC5.Multiple
periodictaskscanexistinthecontroller,eachconfiguredtoexecuteatindependentrates.
DoubleclickonastateinanEquipmentPhasetonavigatetothelogicforthatstate.
UseRSBizWareBatchsoftwaretocreateEquipmentPhases.UsetheEquipmentEditortocreate
thephases,defineparameters,andsynchronizethephaseswithanRSLogix5000project.
Useanyprogramminglanguage(Ladder,StructuredText,FBD,orSFC)toprogramstate
routinesinEquipmentPhases.
ThefaultroutineforanEquipmentPhaseisthesameasthefaultroutineforaprogram.Usea
faultroutinetoallowlogictorunbeforethecontrollerfaultsduetoaprogrammingerror.
ThePrestateroutinerunsallthetime,evenwhentheEquipmentPhaseisnotactive.
ThePrestateroutineforanEquipmentPhaseisoptional.UsethePrestateroutinetoexecutethe
errordetectionlogicforyourphases.
Youdon'thavetoimplementalltheavailablestatesinanEquipmentPhase.OntheEquipment
Phasesproperties,checkthe"CompleteStateifnotimplemented"option.
InthePhaseMonitor,thestatesyoucanwritecodehaveactionnamesandhaveacommandword
leadingintothestate,suchasStartleadstotheRunningstate.Youaddroutinestothesestates.
Waitingstatesdon'trequireroutines.Thephasewaitsforacommandtomovetothenextstate.
Forexample,IdleandHold.
Tags,DataTypesandOtherData
Asyouorganize,add,ordeletemembersofaUserDefinedDataType,thesoftwareadjuststhe
associatedtagmembersandvaluesaccordinglysothatremainingmembersretaintheirvalues.
Inthetagbrowser,clickthe>>buttontodisplaythetagfilter.Usethetagfiltertodisplayunused
tagsortagsofaparticulardatatype.
Thetagbrowserfilterstagsinsomesituations.Ifyoudon'tseeatagyouexpect,changethetag
filter.
Inversion15,theTagEditoraddedsupportforNewWindow.
Youcanusearraystodoindirectaddressing.RSLogix5000supportsarraysofone,two,and
threedimensions.
Youcancreatearecipebycreatinganewdatatypeandthencreatingatagwhichusesthatdata
type.Yournewdatatypecancontaindescriptivefieldnames.
RSLinxusesmemoryinaLogixcontrollertoreaddatavalues.Usethefollowingequationto
estimatethememoryneeded:(1.5Kbyte+(Numberofindividualtags*45bytes)+(Numberof
arrayorstructuretags*7))
TheWatchPane,locatedbelowthelanguageeditorwindow,providesmonitoringforalltags
referencedintheactiveroutinewindow.
Youcantrendatagbyrightclickingthetagandchoosing"TrendTag".
Youcanfindalloccurrencesofatagbyrightclickingthetaginlogicandchoosing"FindAll".
LogixcontrollersareoptimizedfortheDINTandREALdatatypes.Usethesedatatypestoavoid
conversionoverheadandoptimizeperformance.
YoucanoptimizethecommunicationperformanceofacquiringdatafromLogixcontrollersby
consolidatingmultipledatavaluesintoaUserDefinedDataType(UDT)orarray.
Indexedreferencestoarrayelementsaddadditionalscantimeoverheadtotheapplication.Use
singledimensionarrayswheneverpossible.
WhenbuildingaUserDefinedType(UDT),locateallbitsorBOOLsadjacenttoeachotherto
minimizetheamountofcontrollermemoryrequiredtostorethedata.
RSLogix5000automaticallycreatescontrollertagswhenyoucreateaninputoroutputmodule.
Youcanreferencethesetagsdirectlyinyourlogic.
Usealiastagstoassignnamestospecificinput/outputdataand/ortoprovideashortalternativeto
lengthystructuremembernames.
Avoidpointingonealiastagtoanotheraliastagtoensuretheapplicationmaintainsthe
appropriatereferencesafteranupload.
Avoidpointingmultiplealiastagstothesamebasetagtoensuretheapplicationmaintainsthe
appropriatereferencesafteranupload.
Controllertagsapplytotheentirecontrollerandcanbereferencedbyanyprogram.Programtags
applyonlytoindividualprograms.Thismeansprogramtagscanhavethesamenamesinmore
thanoneprogram,allowingprogramstobecopiedandreused.
Youcanreorderthecolumnsinthetageditorbyclickingonthetitleanddraggingittoanew
position.
Alltagnamesaredownloadedandresidentinthecontrolleralongwithyourlogic.
Youcanexport(andimport)tagdefinitionstoacommaseparatedvalue(CSV)fileand
manipulatethemusingexternaltool,e.g.spreadsheet,texteditor.
Fortablesofbits(BOOL),useaDINTarraytoensurefullaccessviathefileanddiagnostic
instructionsCOP,DDT,FBC,etc.
Inasafetycontroller,standardtagsinasafetymappedrelationshipfollowsafetyrestrictedstates.
Forexample,astandardtagmappedtoasafetytagisreadonlyinasafetylockedstate.
TheorderofmemberswithinaUserDefinedTypeaffectthememorysizeofthedatatype.
WithintheUDT,keepmembersofthesamedatatypetogether.
Routines
Logixsupportsfourcontrollerprogramminglanguages:Ladder,FunctionBlockDiagram,
StructuredText,andSequentialFunctionChart.
Tosimultaneouslydisplaylogicinmultipleroutines,selectWindow>NewWindowandthen
arrangethewindowsmanually.OrselectWindow>TileHorizontal.
MultiplythenumberofwordsinaPLC/SLCprogramtimes18toestimatetheamountmemory
(inbytes)neededinaLogixcontroller.
Todisplaycontextspecificinstructionhelp,selectaninstructionorelementandpressF1.
TheLanguageElementbrowserisashortcuttoaddinglogic.Intheanyofthelanguageeditors:
useAlt+Insert,typetheinstructionmnemonic,andpressEnter.Youcanalsoinvokethisbrowser
bypressingtheInsertkeyintheLD,SFCandFBDeditors.Thisshortcutcanbemuchquicker
thanusingtheinstructiontoolbar.
Youcanfindalloccurrencesofatagbyrightclickingthetaginlogicandchoosing"FindAll".
YoucanusetheGoTodialog(Ctrl+G)toquicklynavigatetoroutinescalledbythecurrent
routineandtoroutinesthatcallthecurrentroutine.
Youcandraganddropfromtheinstructiontoolbarinanyofthelanguageeditors.InSFCeditor,
theelementsautoconnect.
UsetheCPSinstructiontoprovidebufferingofcommunicationsandI/Odatatominimizeimpact
ofasynchronousdataarrival.
Fortablesofbits(BOOL),useaDINTarraytoensurefullaccessviathefileanddiagnostic
instructionsCOP,DDT,FBC,etc.
Controllertagsapplytotheentirecontrollerandcanbereferencedbyanyprogram.Programtags
applyonlytoindividualprograms.Thismeansprogramtagscanhavethesamenamesinmore
thanoneprogram,allowingprogramstobecopiedandreused.
IntheSequentialFunctionChartEditor,youcanusetheRoutineOverview(Ctrl+B)tooltoview
yourentireSFCandhelpnavigatetoaspecificareaofyourchart.
Logixcontrollersperformaprescanoflogiconstartuptoperforminitialization.Atagusedasan
indexcancauseastartupfaultifitsvalueislargerthanthearraylength.UseaFaultroutineto
detectandresetthiscondition.
IntheSequentialFunctionChartEditor,youcanusetheindicatortagfieldinanactiontospecify
atagvaluetomonitorduringexecution.
IntheSequentialFunctionChartEditor,youcanselectmultipleSFCelementsandusetheLayout
SFCElementsfeaturetoautomaticallyrearrangetheselectedelementsasneededtoprovide
adequatespacing,avoidpageboundaries,andleftorcenterjustifybranches.
IntheSequentialFunctionChartEditor,youcanchangetheorderinwhichselectionbranchlegs
areevaluatedfromtheSetSequencePrioritiesdialog.
RefertotheOnlineHelpfortheActionPropertiesdialogGeneralTabOverviewforauseful
timingdiagramthatexplainshowthevariousactionqualifiersaffecttheexecutionofanaction.
YoucancustomizetheautonamingofSequentialFunctionChartSteps,Actions,Transitions,and
StopelementsfromtheWorkstationOptionsandRoutinePropertiesdialogs.
YoucanattachtextboxestolanguageelementsinFBDandSFClogictomaintaintheirrelative
positionsifyoumovelogic.
YoucanuseCtrl+SpacetoinvoketheTagbrowserfromwithintheSTeditor.
CommentsinStructuredTextaredownloadedtothecontroller.Thisincludescommentsin
StructuredTextroutinesandembeddedStructuredTextinSFCroutines.
IntheStructuredTextEditor,youseethewordscoloredtoindicatekeywords,tagnames,and
otherrecognizedwords.YoucanchangethecolorsusedbytheeditorbychoosingOptionsfrom
theOptionsmenu.
IntheStructuredTextEditor,youcanconfiguretheinstruction'sparametersbyrightclickingan
instructionnameandchoosing"InstructionProperties".
YoucanuseinstructionsavailableinLadderandFunctionBlockDiagramroutinesalsoin
StructuredTextroutines.
YoucanconfigurethesheetsizeforyourFunctionBlockDiagramorSequentialFunctionChart
routinesfromtheRoutinePropertiesdialog.
IntheFunctionBlockEditor,youcanconfiguretheblock'sparametersbyclickingtheBrowse
(...)buttonontheupperrightsideoftheblock.
RSLogix5000supportspendingeditsonmultiplerungswhenonlineeditingladderlogic.
Wheneditingladderroutines,youcancreatelogicusingASCII(forexample:"XICMYTAG")
byeithertypingwhenarungisselected,pressingtheEnterkeywhenarungisselected,ordouble
clickingtotheleftofarung.
IntheLadderDiagramEditor,youcaninsertabranchlevelabovethecurrentlevelbyright
clickingtheleftsideofthebranchandselectAddbranch.Toinsertabranchlevelbelowthe
currentlevel,rightclicktherightsideofthebranchandselectAppendNewLevel.
Partialimportofrungsworksinallladderroutines,includingAddOnInstructions.
Whenperformingapartialimportofrungs,changetagnamestocreatenewtagsintheimported
logic.
Onceyoudoapartialimportofrungs,addoninstructions,oruserdefineddatatypes,youcan't
undotheimport.Iftheimportdidn'tworkasexpected,closetheprojectwithoutsaving.
Onapartialimportofrungs,theexporteddatavaluesarealsoimported.Thisincludesconfigured
messageinstructions.Partialimports/exportscansavetimeversuscopyingandpastingsince
copyingandpastingdoesnotcopydatavalues.
CopypiecesoflogicintootherapplicationslikeMicrosoftWordinabitmapormetafileformat.
Ifyouwantasubroutinetoexecuteeveryscan,copythefirstinstructionandpasteitrightnextto
theoriginalinstruction.Usethesametagsontheduplicateinstructionasonthefirstinstruction.
TheninsertanAFIinstructionbeforetheduplicate.
Tocopyagroupofrungstopasteintoanotherroutinelater,selecttherungsanddragthemtothe
desktop.Thiscopiestherungsintoafilethatyoucanlaterdragintoanotherroutine.
YoucandragcomponentsfromtheControllerOrganizerintotheLadderEditorinstruction.
DoubleclickorpressEnterattheendofaladderrungtocreateandstartatextualeditofthat
rung.
Todragalanguageelementfromoneroutinetoanother,dragtheelementovertheroutinetabsat
thebottomoftheeditortoswitchtheroutine.
AddOnInstructions
TodisplaythelogicofanAddOnInstruction,selecttheinstructionandusethecontextmenu
(rightclick)toopenthelogic.
YoucandraganAddOnInstructionfromtheControllerOrganizerintoanylanguageeditor.
CopyanAddOnInstructionDefinitionfromoneprojectandpasteintoanothertomovethatAOI
andreferencedAOIsintotheproject.
UseAddOnInstructionstoinitializetagvaluestospecificvaluesatthebeginningofeachroutine
orprogramscan.ThensourceprotecttheAOItoassurethatvaluesarecorrectlyinitializedand
notoverwrittenmanually.
UsesourceprotectiononanAddOnInstructiontoprotectlocaltags,dataandlogic.
Communications
Reserve20%ormoreofthecontroller'smemorytoaccommodatecommunicationsandchanges
infutureLogixcontrollerfirmwarereleases.
UserackoptimizedcommunicationformatsfordigitalI/Omodulestominimizeamountof
controllermemoryandcommunicationsoverheadassociatedwiththesemodules.
UsetheCPSinstructiontoprovidebufferingofcommunicationsandI/Odatatominimizeimpact
ofasynchronousdataarrival.
Ondownload,iftheControlNetschedulestoredintheofflineRSLogix5000projectfileisold,
RSLogix5000willretrievethelatestControlNetschedulefromtheassociatedRSNetWorx
projectfile.TomakeanassociationtoanRSNetWorxprojectfile,usetheRSNetWorxtabinthe
ModulePropertiesdialogoftheControlNetscanner.
Whenworkingwithmultiplecontrollerprojectsindifferentchassis,useRSLinxshortcutsto
identifythosechassiswithmeaningfulnames.
DrivesandMotion
RSLogix5000integratedmotionsupportscamming,gearing,singleaxis,andmultiaxis
instructionsinLadderDiagram,StructuredText,andStructuredTextembeddedinSequential
FunctionCharts.
Executemotiondirectcommandsdirectlyfromthecontextmenuforanyconfiguredmotionaxis.
Themotiondirectcommandsletyoucontrolmotioninstructionexecutionwithoutcreatingor
addinglogic.Thiscanbeusefulwhenfirstcommissioninganaxisordrive.
Totunemotoranddriveparameters,suchasgainsforvelocityandaccelerationloops,aswellas
loaddynamics,usetheTunetabortheMRATandMAATinstructions.YoucanusetheTunetab
ineitherRemoteProgramorRemoteRun.
ThesoftwareautomaticallypopulatessomeSERCOSdriveparameterswhenyouconfigurean
Axis_Servo_Drive.Displaytheaxispropertiestovieworedittheseparameters.
InaSERCOSdrive'sconfiguration,youcanchangethenumberofcountsreturnedperrevolution
tomakethecountsperinchordegreeanrationalnumber.
Inamotionsystem,youcancopyoverallmotionhardwarefromanexistingprojecttoanew
projectwithoutlosinganyaxissettingsortuning.Firstdragthemotioncontrolmoduleovertothe
newproject.Then,draganydrives,theMotionGroup,andthentheaxes.
OptimizingPerformance
LogixcontrollersareoptimizedfortheDINTandREALdatatypes.Usethesedatatypestoavoid
conversionoverheadandoptimizeperformance.
YoucanoptimizethecommunicationperformanceofacquiringdatafromLogixcontrollersby
consolidatingmultipledatavaluesintoaUserDefinedType(UDT)orarray.
Indexedreferencestoarrayelementsaddadditionalscantimeoverheadtotheapplication.Use
singledimensionarrayswheneverpossible.
Reserve20%ormoreofthecontroller'smemorytoaccommodatecommunicationsandchanges
infutureLogixcontrollerfirmwarereleases.
UserackoptimizedcommunicationformatsfordigitalI/Omodulestominimizeamountof
controllermemoryandcommunicationsoverheadassociatedwiththesemodules.
UsetheCPSinstructiontoprovidebufferingofcommunicationsandI/Odatatominimizeimpact
ofasynchronousdataarrival.
Ifthememoryestimationbuttonisdisabled,itmeansthatyourestimationisuptodate.This
happensafteranestimate,butitalsohappenswhenyougoofflinewiththecontrollerbecausethe
offlinememorynumbersreflectactualuse.
TheorderofmemberswithinaUserDefinedType(UDT)affectthememorysizeofthedata
type.WithintheUDT,keepmembersofthesamedatatypetogether.
ProjectDocumentation
CommentsinStructuredTextaredownloadedtothecontroller.Thisincludescommentsin
StructuredTextroutinesandembeddedStructuredTextinSFCroutines.
YoucanprintRSLogix5000viewsbyclickingontheviewandthenpressingCtrl+Porchoosing
PrintfromtheFilemenu.
WhenyouprintFBDlogic,theeditorautomaticallymakesthelogicfitthepage.A2:1ratiois
generallyreadable.Forexample,settheFBDsheetsizeto11x17(BSize)andprinton81/2x11
sizepaper.
CopypiecesoflogicintootherapplicationslikeMicrosoftWordinabitmapormetafileformat.
Security
Ifyouarehavetroubledownloadingaprojecteventhoughyouhaveprivileges,makesurethat
youhavetheprojectandthatyouareonlinewiththecontroller.
Ifyoucan'taccessroutinesourceprotectionwhensecurityisenabled,askyouradministratorto
grantyou"Routine:ModifyProperties"toobtainaccess.
IfyoursystemusesFactoryTalkSecuritywithRSLogix5000software,version16,softwareusers
canlogintoandlogoffofRSLogix5000software.
Ifsecurityfunctionsareenabled,youmusthaveappropriateaccesstoimportrungsorto
copy/pastetagsanddata.
TheLogix5000EssentialManuals
TheAllenBradleyLogix5000family(ControlLogix,CompactLogix,FlexLogix,SoftLogix)hassome
verygoodmanuals.Ifyouarejuststartingoutorneedarefresherherearethekeymanualsandthe
orderIwouldreadthem.IfyouhaveRSLogix50000installedthenyouwillfindsomeoftheseinthe
Help>OnlineBooksmenu.Revision16alsohassomegreatvideosintheLearningCenter.
TheBasics
ForstartersthereistheQuickStartmanual.
Logix5000ControllersQuickStart
TheEssentials
Ifyouaregettingintoprogramminganddesigningasystemthenyou'llwanttostartoffwiththe
CommonProcedureManual.Ithasalotofhelpfulexamplesdealingwithallaspectsofthesystem.
Logix5000ControllersCommonProceduresProgrammingManual
Nextcomesthenittygrittyofeachinstruction.It'sagoodideatoatleastperusealltheinstructionsso
youhaveanideaofwhatisavailable.
Logix5000ControllersGeneralInstructionsReferenceManual
Logix5000ProcessControlandDrivesInstructionsReferenceManual
Logix5000ControllersMotionInstructions
GuardLogixSafetyApplicationInstructionSetReferenceManual
Anoftenoverlookedmanualbutfilledwithgreatinformationforgettingthemostoutyourdesignsis
theDesignConsiderationsReferenceManual.Certainlyamustreadifyouarekneedeepinthe
developmentandprogrammingofAllenBradleyPLCs.
Logix5000ControllersDesignConsiderationsReferenceManual
HardwareSpecifics
SpecificsforthehardwarecanbefoundintheUserManualsandInstallationInstructionsforthePLC.
ControlLogix
ControlLogixSystemUserManual
ControlLogixInstallationInstructions
ControlLogixControllerandMemoryBoardInstallationInstructions
CompactLogix
CompactLogixSystemUserManual
CompactLogix1769L20,1769L30InstallationInstructions
CompactLogix1769L32E,1769L35EInstallationInstructions
CompactLogix1769L32C,1769L35CRInstallationInstructions
FlexLogix
FlexLogixSystemUserManual
FlexLogixControllersInstallationInstructions
SoftLogix
SoftLogixSystemUserManual
SoftLogixControllersInstallationInstructions
GuardLogix
GuardLogixControllersUserManual
GuardLogixControllersInstallationInstructions
Networking
IfyouaredecidingonwhichnetworktousethenseetheDesignConsiderationsmanualandthesection
"DeterminetheAppropriateNetwork".Otherwise,forexistingnetworksthefollowingarehelpful.
Ethernet/IP
EthernetDesignConsiderationsforControlSystemNetworks
EtherNet/IPModulesinLogix5000ControlSystemsUserManual
GuardI/OEtherNet/IPSafetyModulesUserManual
ControlNet
ControlNetModulesinLogix5000ControlSystems
DeviceNet
DeviceNetModulesinLogix5000ControlSystemsUserManual
GuardI/ODeviceNetSafetyModules
ThelinksarefromtheABsitesotheyarethelatestandgreatestmanuals.Letmeknowifanyofthem
arebrokenorifIforgotoneyouthinkisessential.
UserDefinedDataTypes(UDTs)andOOP
byJohnSchop
Foryearsnow,ObjectOrientedProgrammingparadigm(orOOP)hasbeenacommonlyused
programmingpractice,andhasofcoursefounditswayintoindustrialautomationaswell.
Inthemeantime,mostPLCmanufacturershavefoundwaystomaketheprogrammerslifeeasierby
introducingUserDefinedTypesorUDTs.Thenamesaysitallitisatypethatyou,the
programmer,candefineallbyyourself.Thismeansthatyourprogrammingenvironmentwillnotonly
havetheregularintegers(INT)andBooleans(BOOL),butcouldalsohaveaVALVEtypeora
MOTORtype.
IcantspeakforotherbrandsofPLCs,buttheAllenBradleyControlLogixseriesofPLC
s,togetherwithRSLogix5000programmingsoftware,makesitveryeasytoworkwiththeseUDTs,
andsincetheintroductionofRSLogixversion17earlierthisyear,itisnowevenpossibletoedityour
UDTswhileonlinewitharunningsystem.
TheControllerOrganizerhasafoldercalledDataTypes>UserDefinedwithalltheUDTsinthe
project.
IamoftheopinionthateveryPLCprogramshouldrelyheavilyonUDTstoimprovereadability,andif
youareanOOPadept,itcanbeagreathelptoorganizeyourclasses.
LetsgooverthefundamentalsofOOPforalittlebit:
Classes:Classesdefinetheabstractcharacteristicsandbehaviorofanobject.Forexample,a
simpleVALVEclasswouldhavethecharacteristics(orattributes)thatitcanbeopenor
closed(thethingsitcanbe),andasfarasbehaviorgoes,itcouldhavethemethodstoopen
andtoclose(thethingsitcando)
Objects:Anobjectisaninstance(occurrence)ofaclass.Inourexample,therecouldbea
Valve_001andaValve_002,whicharebothinstancesoftheclassVALVE,withthe
sameattributesandmethods.
OfcoursethedefinitionofOOPgoesalotfurtherthanthis.Thereisaveryunderstandableexplanation
here:http://en.wikipedia.org/wiki/Objectoriented_programming#Fundamental_conceptsforthosewho
wouldliketoreadmore.Fornow,letsleaveitatthis,andseehowwecanapplythistoan
industrialenvironment.
Ifyoulookatavalveasanobjectinatypicalindustrialautomationenvironment,youshouldnotethe
following:
Ithasinputsandoutputsthatarespecificfortheobject(proximityswitchesandsolenoids).
Itcanbeeitheropenorclosed
Youcantellittogoopenorclose.
Itcouldhaveanalarmtimer,thatwouldtellusifthevalvedidnotopenorcloseinagiventime
periodafteracommand.
Itmighthaveinterlocks,whichallowthevalvetoopenorcloseundercertainconditions.
AUDTforthisclass,wouldfitallthesepropertiesandmethodsinonesimpletype.But,asalways,we
canexpectfurthercomplicationsoftheclassVALVEduringtherealizationofaproject.Tobe
asflexibleaspossible,IhighlyrecommendthepracticeofnestingUDTs,whichwillbecomeclear
alongtheway.
Letsstartwithdefiningourclass,andkeepinmindthatitwillhavetobeeasilyaccessiblefor
maintenancepeopleorotherprogrammers.
IfwestartattheI/Oend,thebestmethodistocreatesubclassescalledVALVE_INand
VALVE_OUT,whichwillcontainourI/O.
ThefollowingexampleusesRSLogix5000V16.First,createthesubclasses.FromtheFilemenuselect
NewComponent>Tag.ThefollowingdialogboxappearstocreateandeditthemembersoftheUDT.
Now,makeaUDTcalledVALVE,andnestthesesubUDTsinit:
Asyousee,IamallowedtotakethetypesIjustcreatedasthedatatypeinthisUDT.Thereal
advantageofthisfeaturewillbecomeclearifyoucreateaobjectcalledValve001ofthetypeVALVE,
andlookattheobjectinthemonitortagswindow:
Wow!JustbycreatinganewtagofthetypeVALVE,itgetsalltheseI/Opointsrightaway,and
referencedintheprogram:
Ofcourse,goingfurtherwiththisconcept,everythingforavalvecanbeincludedinoneobject.Allow
metoskipsomesteps,andshowyouapossiblefinalresult:
TheVALVEclassisnowcontainedinaUDTcalledVALVE,whichlookslikethis:
Asyousee,theclassVALVEnowconsistsofthesubclassesVALVE_IN,VALVE_OUT,
VALVE_TIMER,VALVE_STATUS,etc.
Andaninstanceofthisclass,theobjectValve001,wouldlooklikethis:
Whileaddingstufftomyclass,IdidnothavetorecreatetheobjectValve001.RSLogixupdateditfor
me,soallthepropertiesandmethodsareavailableinmyprogram.
Now,letssayyoureworkingonthisprojectwithacouplehundredvalves,andthecustomer
decidestogowithadifferenttypeofvalve,thatalsohasananaloginput,thattellsustheexactposition
ofthevalve.AllwehavetodoismodifyourVALVE_INsubclasstoaddthistoeveryinstanceofthe
typeVALVE:
Ofcourse,youwouldstillhavetowritecodetotellyourprogramwhattodowiththatinformation,but
thatisalsothereasonwhyPLCprogrammersstillhaveajob.
Forsomebodythatisnotfamiliarwithyourprogram,itmightbeconfusingtolookatallyourUDT
s.WejustmadeeightUDTsforonesimplevalveclass!Butremember,youonlyhavetodo
thisduringthedesignphase.Onceyouhaveasoliddesignforallyourclasses(andmadesuretheir
namesareselfexplanatory),youwillneverhavetolookatyourUDTfolderagain,andcreatinganew
instancewillbeabreeze.
ConnectingExceltoControlLogix
byJohnSchop
HaveyoueverlostdatainaCLXprocessor,becauseyoudownloadednewcode?Unfortunately,when
youdonwloadaprogramtoaControlLogixprocessor,youalsodownloadthevaluesofthetags
(variables).
Asolutiontothisproblemthatcouldbeuseful,isanExcelsheetthatreadsandwritesvaluestothe
ControlLogixprocessorusingtheDDE/OPCcapabilitiesofRSLinx.
Inthisarticle,Iwillshowyouhowtocreateoneofthesesheetsforyourprojects.
Here'swhatyou'llneed:
MicrosoftExcel,withsomebasicknowledgeaboutprogrammingmacro'sinVisualBasic
RSLinx(notthe'Lite'version,becausethatdoesnothaveDDE/OPCcapabilities)
AControlLogixprocessorofcourse
Let'sfireupRSLogixfirst,andcreateabunchoftagswithvalues.Inthisexample,Icreated2arrays,of
thetypesDINTandREAL,eachwithalengthof[10]tags.ThesearraysIfilledwithsomevalues:
I'mnotgoingtodoanythingwiththePLCprogram,Ijustneedsomedatainanumberoftags.
Next,we'regoingtosetupaDDE/OPCTopicinRSLinx.DependingontheversionofRSLinxyouuse,
itmightlookslightlydifferent,butyoushouldbeabletofollwthiswiththescreenshots.
AssumingthatyouknowhowtosetupRSLinxinitallytogetonlinewithyourcontroller,I'veskipped
somesteps.ThesetupIuselookslikethisinRSLinx:
Asyoucansee,Ihavea10slotCLXrack,witha1756ENBTcardinslot1(address134.200.211.16),
andtwoprocessors,oneinslot0,andoneinslot2.Theoneinslot2istheprocessorwearegoingto
useforthisexercise.
Now,openuptheDDE/OPCtopicconfigurationbyclicking'DDE/OPC'andthen'TopicConfiguration'
inthetopmenuofRSLinx.
I'mgoingtocreateanewDDE/OPCtopiccalled'EXCEL_TEST',andusetheLogix5550processorin
slot2asthedatasource.Inordertodothis,youhavetoclickthe'New'button,givethetopicthe
desiredname,andmakesuretheprocessorinslot2isselectedasthesourcebeforeyouclick'Done'
Totestifyoursetupisworking,atthispointyoucanusetheOPCtestclientprovidedwithRSLinx.I'm
notgoingintodetailaboutthat,butIdidmakesurethisworkedbeforecontinuingwiththenextstep,
creatingtheExcelsheet.
Let'sstartupgoodoldExcel,andcreateanewworkbook.Onthisworkbook,placeanewcommand
button.YoucanfindtheCommandButtoncontrolinthe'ControlToolbox'toolbarinExcel.Whenyou
havethebutton,rightclickonitandchoose'ViewCode'.ThiswilltakeyoutotheVisualBasicEditor:
First,createafunctionthatwillopentheDDEtopictoExcel:
Now,ifIcallthisfunctionfromtheCommandButton1_Clickevent,itwillopenthelinktoRSLinx:
Thevariable'rslinx'willholdthenumberoftheopenchannel.AllsubsequentDDEfunctionsusethis
numbertospecifythechannel.
Tosaveyouallthestepstoprogramtherestofthecode,hereisthefinalcodetogetthearrayof
REALsoutofthecontroller,andputthemincellsD2D11,andthearrayofDINTsincellsE2E11.
Nowweknowhowtoread,itwouldofcoursebealotoffunifwecouldwritevaluesaswell.Iwould
liketobeabletochangethevaluesinthecells,andthenhita'WriteData'button.
First,makeanotherbuttononthesheet(minelookslikebelownow)
Andthenwritesomecodeforthebutton:
Thewaythisisimplementedisofcourseveryrudimentary,butonceyougettheconcept,theskyisthe
limit.
Tomakethiseasieroneverybody,I'veincludedtheExcelfilewiththecodealreadyinit.Theonlything
youhavetodotomakethisExcelsheetwork,ismakesurethereisanDDE/OPCtopicinyourRSLinx
setupcalled'EXCEL_TEST',andthearraysREAL_ArrayandDINT_Arrayinyourcontroller(ofat
leastlength10).