GFK-2220B1ModbusRTUMasterCommunicationsThisdocumentdescribestheoperationofModbus®RTUMasterfromtheuserinterfacepointofview.UsethisinformationasasupplementtotheSerialCommunicationsUser’sManual(GFK-0582).Thisdocumentcontainsthefollowinginformation:OverviewSupportedProductsModeofOperationCOMMREQsTimeConstraintsSerialConnectionsStandardsMultidropConnectionsDriversandReceiversCableGroundingConnectorWiringFour-WireTwo-WirePoint-to-PointCOMMREQFunctionBlockFormatCOMMREQFunctionBlockParametersCOMMREQFunctionBlockOutputCOMMREQCommandDataBlockModbusRTUMasterStatusWordFormatQueueLimitationsforModbusRTUMasterCOMMREQsLocalDataModbusRTUMasterDiagnosticStatusWordsModbusRTUMasterCommandsInitializeRTUMasterPort:65520(FFF0)ClearRTUMasterDiagnosticStatusWords:08000(1F40)ReadRTUMasterDiagnosticStatusWords:08001(1F41)SendRTURead/Force/PresetQuery:08002(1F42)SendRTUDiagnosticQuery:08003(1F43)ErrorCodesExampleApplication®ModbusisaregisteredtrademarkofSchneiderElectric.2ModbusRTUMasterCommunications-December2003GFK-2220BOverviewModbusSerialLineprotocolisanopenstandardfordatacommunicationsbetweenPLCsandrelateddevices.TheModbusSerialLinestandardprovidesforcommunicationusingeitherprintablecharactersexclusively(ModbusASCII),orbinarydata(ModbusRTU).ThisdocumentdescribesModbusRTUMastercommunicationsonGEFanucPLCCPUs.SupportedProductsModbusRTUMastercommunicationsiscurrentlyavailableontheSeries90™-30IC693CPU363andVersaMax®modularCPUmodelsIC200CPU001,IC200CPU002,IC200CPU005andIC200CPUE05.ModeofOperationAModbusRTUmasterdevice(theclient)sendsquerymessagestooneormoreslavedevices(theservers)onaserialnetwork.Queriesmaycontaindata,requestsfordataorstatus,orcommands.Eachslaveonthenetworkhasauniquedeviceaddress.Anyquerymaybeaddressedeithertoaspecificslavedeviceortoaspecialbroadcastaddress.Queriesaddressedtothebroadcastaddressarecalledbroadcastqueries.Queriesthatrequirearesponsemaynotbeaddressedtothebroadcastaddress.Aslavethatreceivesawell-formed,non-broadcastquerymustsendaresponsemessagetothemaster.Thequery/responsetransactioncompleteswhenthemasterreceivesawell-formedresponse.Slavesdonotrespondtobroadcastqueries.Aftersendingabroadcastquery,themastermustwaitaspecifiedtimebeforecompletingthetransactionandsendingthenextquery.Somebroadcastqueriescontaincommandsthatrequiretheslavestotakespecifiedactions.COMMREQsTheapplicationprogramrunninginthePLCCPUcontrolsthetimingandcontentofeachquerybysendingaCOMMREQmessage.TheCOMMREQmustbeaddressedtotheCPUserialportthatisconnectedtotheModbusRTUserialnetwork.COMMREQdataspecifiesthecontentofthequery.Whenthequery/responsetransactioncompletes,aCOMMREQstatusvalueindicatesthesuccessorfailureofthetransaction.SeetheCOMMREQFunctionBlockFormatsectionofthisdocumentandthesectionsthatfollowitfordetails.TimeConstraintsTheModbusoverSerialLineSpecificationandImplementationguideV1.01containsseveralimportanttimingrequirements.SerialConnections™Series90andVersaMaxaretrademarksofGEFanucAutomation.1ThecurrentModbusRTUspecificationisavailableonlineinthedocumentsModbusApplicationProtocolSpecificationV1.1andModbusoverSerialLineSpecificationandImplementationguideV1.0at(upto247)slavedevices.Aserialnetworkinterconnectsallthesedevices.Ifthereisonlyoneslave,apoint-to-pointconnectionisused.Amultidropconnectionisneededfortwoormoreslaves.StandardsVirtuallyallPLCserialcommunicationsports(includingallserialportsonGEFanucPLCCPUs)supportone(ortwoorthreeinsomecases)ofthreephysicallayerstandardsforasynchronousserialcommunications.ThecurrentrevisionsofallthreemaybepurchasedfromtheTelecommunicationsIndustriesAssociationat:InterfaceBetweenDataTerminalEquipmentandDataCircuit-TerminatingEquipmentEmployingSerialBinaryDataInterchange(ANSI/TIA/EIA-232-F-1997)Thisstandardiscommonlyreferredtoas“RS-232”or“RS-232C”becausethedefinitiveearlierrevisionwastitled“RS-232-C”.RS-232portstransmitandreceivedataandcontrolsignalsonunbalancedcircuits.Thatis,oneSignalCommon(orSignalGround)wireservesasthereturnpathforallthedataandcontrolcircuits.RS-232portsaresuitableforpoint-to-pointconnectionsuptoabout25metersinlength,butnotforlongerlinesormultidropconnections.Thespecificationrecommendslimitingthedatarateto(ineffect)19,200bitspersecond(bps)orless,butratesup115,200bpsarefrequentlyusedwithshortcables(typicallyabout2meters).EIA/TIA-422-B:ElectricalCharacteristicsofBalancedVoltageDigitalInterfaceCircuits(ANSI/TIA/EIA-422-B-94,revised2000)Thisstandardisusuallycalled“RS-422”becausetheinitialrevisionhadthattitle.Itspecifiestwisted-paircablingandabalancedlinedriverandreceiverforeachcircuit.RS-442supportshigherdataratesandlongerdistancesthanRS-232.A100-ohmnominalimpedanceisrecommendedfortwistedpaircircuitsincables,and100-ohmterminatingresistorsarerecommendedforthereceivingendofeachcircuit.SomeRS-422portssupportmultidrop(multipoint)operation.However,thiscapabilityisnotguaranteedbythestandard.Usecautionwhenattemptingt