COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 –...

18
jCOM Series by Copperhill Technologies Embedded Network Solutions SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN Contact Us: [email protected] For more information see http://copperhilltech.com JCOM.J1939 PROTOCOL &PROGRAMMING INTERFACE The jCOM.J1939 gateway series by Copperhill Technologies represent high- performance, low-latency vehicle network adapters. They allow any host device with a serial COM port (USB or UART) to monitor SAE J1939 data traffic and communicate with the SAE J1939 vehicle network. The gateways support the full SAE J1939 protocol according to J1939/81 Network Management (Address Claiming), J1939/21 Transport Protocol (TP), and J1939/16 (Automatic CAN baud rate detection). The jCOM.J1939 Gateway Protocol is designed to establish a data exchange between a jCOM.J1939 Series gateway and a host system (e.g. a PC or embedded system such as the Raspberry Pi) per means of serial communication (UART, USB). The protocol enables the host system to take advantage of the gateway’s capabilities by providing a set of commands from the host and responses from the gateway. JCOM.J1939 GATEWAY OPERATING MODES The jCOM.J1939 gateways supports two operating modes to cover all possible scenarios. The operating mode can be set by the host system per command through the serial port (USB or UART) as described in the next chapter. The modes are: 1. Listen-Only (Default): This mode supports a mere J1939 data-monitoring mode, which does not require the use of a NAME and source address, i.e. there is no address claim process. 2. Communication: This mode allows full communication, i.e. bidirectional data transfer, between the host system and the J1939 vehicle network. A jCOM.J1939 gateway works per default as a mere monitoring device in Listen-Only mode, however, the gateway will, also per default, not report any data unless the host system (e.g. a PC under Windows/Linux) sets the corresponding filters (ADDFILTER command).

Transcript of COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 –...

Page 1: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

jCOMSeriesbyCopperhillTechnologiesEmbeddedNetworkSolutions

SAEJ1939–NMEA2000–ISOBUS–MilCAN–CAN

ContactUs:[email protected]://copperhilltech.com

JCOM.J1939PROTOCOL&PROGRAMMINGINTERFACEThe jCOM.J1939 gateway series by Copperhill Technologies represent high-performance, low-latencyvehiclenetworkadapters.TheyallowanyhostdevicewithaserialCOMport(USBorUART)tomonitorSAEJ1939datatrafficandcommunicatewiththe SAE J1939 vehicle network. The gateways support the full SAE J1939 protocolaccording to J1939/81 NetworkManagement (Address Claiming), J1939/21 TransportProtocol(TP),andJ1939/16(AutomaticCANbaudratedetection).ThejCOM.J1939GatewayProtocolisdesignedtoestablishadataexchangebetweenajCOM.J1939Seriesgatewayandahostsystem(e.g.aPCorembeddedsystemsuchastheRaspberryPi)permeansofserialcommunication(UART,USB).Theprotocolenablesthehost system to take advantageof the gateway’s capabilities byproviding a set ofcommandsfromthehostandresponsesfromthegateway.

JCOM.J1939GATEWAYOPERATINGMODESThejCOM.J1939gatewayssupportstwooperatingmodestocoverallpossiblescenarios.Theoperatingmodecanbesetbythehostsystempercommandthroughtheserialport(USBorUART)asdescribedinthenextchapter.Themodesare:

1. Listen-Only(Default):ThismodesupportsamereJ1939data-monitoringmode,whichdoesnotrequiretheuseofaNAMEandsourceaddress, i.e. there isnoaddressclaimprocess.

2. Communication: This mode allows full communication, i.e. bidirectional datatransfer,betweenthehostsystemandtheJ1939vehiclenetwork.

A jCOM.J1939 gatewayworks per default as ameremonitoring device in Listen-Onlymode,however,thegatewaywill,alsoperdefault,notreportanydataunlessthehostsystem (e.g. a PC under Windows/Linux) sets the corresponding filters (ADDFILTERcommand).

Page 2: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

2

