LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN - One PGN - Two Source Addresses

Hi Folks

 

I have a setup with two motors/inverters communicating on one canbus.  Things like motor temp and torque share the same PGN, but are supposed to be parsed by the source address.

 

Currently my attempts to display and record these parameters are resulting in the messages getting mixed up.  For example, motor 1 and motor 2 temps are reading the same value and appear to be toggling back and forth between their respective temps.

 

Any suggestions or help on how to parse out these two messages on the same PGN would be much appreciated.

0 Kudos
Message 1 of 16
(572 Views)

If you are using NI-XNET, you can set J1939.AddFltr property.

XNET J1939 Support: Devices with the same PGN but Different Source Address

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 16
(530 Views)

Thanks for the reply!

 

In terms of using this XNET Session Property Node, do I just need to copy exactly as shown in the link for a two source address setup?

 

Or, do I need to replace "SourceAddress1Sig1" with an actual source address?

 

If it's the latter, does it need to be the Arbitration ID or the Hex equivalent?

0 Kudos
Message 3 of 16
(498 Views)

You need to wire an actual signal from your DBC to the Frame.Active node and its Arbitration ID to the Frame.J1939.AddressFilter node. You need to do the same for all the signals that need filtering.

-------------------------------------------------------
Control Lead | Intelline Inc
Message 4 of 16
(489 Views)

Thanks for the reply ZYOng!

 

So, I've given this a try, but it is not working.  I have a 2 canbus setup...one is an ECU CAN and the other is electronic implement CAN.

 

The electronic implement is the one that has left and right side sharing same PGN with different source addresses.

 

For some reason when I insert the XNET Node, my engine speed on my ECU CAN no longer reads.  Other than my messy block diagram, can you see any errors I'm making in the picture below with how I'm using the node?

 

Alias9999_0-1710279145742.jpeg

 

0 Kudos
Message 5 of 16
(452 Views)

Those property nodes can only be used before XNET Start VI. If you try to set those properties in a loop, it might return an error, causing the remaining VI to stop working.

-------------------------------------------------------
Control Lead | Intelline Inc
Message 6 of 16
(445 Views)

OK, I can move the XNET property node to outside of my case structure pretty easily.

 

However, I'm not using XNET Start...instead I've just been using XNET Create and XNET Read.

 

Can you explain the difference between Start and Read...in the context help the Read VI has data line out.

 

If I move the node outside my case structure and put an XNET Start before my XNET Read, should that work?

0 Kudos
Message 7 of 16
(426 Views)

If you call XNET Read VI after XNET Create VI without calling XNET Start VI, the driver will call XNET Start VI automatically.

Using XNET Start VI will give you better control.

What matters in your case is that you should put the property node after XNET Create VI in the initialization subVI.

-------------------------------------------------------
Control Lead | Intelline Inc
Message 8 of 16
(405 Views)

Thanks for your continued suggestions.

 

I moved the property node to be after my XNET Create as you suggested...and no longer within a case structure.

 

My other CAN channels from the ECU canbus now read properly.

 

However, the property node is not yielding a successful parse of my CAN channels sharing the same PGN but from different source addresses.

 

I've tried using both the arbitration id as well as the hex equivalent, and neither yield a change.

 

Is there anything else you can think of which I could check/change?

0 Kudos
Message 9 of 16
(304 Views)

Are you setting the Frame or Signal name for the Frm.Active property node?

-------------------------------------------------------
Control Lead | Intelline Inc
Message 10 of 16
(295 Views)