Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

J1939 Decode

2016-04-12
2016-04-16
  • johnfarrugia - 2016-04-12

    I'm working on decoding a few Canbus messages. I know what they do but I don't know what they mean.
    I have a few IO modules and the controller will send a message of:

    0x054c00ff 01 a1 20 00 00 00 00 84 -This message will turn on output#1
    0x054c00ff 01 a1 10 06 01 32 00 84 -This message will turn on output#1 with PWM of 50%
    0x054c00ff a0 a1 60 01 00 80 00 02 -This message will request status and the module will reply with 0x054c0001 a1 a0 00 46 02 00 00 00

    Can someone shed some light on what these numbers represent?

     
  • johnfarrugia - 2016-04-12

    I found some new information:
    If I try to decode the first message I get the following:

    message priority = 1
    EDP=0
    Data Page=1
    PDU=76 since PDU is less than 240 the next 16 bits are for source and destination
    Destination = 0
    Source = 255
    PGN=19456

    Am I on the right track? If so, why is the destination 0? How can I determine what PDU 76 means?
    Are there PGN messages that I can use to create my own custom hardware?

     
  • TimvH

    TimvH - 2016-04-16

    With J1939 a 29 bit identifier is used.
    This contains e.g. the Priority, PGN, and Source Address (SA).

    To filter these from the Identifier you could use something like:
    SA := _29bitId AND 16#FF;
    PGN := SHR(_29bitId,8) AND 16#FFFF;
    PRIO := SHR(_29bitId,24);

    If you run this with your 29bit identifier (16#054c00ff), you will get as result for the PGN 19456.

    The other 8 bytes represent the data (SPN) which relates to the PGN.

    I'm not a J1939 expert, so please correct me if I'm wrong.
    Anyway I hope this helps.

     

Log in to post a comment.