serial communication protocol
TRANSCRIPT
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
CONTENTSINTRODUCTION 1
OVERVIEW 1 GLOSSARY 2 COMMUNICATIONPORT 2 ADDRESSSETTINGPROCEDURE 3 PROTOCOLSPECIFICS 3 Packet Length 4 Checksum 4 ACK/NAK Handshake 5 TIMEDIAGRAM 6
PROTOCOLPACKETDEFINITION 6
PACKETFORMAT 6 Start Code 6 Slave Address 6 Length 6 Command 6 Data 7 Checksum 7
GENERICDATAFORMATS 7 Date Format 7 Time Format 7 Date/Time Examples: 7 Concentration Code: 7 Concentration Data Format Code 8 Concentration Example: 8
GENERICRESPONSES 8 ACK - 0x01 8 NAK - 0x21 9 Bad Packet - 0x66 9 Unknown CMD –0x67 9
PROTOCOLCOMMANDDEFINITION 9 HANDSHAKECOMMAND–0X40 9 Command packet to instrument: 9 Example: 9 Response packet from instrument: 9 Example: 9
GETUNITANDPOINTSSTATUS-0X30 10 Command packet to instrument: 10 Example: 10 Response packet from instrument: 10 Example: 11
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
RESETFAULT&ALARM–0X41 12 Command packet to instrument: 12 Example: 12 Response packet from instrument: 13 Example: 13
PHYSICALLAYER 13
PREAMBLE 13 ELECTRICALINTERFACES 13 Multipoint Serial Bus Infrastructure 13 Multipoint System requirements 14 MECHANICALINTERFACES 15 Connectors pin-out 15
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
1
Introduction
Overview ThismanualdescribesthesetupandoperationoftheTouchpoint4SerialCommunicationprotocol.
YourTouchpoint4gasdetectorcontrollerisequippedwithaserialremotedevicecommunicationport.Withthiscommunicationport,youcanmonitortheTouchpoint4system’soperationwithmasterfromaremotelocation.Itwillalsoallowyoutogathergasconcentrationdataforanalysisorreports.
TheTouchpoint4gasdetectorcontrolleracceptscommandsandissuesresponsestoanyvalidcommanditreceives.TheTouchpoint4gasdetectorcontrollerisalwaysthe“slave”device,andtheremoteequipmentisthe“master”device.Themastercanbeapersonalcomputer(PC),aprogrammablelogiccontroller(PLC),orotherdevicecapableofRS-485serialcommunications.Thisconfigurationrequiresa“master”device.
Therefore,oneTouchpoint4gasdetectorcontrollerwillnotcommunicatedirectlywithanotherTouchpoint4gasdetectorcontroller.However,onemastercanbeusedtocommunicatewithmorethanoneTouchpoint4gasdetectorcontrollersonatwo-wireRS-485bus.
TheTouchpoint4gasdetectorcontrollersupportsmultiplebaudrates.Theseuserselectableratesare1200,2400,4800,9600,and19,200.Additionalportsettingsare8-bit,1stopbit,andnoparity.
TheslaveisidentifiedbyanaddressconfiguredintotheTouchpoint4gasdetectorcontroller(selectable1-16).EachTouchpoint4gasdetectorcontrolleronanRS-485networkmusthaveauniqueaddress.
Themasterisalwaysataddress0.EachTouchpoint4gasdetectorcontrollerwillrespondtoasignaldirectedtoitfromthemaster.Topreventacollisionofmessages,themastermustavoidtransmittinganyinformationafterapacketuntiltheslaveresponds.Touchpoint4willrespondin500ms.
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Glossary
Thefollowingtermsareusedinthismanual:
Handshake:Theprocessofacknowledgingacommunicationhasbeenreceived.TheTouchpoint4gasdetectorcontrollerusesACK/NAKresponses.
Hexadecimal:Atypeofnumberingsystemwithabaseof16.Inthisnumericalsystem,thelettersAthroughFrepresentsnumbers10through15respectively.Forexample,3Finhexadecimalrepresents63indecimal.Theshortenedversionofthewordhexadecimalisgenerally"Hex",asin"Hex3F.""0x"isthenotationusedinthismanualforhexadecimal(e.g.0x3F).
Instrument:ThistermisusedtorefertotheTouchpoint4gasdetectorcontroller.
Master:AcomputerorPLCthatcommunicateswithslavesusingtheTouchpoint4protocol.
Packet:Ablockofinformationthatispassedbetweenthemasterandtheslave.Apacketismadefrommanybytesofinformation.
Protocol:Themannerinwhichdataistransferredandtheformatusedforthetransfer.Touchpoint4protocolreferstothepacketsoftransferreddatatheTouchpoint4instrumentrecognizes.
Slave:Touchpoint4gasdetectorcontroller.Anetworkmayhaveseveralslaves.
Time-Out:Themaximumamountoftimeallowedbetweenthetimethelastbyteofapacketissentfromthe“master”devicetothetimethe“slave”deviceresponds.Thetime-outperiodof1secondisrecommendedforthisprotocol.Infact,theperiodfromrequesttransmissiontoresponsereceptionisnotmorethan500ms.
2
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
3
Communication Port
AccesstotheTouchpoint4protocolisthroughtheterminalblockonthecommonmoduleofTouchpoint4gasdetectorcontroller.ThisportisdesignedforbidirectionalcommunicationsbetweentheTouchpoint4instrumentandyourmaster.
SignalspresentattheportconformtoRS-485specifications.Thepin-outspecificationsaredescribedinthechapterconnectors pin-out.
Address Setting Procedure
Afterthenetworkingcablinghasbeenconnectedtotheslave,theslavemustbeconfiguredtocommunicate.Baudrateandaddressareselectable.Configurationisperformedwiththefollowingsequence:
1. AccessthemenusystemandselecttheRS485 communication link settingsmenuoption.PressUP/DOWN,theiconflashes.
2. PressOK,thecontroller’scurrentaddressisdisplayed.
3. UseUP/DOWNtochangetheaddress(between1and16available).
4. PressOKtoacceptthechange. Thedisplaychangestodisplaythecurrentbaudrate.
5. UseUP/DOWNtochangethebaudrate(1200,2400,4800,9600, 19200available).
6. PressOKtoacceptthechange.
PleaserefertotheTechnicalManualformoredetails.
Protocol Specifics
Theprotocolhasbeendesignedforflexibilityandefficiency.Thisbyte-wiseprotocolcommunicatesinformationbytransferringbytesofdatabackandforthbetweenmasterandslave.Agroupofbytesforeachcommunicationiscalledapacket.
Themasterandslave(s)transferinformationviadatapackets.Thesepacketswillalwayscontainbytestostartcommunication,anaddress,alength,acommand,oneormoredataandachecksum.
Additionaloptionalvariable-lengthdatabytesoroptionalparameterscanalsobesentorreceived.Thissectionisabriefoverviewoftheprotocolspecifics.
Packet LengthJustasallwordsarenotthesamelength(numberofletters),packetsmayalsovaryinlength.Inthisprotocol,thelengthofcommandanddatafieldisputbeforecommandfieldinthepacket.Yourdatacontaining"0x42,0x41,0x44"willthenbecome“0x03,0x42,0x41,0x44”.
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
ChecksumDuringtransmissionofthepacket,anerrorcouldchangethevalueofthedata.Supposeinourexample,forinstance,thepacket0x03,0x42,0x41,0x44isactually0x03,0x42,0x30,0x44.Howcanyoudeterminethatthenumbersyougetarethesameasthenumberssent?
Touchpoint4serialcommunicationprotocolusesaXORcheck-characterasamethodofassigningavaluetothepackettocheckifanyofbyteshavebeenmodified.
IfallthedatabytesareXOR-edtogetherandthischeckmadeintoabyte,thisbytecouldbecalledachecksumcharacter.FortheTouchpoint4,thechecksumisthebit-wiseXORresultofallthebytesinthepacket.Inourexample,thepacketis0x03,0x42,0x41,0x44.Forthispacket,theXORresult0x44ofallthebytesaddedtothechecksummustbezero(0).Anyotherresultindicatesthereisanerrorwiththedata.
Itisusuallyimportantforthemastertothoroughlycheckdatacomingfromtheslaveforvaliditybeforeacceptingit.Thisisbecauseinmanyinstallations,analarmfromtheTouchpoint4indicatesseveredangertolifeandproperty.Themaster'sdeterminationthatanalarmexistsmaystimulateavigorousandpossiblyexpensivehumanresponse.Thereforeitisimportanttoavoidfalsealarms.Themastershouldrejectanypacketsthatcontainaninvalidstartcharacter,aninvalidaddress,aninvalidlengthbyteoraninvalidchecksum.Otherwisetheprobabilityofanevacuationbecauseofsimplenetworknoiseisunnecessarilylarge.
Theactualdatainthepacketisinterpretedinasomewhatdifferentmannerfromourpreviousexamples.BoththemasterandtheslavecommunicateusingthepacketformatinFigure 2.Itcontainsastartcode,anaddress,alength,acommandanditsassociateddata,andachecksum.Thestartcodeisfixed.Theaddressistheslaveaddressregardlessofthepacket’sorigin.Thelengthindicatesthenumberofbytesofcommandanddatafield.Thecommandindicateswhattypeofinformationisbeingtransmittedinthepacket.TheDatafieldisnullinsomecases.Ifexist,itcontainsspecificargumentsorvaluestobeinterpreted.ThechecksumisXORresultofallpreviousbytes.
ACK/NAK HandshakeEachslave(Touchpoint4)usesahandshakeschemebetweenitselfandthemaster.ThesimplestresponsebackfromtheinstrumentiscalledanACK(anabbreviationforACKnowledge).Whentheslavereceivesthehandshakecommand(0X40)packetfromthemaster,itwillsendbackanACKresponse.TheACKresponsewillbe0x01followedbythehandshakecommand0x40(see Handshake command).
Ifhowever,thechecksumdoesnotmatch,theslavewillsendaNAK(anabbreviationforNegativeAcKnowledge).ANAKindicatesthatadatapackethasbeenreceived,butthechecksumdidnotmatchwiththepacketdata.
Themastermaysendtherequestagain.AnexampleofanACKpacketis0x7F,0x01,0x02,0x40,0x01,0x3D(7FXOR01XOR02XOR40XOR01=0x3D).
4
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Time diagram
Figure 1. Communication time diagram
Protocol Packet Definition
Packet Format
TheformatofpacketsusingTouchpoint4SERIALCOMMUNICATIONPROTOCOLisasfollows:
Figure 2. Protocol packet format
Start Code Size:1byte.Always0x7F.
Slave Address Size:1byte. RepresentstheTouchpoint4gasdetectorcontrolleraddress, 0X01to0X10(1to16decimal).
Length Size:1byte. ThenumberofbytesintheCommandfieldandDatafield. Thetotalpacketlengthis4byteslargerthanthis.
Command Size:1byte. Thisis0x30,0x40or0x41asdefinedintheremainderofthisbook.
Data Size:0-250byte(s). Thissectionvariesaccordingtothechosencommandandmay beomitted.
Checksum Size:1byte Thebit-wiseXORresultofallthepreviousbytesinthepacket. ThismakestheXORoftheentirepacket0X00.
StartCode
SlaveAddress
Length Command Data Checksum
5
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Generic Data Formats
Date Format 2bytes. Bit: 1598540
Year Month Day
Figure 3. Data format
Year: (7bits) Month: (4bits) Day: (5bits)
Yearisbasedfrom1980.1989wouldbe1989-1980=9.
Time Format 2bytes
Bit: 151110540
Year Month Day
Figure 4. Time format
Hours: (5bits) Minutes: (6bits) Seconds: (5bits)
Secondsalwaysbe0.
Date/Time Examples:
Date:1F56 Oct.22.1995 Date:1F75 Nov.21,1995 Time:13C0 02:30:00 Time:7400 14:32:00 Time:4700 08:56:00
Concentration Code:
2bytes Bit: 15870
H L
Figure 5. Concentration code format
Forexample,(HEX)013Drepresentsthevalueis317.
6
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Concentration Data Format Code
UUXXXYYY UU Unit UU=00ppm UU=01%LEL UU=10%V/V UU=11kppm XXX reserved YYY decimalplace YYY=000 nodecimalplaces YYY=001 1decimalplace YYY=010 2decimalplaces YYY=011 3decimalplaces
Forexample,(HEX)81(10000001)represents%V/Vwith1decimalplace.
Concentration Example:
Foraconcentrationvalue(HEX)0062,98decimal,FormatCodeInterpretation:
00000000(00) 98ppm 10000001(81) 9.8%V/V 01000000(40) 98%LEL
Generic Responses
Therearefourgenericresponses.Eachoftheseresponsepacketsis6bytes,andcontainsthestartbyte,address,length,commandcode,ACK/NAKcodeandChecksum.AllACK/NAKcodeissentfollowingthecommandcodeinthelastreceivedpacket.
ACK - 0x01 Thisisusedforanacknowledgementofthehandshakecommand.
NAK - 0x21 Thisisusedforanegativeacknowledgementofpacketifthelastreceivedpackethadanincorrectchecksum.
Bad Packet - 0x66Thisissenttothemasterwhenthestartbyteorlengthinthelastreceivedpacketisincorrect.
Unknown CMD –0x67Thisresponseissentbytheslavewhenacommandisnotrecognized.
7
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Protocol Command Definition
Handshake command – 0x40
Thisisusedtotestforcommunicationbetweenthemasterandthespecifiedslave.
Command packet to instrument: Commandcode: 0x40 Datafield: null Checksum: 1byte
Example:Ifthemasterwantstotestthecommunicationwiththeaddressed01instrument,itshouldsendout:
0x7f0x010x010x400x3f.
Response packet from instrument: Commandcode: 0x40 ACKcode: 0x01 Checksum: 1byte
Example:Theaddressed01instrumentreceivesthehandshakecommandandresponses:
0x7f0x010x020x400x010x3d.
Get unit and points status - 0x30
Thiscommandrequeststheinstrumentdate,time,alarmstatus,faultstatusandup-to-fourchannel(s)status.
Command packet to instrument: Commandcode: 0x30 Datafield: null Checksum: 1byte
Example: 0x7f0x010x010x300x4fmeansthemasterrequeststhestatusofthe instrumentwhoseaddressis1.
Response packet from instrument: Commandcode: 0x30 Datefield: Date: 2bytes Time: 2bytes Unitalarmstatus: 1byte 0x00: noalarm 0x01: A1alarm 0x02: A2alarm 0x03: A1andA2alarm
8
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Unitfaultstatus: 1byte 0x00: nofault 0x01: linecircuitfault 0x02: negativedraft 0x03: inDC2ACfault 0x04: inDC2DClowvoltage 0x05: inDC2DCfault Channel(s)status: 6*nbytes (n=quantityofchannels)
Everychannelstatushas6bytes,definedasfollowing: Channelnumber: 1byte(1to4) Concentrationformat: 1byte Concentration: 2bytes Channelalarmstatus: 1byte(refertounitalarmstatus) Channelfaultstatus: 1byte(refertounitfaultstatus) Checksum: 1byte
Eachchannelstatusdatacontains6bytes,sothelengthfieldoftheresponsepacketdependsonthequantityofthechannelofTouchpoint4.Forexample,ifthereare4channels,thelengthwillbe
1(Command)+6(Data+Time+Unitalarmstatus+Unitfaultstatus)+6(bytesperchannel)*4(channels)=31.
Ifthereare2channels,thelengthwillbe
1+6+6*2=19.
NotethatonceinstrumentreceivestheGet unit and points status command,italwayssendoutallitschannels’status.
Example:
Example1: 0x7f0x010x0d0x30 0x1f0x56 date:OCT.22,1995 0x130xc0 time:02:30:00 0x01 alarm:A1alarm 0x00 fault:nofault 0x01 channelnumber:1 0x810x000x62 concentration:9.8%V/V 0x01 alarm: A1alarm 0x00 fault: nofault 0x3b checksum
TheexamplemeansthisTouchpoint4gasdetectorcontrolleronlyhasone channelconnected.
9
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Example2: 0x7f0x010x130x30 0x1f0x56 date:OCT.22,1995 0x130xc0 time:02:30:00 0x01 alarm:A1alarm 0x00 fault:nofault 0x02 channelnumber:2 0x810x000x62 concentration:9.8%V/V 0x01 alarm: A1alarm 0x00 fault: nofault 0x03 channelnumber:4 0x810x000x62 concentration:9.8%V/V 0x01 alarm: A1alarm 0x00 fault: nofault 0xC7 checksum
TheexamplemeansthisTouchpoint4gasdetectorcontrollerhastwo channelsconnected,Channel2andChannel4.
Example3: 0x7f0x010x1f0x30 0x1f0x56 date:OCT.22,1995 0x130xc0 time:02:30:00 0x01 alarm:A1alarm 0x00 fault:nofault 0x01 channelnumber:1 0x810x000x62 concentration:9.8%V/V 0x01 alarm: A1alarm 0x00 fault: nofault 0x02 channelnumber:2 0x810x000x62 concentration:9.8%V/V 0x01 alarm: A1alarm 0x00 fault: nofault 0x03 channelnumber:3 0x810x000x62 concentration:9.8%V/V 0x01 alarm: A1alarm 0x00 fault: nofault 0x04 channelnumber:4 0x810x000x62 concentration:9.8%V/V 0x01 alarm: A1alarm 0x00 fault: nofault 0xCE checksum
TheexamplemeansthisTouchpoint4gasdetectorcontrollerhasfour channelsconnected,Channel1toChannel4.
10
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Reset fault & alarm – 0x41
Thiscommandallowsaremoteresetoflatchedvisual,audioandrelayoutputsresultedfromanalarmorfault.
Command packet to instrument:Commandcode: 0x41Datafield: null
Example:Ifthemasterwantstoresetlatchedoutputsofaddressed01instrument,itshouldsendout:
0x7f0x010x010x410x3e
Response packet from instrument:Commandcode: 0x41Datafield: null
Example:Theaddressed01instrumentreceivestheresetfault&alarmcommandandresponses:
0x7f0x010x010x410x3e
11
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
PHYSICAL LAYER
Preamble
ThephysicallayerofTouchpoint4serialcommunicationprotocolisanelectricalinterfaceinaccordancewithEIA/TIA-485standard(alsoknownasRS485standard).InTouchpoint4serialcommunicationsystem,aMasterDeviceandoneorseveralSlaveDevicescommunicateonabalancedtwistedpair,onwhichbi-directionaldataaretransmitted,atthebitrateasuserconfigured.
Electrical Interfaces
Multipoint Serial Bus InfrastructureTouchpoint4SerialCommunicationsystemimplementsa“Two-Wire”electricalinterfaceinaccordancewithEIA/TIA-485standard.Onsucha2W-bus,atanytimeonlyonedriverhastherightfortransmitting.
ThefollowingfiguregivesageneraloverviewoftheserialbusinfrastructureinTouchpoint4SerialCommunicationsystem.
Figure 6. Communication infrastructure
TheTouchpoint4gasdetectorcontrollersareconnecteddirectlytothetrunkcable.Themaster,PCorPLC,isconnecteddirectlyorviaaderivation,accordingtothemasterinstruction.Thecableshouldbeshielded.
Note:theTouchpoint4RS-485interfaceisnotelectricallyisolated.Acommonmodevoltageof7voltorgreaterbetweenanytwonodesonthenetworkwillinterferewithcommunications.ProperearthingofeveryTouchpoint4andtheMasterisessential.
Multipoint System requirementsMaximumnumberofdevices:
Althoughafigureof32devicesisalwaysauthorizedonanyRS485systemwithoutrepeater,thetotalnumberislimitedto16inTouchpoint4SerialCommunicationprotocolbecauseofaddressinglimitations.
12
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
TopologyTouchpoint4SerialCommunicationsystemhasonetrunkcable,alongwhichdevicesareconnected,directly(daisychaining)orbyshortderivationcables.
Thetrunkcable,alsonamed“Bus”,canbelong(seehereafter).ItstwoendsshouldbeconnectedtoLineTerminations.
LengthTheend-to-endlengthofthetrunkcablemustbelimited.Themaximumlengthdependsonthebaudrate,thecable(Gauge,CapacitanceorCharacteristicImpedance),andthequantityofloadsonthedaisychain.
Foramaximum9600BaudRateandAWG26(orwider)gauge,themaximumlengthis1000m.
Ifthederivationcableisneededfortheconnectionofthemaster,thederivationmustbeshort,nevermorethan20m.
Grounding ArrangementsAtoneendofeachcableitsshieldmustbeconnectedtoprotectiveground.
Line TerminationTominimizethereflectionsfromtheendoftheRS485-cable,itisrecommendedtoplaceaLineTerminationneareachofthe2EndsoftheBus.
Itisimportantthatthelinemustbeterminatedatbothendssincethepropagationisbi-directional,butitisnotallowedtoplacemorethan2LTononepassiveD0-D1balancedpair.NeverplaceanyLTonaderivationcable.
Eachlineterminationmustbeconnectedbetweenthetwoconductorsofthebalancedline:D0andD1.
Lineterminationmaybearesistorof100ohmsto150ohms(0.5W).
Pull-up and Pull-down Resistors LinecontrolhasbeenimplementedinTouchpoint4gasdetectorcontrollersothatthebuscontainsavalid"off"signalwhennonodeistransmitting.Noexternalpull-uporpull-downresistorsareneeded.
13
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Mechanical Interfaces
Connectors pin-outThefollowingfigureshowsthepin-outontheterminalblockofTouchpoint4gasdetectorcontroller.
Figure 7. Touchpoint4 communication pin-out
14
Touchpoint 4 Serial Communication Protocol Issue 1 09/07
Issue 1 09/2007
H_MAN0847
09-07
© 2007 Honeywell Analytics 1223
5
Find out more
Contact Honeywell Analytics:
www.honeywellanalytics.com
Europe, Middle East, Africa
Life Safety Distribution AG
Wilstrasse 11-U11
CH-8610 Uster
Switzerland
Tel: +41 (0)44 943 4300
Fax: +41 (0)44 943 4398
Americas
Honeywell Analytics Distribution, Inc.
400 Sawgrass Corporate Pkwy
Suite 230
Sunrise, FL 33325
USA
Tel: +1 954 514 2700
Toll free: +1 800 538 0363
Fax: +1 954 514 2784
www.honeywell.com
Technical [email protected]
Asia Pacific Honeywell Analytics Asia Pacific #508, Kolon Science Valley (1)187-10 Guro-Dong, Guro-GuSeoul, 152-050Korea Tel: +82 (0)2 2025 0307 Fax: +82 (0)2 2025 [email protected]