Afullcommunication,i.e.bidirectionaldatatransfer,betweenthehostsystemandtheJ1939vehiclenetworkisonlypossibleafterthehostsysteminitiatestheJ1939AddressClaimprocessbysendingthecorrespondingcommand(SETPARAM).All operatingmodes allow the reception of up to 1785 bytes permessage,while theCommunication operatingmodealso allows the transmissionof up to 1785bytes permessage(BAMorRTS/CTSSession).The Communication operating mode engages the full Address Claim procedure,requiringaNAME,apreferred sourceaddress (SA), andanoptionaladdress range (incasethepreferredSAisalreadytaken).The transmission of J1939messages in theCommunication operatingmode is always“real-time,” i.e. themessage is being transmitted as soon as possible (as soon as thegatewayproceedsduringthebusarbitrationprocess).

START-UPSEQUENCEThestart-upsequencesforeachmodeare:Listen-Only:

1. SendRESETcommand,whichalsoinitializestheCANbaudrate(250/500kbps).2. Setallfilters(ADDFILTERcommand).3. Operationstartswithsettingthefirstfilter.

Communication:

1. SendRESETcommand,whichalsoinitializestheCANbaudrate(250/500kbps).2. InitiateAddressClaimProcessandsetoperatingmodeusingtheSETPARAMor

SETPARAM1command.3. WhenusingtheSETPARAM1command,thegatewayrespondswithREPSTATUS

message.4. After successful address claim (check status per REPSTATUS message), data

transmissionisenabled.5. Setallfilters(ADDFILTERcommand).6. Receivingmessagesisenabledwithsettingthefirstfilter.

SERIALCOMMUNICATIONSPROTOCOLThischapterdescribesthemessageframingprotocolusedtodefinethestartandbodyofmessagessentbetweenhostdeviceandthejCOM.J1939gateway.

Page 3: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

3

MESSAGEFORMATThe jCOM.J1939 protocol defines two special tokens, START and ESC. START has thevalueof192decimalandESChasthevalueof219decimal.DataissenttoandfromthejCOM.J1939gatewayusingtheindustrystandardmethodofbytestuffing.BytestuffingistheprocessofinsertingadditionaltokenswhentheSTARTorESCtokensarepartofthedatafield.All messages start with a START token, and due to byte stuffing, a START token canneverappear inanyotherpartof themessage. If thevalueof192 iscontained inthemessagelength,datafield,orchecksum,anESCtokenisinsertedintothedatastreamfollowedbya220,thisindicatesavalueof192.IfanESCtokenappearsinthemessagelength,datafield,orchecksum,anESCtokenisinsertedintothestreamfollowedbya221,thisindicatesavalueof219.Allmessagesmustbebytestuffed, following theSTARTtoken,by the transmitterandunstuffedbythereceiver.Code Dec / Hex Description START 192 / 0xC0 Start of Message ESC 219 / 0xDB Stuffing Byte START_STUFF 220 / 0xDC Stuffing Byte ESC_STUFF 221 / 0xDD Stuffing Byte DATA_START ESC+START_STUFF Data = 219, 220 / 0xDB, 0xDC DATA_ESC ESC+ESC_STUFF Data = 219, 221 / 0xDB, 0xDD Tosendapacket,thetransmittingdevicestartsbysendingaSTARTcharacterfollowedbythesizeofthedatatofollow,alongwiththedataandthechecksumofthepacket.Themessagelengthisa2-bytefield(MSBfirst,followedbyLSB)equaltothesizeofthedatafieldpluschecksum,bothbeforebytestuffing.The checksum is a 2’s complement checksum over the length and data fields and iscalculatedbeforebytestuffinghasbeenadded.

Page 4: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

4

WHATISA2’SCOMPLEMENTCHECKSUM?Achecksumisatechniquetocheckdatafortransmissionerrorsortampering.Ifthelastfew bytes are the sum of all the preceding bytes, then any errors are likely to bedetected. Inthiscase,thechecksumisthesumofallbytesbetweenthedata lengthfield(MSB)andthe lastbyteoftheactualdatafield, ignoringanycarry,meaningthechecksumisalways8bitslong(0to255).Aone’scomplementisjustacomplement:~xAtwo’scomplementisacomplementandincrement,ignoringcarry:(~x)+1

