Author Topic: Transmit and receive custom j1939 PGNs SPNs  (Read 10485 times)

Offline SJ Industries

  • PLUS+1 Expert
  • ****
  • Posts: 60
  • Karma: +2/-0
Transmit and receive custom j1939 PGNs SPNs
« on: August 31, 2021, 09:11:20 AM »
I am having issues with sending and receiving J1939 messages, I have created custom PGNs and SPNs, I can see them from the SC24 on CANking or the CAN reader via the service tool, they appear to be correct and the data bytes are in the right sequence etc, I have also done the same in a display screen (not a Danfoss) and can also see the messages in CAN reader.

The issue is neither the screen nor the controller seem to be reading the applicable messages?

PGN - EF01 (61185) being sent from the controller

PGN - EF00 (61184) being sent from the display.

I am pretty sure these should come under the PDU1 message format being a PF of 239?

My source address is set at 32 for the controller and the display is using 242 which are present in the
CAN messages displayed on the reader.

Any hints on building custom j1939 PGNs? I am at the end of my beginner level knowledge abilities!

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: Transmit and receive custom j1939 PGNs SPNs
« Reply #1 on: August 31, 2021, 05:20:05 PM »
Since you're checking on these with a reader can you post the complete CAN ID of the two messages?

For the display make sure that the display's ECU is set up with address '1' if you're using EF01.  Is it a CoDeSys display?  If so make sure the 'Preferred Address' is set to '1' in the receiving J1939_ECU.

For your PLUS1 controller I'd recommend just putting the complete CAN ID that you're seeing from the display as your CAN ID into the receiver function.
Controls Engineer
Hydra-Power Systems

Offline SJ Industries

  • PLUS+1 Expert
  • ****
  • Posts: 60
  • Karma: +2/-0
Re: Transmit and receive custom j1939 PGNs SPNs
« Reply #2 on: August 31, 2021, 09:50:09 PM »
Hi Tom, I have attached screen snips of the blocks set up in Guide. I am using an Enovation (Powervision) screen.

Because I am using custom PGNs I think I am doing something wrong with the PGN address?

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: Transmit and receive custom j1939 PGNs SPNs
« Reply #3 on: September 01, 2021, 02:22:55 AM »
If 08EF0120 is the message coming from your display then you'll want to make a change to your CAN Rx block in GUIDE.  For CAN ID 08EF0120 the source address is 0x20 (32), and the destination address is 1.  It looks like you've got source address as 242 and destination as 32 in the CAN Rx block, so I think you need to change that.  This particular message is  Proprietary A message which behaves a little differently in that the PDU Specific portion of the PGN is treated as a destination address.  Other PGNs outside of the EFxx range are broadcast type and don't need to be received by a specific destination address.  You might read up on it a little.

If your display really is configured to have the CAN address as 0x20 (32) then you'll want to change the PGN of your CAN Tx block to be 0xEF20, and change the source to something else I guess.

If the above doesn't get you up and running then I'll recommend what I did when I was learning CAN.  Use a CAN monitor program like CAN King that lets you manually send CAN messages over the bus, and just mess around with that.  See if you can find the correct CAN ID for the display or controller to read it.

As a side note I don't recommend using the Proprietary A message.  I'd go with Proprietary B message range because then you can send more than one message.  It's been some years since I really used PowerVision, so I can't offer any more advice there.
Controls Engineer
Hydra-Power Systems

Offline SJ Industries

  • PLUS+1 Expert
  • ****
  • Posts: 60
  • Karma: +2/-0
Re: Transmit and receive custom j1939 PGNs SPNs
« Reply #4 on: September 03, 2021, 09:28:41 AM »
Hi Tom thanks for your help.
I had the source addresses correct earlier. 32 is the node for service tool for main layer, 33 for the safety layer. I made new source addresses for both the screen and the control. But it was your reference to proprietary A and B that solved it. I knew I was using a proprietary message and couldn't work out the changes required. but up until you called them A and B, I googled them and realised I should have been using FFxx instead of EFxx.

J1939 info is a joke. Then every supplier and manufacturer calling certain aspects by slightly different names is a nightmare  to try and navigate for a beginner. 

I have it talking now. And some of it even works.

Thanks again