Author Topic: J1939 Generic PGN  (Read 12503 times)

Cranes

  • Guest
J1939 Generic PGN
« on: January 23, 2013, 01:24:26 AM »
I have a J1939 CAN device I need to read length, angle, force and switch status. The vendor is saying I need to create a generic PGN. I see that starting with PGN65280 in the 1939 standard references "Manufacturer Defined Usage". There is not a block for this in the function library. How would I create this? I'm not connecting to an Engine. Could I use an existing Engine PGN block that has the DATA format I need?

Thanks,
Jeff

Offline Neil

  • PLUS+1 Expert
  • ****
  • Posts: 96
  • Karma: +2/-0
Re: J1939 Generic PGN
« Reply #1 on: January 23, 2013, 06:51:19 PM »
Hi Jeff.

I would map the device from the output window in CANking, build my CAN recieve buffer from the information thats transmitted.
Then build into the CAN recieve buffer any scaling that converts the bit/byte value into the length, angle etc you are intersted in.

regards Neil.

Cranes

  • Guest
Re: J1939 Generic PGN
« Reply #2 on: January 29, 2013, 01:17:25 AM »
Neil,
CAN King identified the ID clearly (FF0354). I'm now able to read the data. My problem is the sensor only issues new data when there is a change. I get the correct data but then filled with zeros when logging (see attached). CAN King never shows zero for that ID. Do I have my Rx specified correctly?

Thanks,
Jeff

Offline hproffitt

  • PLUS+1 Developer
  • ***
  • Posts: 28
  • Karma: +0/-0
Re: J1939 Generic PGN
« Reply #3 on: January 29, 2013, 02:51:00 PM »
On the last page of your attachment, you show your program forcing the value to "0" if a message is not received in 120 milliseconds.  Since your sensor only outputs on a change, your program is forcing it to "0" when it doesn't change.  I would suggest either expanding the time on the off delay feeding the switches, or getting rid of it all together if it will not cause an unsafe situation.

Offline Neil

  • PLUS+1 Expert
  • ****
  • Posts: 96
  • Karma: +2/-0
Re: J1939 Generic PGN
« Reply #4 on: January 29, 2013, 07:41:01 PM »
Hi Jeff

Another method would be to capture the last value to memory, see the attached.

Regards Neil.