MESSAGESThischapterdescribesthecommandssenttoandreceivedfromthegateway.Note: All message definitions are documented in their unstuffed representation. Allhighlightedsectionsrepresentthedatafield.Everymessageispartofthedatafield,anditstartswithamessageidentifier.Thisisaneight-bitvaluethattellsthereceiverwhattypeofmessagefollows.Thisisfollowedbyone or more additional data field(s), depending on the message. The messageidentifiers, data fields, responses, etc. are documented for each message in thefollowingchapters.TheavailablemessagesandtheirmessageIDsare:Message ID Meaning Source AcknowledgeACK 0 Acknowledgement Gateway -ADDFILTER 1 AddFilter Host ACKDELFILTER 2 DeleteFilter Host ACK

Page 5: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

5

TXDATA 3 TransmitData Host ACKRXDATA 4 ReceiveData Gateway -RESET 5 ResetjCOM.J1939.USB Host ACKHEART 6 Heartbeat Gateway -SETPARAM 7 SetProtocolParameters Host ACKREQINFO 8 RequestInformation Host REPSTATUSor RXDATAor VERSIONREPSTATUS 9 ReportProtocolStatus Gateway -FLASH 10 Startsflashprogrammer Host ACKSETACK 11 SetAcknowledgement Host ACKSETHEART 12 SetHeartbeatFrequency Host ACKVERSION 13 ReportHW/SWVersion Gateway -SETPARAM1 14 SetProtocolParameters Host ACK WithREPSTATUSresponseSETMSGMODE 15 SetMessageMode Host ACKTXDATAL 16 TransmitDataLoopback Host ACKTXDATAP 17 PeriodicDataTransmission Host ACKTXDATAPL 18 TXDATAPwithLoopback Host ACKNote:ThislistofmessagesissortedbymessageID.Theoriginalprotocolincludedonlythefirst10messagesandfurthermessageswereaddedovertime.Inordertomaintaina strict backwards compatibility, the function of a message, once established, willremain unchanged. Any additional or modified functionality is accomplished throughnew messages (as an example, see the original TXDATA and the added TXDATALmessages).

ADDITIONALDUOMESSAGEIDSThefollowingmessageIDswereaddedtosupportourdual-portJ1939gateways.TheyareidenticalinfunctionalitytotheoriginalmessagesbuttheirIDwasincreasedby128(0x80)toindicateaccesstothesecondJ1939port.Message ID Meaning Source AcknowledgeADDFILTER2 129 AddFilter Host ACKDELFILTER2 130 DeleteFilter Host ACKTXDATAX2 131 TransmitData Host ACKRXDATA2 132 ReceiveData Gateway -SETPARAM2 135 SetProtocolParameters Host ACKREQINFO2 136 RequestInformation Host REPSTATUSor RXDATAor VERSIONREPSTATUS2 137 ReportProtocolStatus Gateway -SETPARAM12 142 SetProtocolParameters Host ACK

Page 6: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

6

WithREPSTATUSresponseSETMSGMODE2 143 SetMessageMode Host ACKTXDATAL2 144 TransmitDataLoopback Host ACKTXDATAP2 145 PeriodicDataTransmission Host ACKTXDATAPL2 146 TXDATAPwithLoopback Host ACKNote:Thesemessagesareonlyimplementedinourdual-portgateways.Thesingle-portgatewayswillnotrespondtothem.

ACK–Acknowledgment

ThismessageissentbythejCOM.J1939toacknowledgethecorrectreceiptofamessagefromthehostsystem.ACKwillnotbetransmittedincaseswherethechecksumiswrongorbyte-stuffingerrorsweredetected.Note:

• TheACKmessagecanbesuppressedthroughtheSETACKmessage.MessageIdentifier: 0TotalLength: 6bytesResponse: -Index Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 33 MSG_ID_ACK 04 MessageIdofacknowledgedmessage xx5 Checksum xx

ADDFILTER–AddFilterPGN

ThismessageaddsaPGNtotheacceptancefilter.ThejCOM.J1939gatewayallowsupto100messagefilters; intheDUOversion50messagefiltersaresupportedperport.SetthePGNto0x100000toallowalldatawithoutfiltering;disablethefeaturebydeletingthefilter(DELFILTERcommand)usingthesamePGN.Note:

• ThejCOM.J1939gatewaywill,perdefault,notpassonanydatamessagesunlesstheirassociatedPGNisset(ADDFILTERcommand).

Page 7: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

7

• SettingfiltersreferringtoPGNsusedforAddressClaimorNetworkManagementwillbeignored,i.e.thegatewayreportsonlydataandrequestPGNs.

• ToenableSAEJ1939requestmessages(PGN=0xEAxx),itissufficienttousethebase PGN 0xEA00 (59904) or any PGN in the range from 0xEA00 to 0xEAFF,whichwillenabletheentirerange.

MessageIdentifier: 1TotalLength: 8bytesResponse: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 53 MSG_ID_FA 14 PGNMSB xx5 PGN2ND xx6 PGNLSB xx7 CHKSUM xx

DELFILTER–DeleteFilterPGN

Thismessage deletes a PGN from the acceptance filter. Set the PGN to 0x100000 todisallowthereceptionofalldata.Note:

• The gateway will, per default, not pass on any data messages unless theirassociatedPGNisset(ADDFILTERcommand).

MessageIdentifier: 2TotalLength: 8bytesResponse: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 53 MSG_ID_FA 24 PGNMSB xx5 PGN2ND xx6 PGNLSB xx7 CHKSUM xx

Page 8: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

8

TXDATA–TransmitData

ThismessageschedulesaJ1939messagefortransmission.ThemessagewillbesentassoonastheJ1939networkallows.Note:

• ThegatewaywillnottransmitanydataduringtheAddressClaimprocess(appliesonly to the Communication operating mode), which can last up to severalhundredsofmilliseconds.

• AJ1939messagecanbebetween0and1785byteslong.Ifamessageislongerthan 8 bytes, the jCOM.J1939 gateway will, depending on the destinationaddress, manage the transmission per broadcast (BAM) or peer-to-peer(RTS/CTS)session.

• The jCOM.J1939 gateway will allow you the use of a random source address,provided that the address claim process was finished successfully. It is highlyrecommended using the negotiated source address (obtained through theREPSTATUS message). Nevertheless, this feature is provided for maximumflexibility.

MessageIdentifier: 3TotalLength: Variable(19with8databytes)Response: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB xx2 LengthLSB xx3 MSG_ID_TX 34 PGNMSB xx5 PGN2ND xx6 PGNLSB xx7 DestinationAddress xx8 SourceAddress xx9 Priority 0…710 DataFieldStart xx::nn CHKSUM xx

TXDATAL–TransmitDataWithLoopback

This message is designed (and handles data transmission exactly) like the regularTXDATAmessage.However,whenthegatewayreceivestheTXDATALmessage,thedata

Page 9: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

9

will be reflected back to the host system (which is amandatory feature for gatewayapplications).MessageIdentifier: 16TotalLength: Variable(19with8databytes)Response: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB xx2 LengthLSB xx3 MSG_ID_TX 164 PGNMSB xx5 PGN2ND xx6 PGNLSB xx7 DestinationAddress xx8 SourceAddress xx9 Priority 0…710 DataFieldStart xx::nn CHKSUM xx

TXDATAP,TXDATAPL–TransmitDataPeriodically

These twomessagesaredesignedandhandledata transmissionsimilar to the regularTXDATA message. They are, however, extended by a message frequency (inmilliseconds). When the gateway receives the TXDATAPL message, the data will bereflected back to the host system (which is a mandatory feature for gatewayapplications).Note:

• Themessage frequency (inunitsofmilliseconds) is submittedusing twobytes,thusallowingamaximumtimeof65.536seconds.

• Theminimummessagefrequencyislimitedto10milliseconds.• Amessagefrequency=0willdisable(delete)themessage.• Thegatewayallowsup to50periodicmessages. TheDUOversion supports25

periodicmessagesperport.Important!

In accordancewith the SAE j1939 protocol, the periodic transmission of PGNsapplies only to regular 8-byte data frames, i.e. any messages requiring the

Page 10: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

10

Transportprotocol(upto1785bytes)willbe ignoredandthemessagewillnotbeacknowledged.

MessageIdentifier: 17/18TotalLength: Variable(21with8databytes)Response: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB xx2 LengthLSB xx3 MSG_ID_TXP 17/184 PGNMSB xx5 PGN2ND xx6 PGNLSB xx7 DestinationAddress xx8 SourceAddress xx9 Priority 0…710 Frequency(MSB) xx11 Frequency(LSB) xx12 DataFieldStart xx::nn CHKSUM xx

RXDATA–ReceiveData

This message is transmitted to the host device as soon as the jCOM.J1939 gatewayreceivesaJ1939message.Themessagecanbebetween0and1785byteslong.Note:

• Thegatewaywillnotforwardanydataaslongasthefiltersarenotset.• The gatewaywill also not forward any data during the Address Claim process

(appliesonlytotheCommunicationoperatingmode).MessageIdentifier: 4TotalLength: Variable(19with8databytes)Response: -Index Code Value0 MSG_TOKEN_START 1921 LengthMSB xx2 LengthLSB xx

Page 11: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

11

3 MSG_ID_RX 44 PGNMSB xx5 PGN2ND xx6 PGNLSB xx7 DestinationAddress xx8 SourceAddress xx9 Priority 0…710 DataFieldStart xx::nn CHKSUM xx

RESET–GatewayReset

This message requests a gateway reset, causing a re-initialization of all SAE J1939protocolparameters,whichincludessettingtheoperatingmodetoListen-Only.The purpose of the RESET command is for synchronizing the gateway with the hostsystem. The gateway’s settings will not be affected by a host system power-down,meaning all filter settings plus negotiated addresswill remain active. To prevent anysynchronization issues, it is therefore recommended to issue the RESET command assoonasthehostsystempowersdownorstartsup.CAN Baud Rate Switching – The RESET command also allows initializing the gatewaywithaCANbaudrateof250kbpsor500kbps.Todoso,modifythe“ResetKey3”valueasshowninthemessageformatdescriptionbelow.Note:

• The gateway-reset command does not affect the heartbeat frequency or ACKmessagesettings.

MessageIdentifier: 5TotalLength: 8bytesResponse: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 53 MSG_ID_RESET 54 ResetKey1 0xA55 ResetKey2 0x696 ResetKey3 0x5Afor250kbps

Page 12: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

12

0x5Bfor500kbps7 CHKSUM xx

HEART-Heartbeat

Thismessageisperdefaultbeingtransmittedwithaonesecondfrequency; it isbeingusedasaso-called“watchdog”functiontomonitortheserialconnectionfunctionality.Themessage contains the hardware and software versions in a form of A.BB.CC (forinstance,1.02.03):

• A -MajorUpdate• BB -MinorUpdate• CC -BugFix

Following the hardware and software versions are two error counters that allow aninsightintothequalityoftheserialconnection:

• ChecksumError• ByteStuffingError

Pleasebeaware that the rangeof thesecounters is from0 to255,where,atacountgreaterthan255,thecounterwillstartatzeroagain.However,actionshouldbetakenassoonasacertain(project-specific)counthasbeenreached.The heartbeat message frequency can be adjusted through the SETHEART message,whichalsoallowssuppressingtheheartbeat.MessageIdentifier: 6TotalLength: 13bytesResponse: -Index Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 103 MSG_ID_HEART 64 HW_VERSIONMAJOR xx5 HW_VERSIONMINOR xx6 HW_VERSIONBUGFIX xx7 SW_VERSIONMAJOR xx8 SW_VERSIONMINOR xx9 SW_VERSIONBUGFIX xx

Page 13: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

13

10 ERRCNT_CHECKSUM xx11 ERRCNT_STUFFING xx12 CHKSUM xx

SETPARAM,SETPARAM1–SetProtocolParameters

ThismessagesetstheNAMEofthecontrolapplication(CA)accordingtoSAEJ1939/81(Address Claim Process), sets a preferred source address and address range for theaddressclaimprocessandstartstheAddressClaimprocess.WithusingtheSETPARAM1command,assoonastheaddressclaimprocessisfinished(successfulornot),thegatewaywillsendaREPSTATUSmessage,reportingtheaddressclaimstatusandthenegotiatedaddress.Theparametersinthismessageare:

• NAMEaccordingtoSAEStandard• SourceAddress(PreferredAddress)• AddressRangeBottom(optional;ifnotusedsetasNULLaddress=254)• AddressRangeTop(optional;ifnotusedsetasNULLaddress=254)• OperatingMode

o 0–Listen-Onlyo 1-Communication

Note:

• The Address Claim process is initiated by overwriting the Listen-Only mode(gatewaydefault)toCommunicationmode.

SettingtheaddressrangeornotwillimpacttheAddressClaimprocess:1. Full SAE J1939/81 compliant address claim with source address and alternativeaddressrange:Theusercansetapreferredsourceaddress,but,incasetheaddressisalreadyusedinthe vehicle network, an alternative address range is available for the address claimprocess.2.FullSAEJ1939/81compliantaddressclaimwithonlyonesourceaddress:Setting both address range parameters to 254 but submitting a source address (i.e.settingthecontrolapplicationasnon-arbitrary-address-capable)willresettheArbitraryAddressCapableflagintheNAME.Note:

Page 14: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

14

• SETPARAM, SETPARAM1will be rejected (i.e. no ACKwill be sent) in case theoperatingmodeissetotherthanthedefinedvalues.

• The SETPARAM1 command (ID = 14) function is identical to the originalSETPARAMcommand,butinadditionitinitiatestheREPSTATUSmessage,whichisbeingtransmittedassoonastheAddressClaimprocessisfinished.Thisallowsthehost’sprogramtowaitfortheREPSTATUSmessagetoobtainthenegotiatedsourceaddress.

MessageIdentifier: 7/14TotalLength: 17bytesResponse: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 143 MSG_ID_SET 7/144 NAMELSB xx5 NAME xx6 NAME xx7 NAME xx8 NAME xx9 NAME xx10 NAME xx11 NAME MSB xx12 SourceAddress (SA) xx13 SARangeBottom xx14 SARangeTop xx15 OperatingMode xx16 CHKSUM xx

REQINFO–RequestInformationfromJ1939Gateway

This message, sent from the host system to the jCOM.J1939gateway, requests thetransmission of the report message REPSTATUS or the version message VERSIONaccordingtotheRequestID.RequestID: REPSTATUS(ID=9) VERSION(ID=13)Note:

• ThegatewaywillreturnnomessagewhentheRequestIDisnottheREPSTATUS-ID.

Page 15: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

15

• FurtherrequestIDsmaybeaddedinfuturefirmwareversions.MessageIdentifier: 8TotalLength: 6bytesResponse: DependingonRequestIDIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 33 MSG_ID_RQ 84 REQUEST_ID xx5 CHKSUM xx

REPSTATUS-ReportJ1939ProtocolStatusandSourceAddress

This message reports the address claim status and the negotiated source address.REPSTATUSisusuallyaresponsetotheREQINFOmessage,butisalsotransmittedwhenthesource(node)addresschangedduetoanaddresschallengeduringoperation.ThereportedSTATUSwillbe:

01–AddressClaiminProgress02–AddressClaimSuccessful–NormalDataTraffic03–AddressClaimFailed04–Listen-OnlyMode

The reported SA will be NULLADDRESS (254) when the address claim process is inprogress, the address claim failed, or the operating mode is Listen-Only. In case thesourceaddressis254,checktheJ1939ProtocolStatus.MessageIdentifier: 9TotalLength: 7bytesResponse: -Index Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 43 MSG_ID_RS 94 Status xx5 SourceAddress xx6 CHKSUM xx

Page 16: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

16

FLASH–StartstheIn-CircuitProgrammer

Thismessagestartstheinternalin-circuitprogrammer.Thisisusuallyinvokedbypullingapinlowduringpower-up,butwiththisfunctionitcanbestartedbythehostsystematanytime.Aflashprogrammingtool(FlashMagic)canbeusedaftercallingthisfunction.After sending theFLASHcommand,all LEDson the jCOM.J1939willbeon. Inorder toswitchbacktonormaloperation,youneedtogothroughapower-off-oncycle.MessageIdentifier: 10TotalLength: 5bytesResponse: -Index Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 23 MSG_ID_FLASH 104 CHKSUM xx

SETACK–SetAcknowledgment

Thismessageallowstheactivation/deactivationoftheacknowledgmentmessageACK.Note:

• The ACK message will be active per default, unless overwritten by the hostsystem.

MessageIdentifier: 11TotalLength: 6bytesResponse: ACK(onlywhenactivated)Index Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 33 MSG_ID_SETACK 114 ACTIVE xx(0-inactive,1-active)5 CHKSUM xx

Page 17: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

17

SETHEART–SetHeartbeatFrequency

Thismessageallowsthesettingoftheheartbeatfrequencyinunitsofmilliseconds.Themessage frequency is assigned by two bytes, allowing a range of 100 – 5000milliseconds, i.e. a time of less than 100millisecondswill be corrected to 100, and atimeofmorethan5000willbecorrectedto5000.Note:

• Passingaheartbeatfrequencyof0willsuppressthemessage,anditwillnotberesettotheminimumtimeof100milliseconds.

MessageIdentifier: 12TotalLength: 7bytesResponse: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 43 MSG_ID_SETHEART 124 FREQMSB xx5 FREQLSB xx6 CHKSUM xx

VERSION–ReportHardware&SoftwareVersion

ThismessageisaresponsetotheREQINFOmessageinwhichtheVERSIONIDwasused.TheactualdataisidenticaltotheHEARTBEATmessage.Forthatreason,requestingtheVERSIONmessageshouldonlybeusedaftertheHEARTBEATmessagewassuppressed.MessageIdentifier: 13TotalLength: 11bytesResponse: -Index Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 083 MSG_ID_VERSION 134 HW_VERSIONMAJOR xx5 HW_VERSIONMINOR xx6 HW_VERSIONBUGFIX xx7 SW_VERSIONMAJOR xx

Page 18: COM.J1939 PROTOCOL PROGRAMMING Icopperhilltech.com/content/jCOM1939-Protocol.pdf · SAE J1939 – NMEA 2000 – ISOBUS – MilCAN – CAN ... J1939 vehicle network is only possible

18

8 SW_VERSIONMINOR xx9 SW_VERSIONBUGFIX xx10 CHKSUM xx

SETMSGMODE–SetMessageMode

The message mode defines the type of data (PGNs) that is being passed from thegatewaytothehostsystem.Thiscommand isonlynecessary forgatewayapplicationswheretheuserneedstoseeallPGNsincludingthoseforprotocolcontrol.Thesettingsare:

• 00–ECUMessageMode(defaultafterRESET)–ThegatewayreportsonlyPGNsaddressedtotheECU’ssourceaddressortheglobaladdress.

• 01 – GatewayMessageMode 1 – The gateway reports PGNs addressed to alldestinationaddressesincludingtheglobaladdress(255).

• 02–GatewayMessageMode2–ThegatewayreportsallPGNsasdescribedinmode 1 but also includes protocol PGNs according to SAE J1939/21 and SAEJ1939/81.

MessageIdentifier: 15TotalLength: 6bytesResponse: ACKIndex Code Value0 MSG_TOKEN_START 1921 LengthMSB 02 LengthLSB 033 MSG_ID_MSGMODE 154 MSGMODE xx5 CHKSUM xx