Node addressing

Professional Windows® software to communicate with CAN and CAN FD busses and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
scope
Posts: 18
Joined: Wed 24. Jan 2024, 15:42

Node addressing

Post by scope » Fri 17. May 2024, 12:42

I have the following set-up :
2 nodes 1 and 2 connected to my PCAN_USB FD to my PC where i have the PCAN_EXPOLORER 6

Node addressing is done on the least significant byte of the MessageId. For example for the message MSG_test (0x4800000):

if the HMI receives the message 0x4800001, this means that it is sent by node 1 with address 0x01
if the HMI receives the message 0x4800002, this means that it is sent by node 2 with address 0x02
If the HMI sends the message 0x4800002, node 2 should consider it and node 1 ignore it

I want my instrument panel to display the msgs sent by both nodes how can i do that with the PCAN-EXPLOER please?
the insturment panel will have 2 ereas one for the first node and the second is for the second node
THANKS

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Node addressing

Post by M.Heidemann » Fri 17. May 2024, 15:01

Hello,

Create a symbol-file, add a symbol of type extended for each, make sure to add the corresponding signals you need (Use a name that reflect if node1 or 2).

Then Add two Value-Indicators and assign the signals under Data->Signal.

Add a label to indicate which nodes it belongs to and
you should have two labeled value indicator for each ID.

Best Regards

Marv
---
Marvin Heidemann
PEAK-Support Team

scope
Posts: 18
Joined: Wed 24. Jan 2024, 15:42

Re: Node addressing

Post by scope » Fri 17. May 2024, 16:53

Hello Marv,

Thank you for your prompt response. However, I believe there might be a misunderstanding regarding my setup and requirements.

To clarify, both of my nodes (Node 1 and Node 2) are sending the same CAN message type with different Message IDs (0x4800001 for Node 1 and 0x4800002 for Node 2), and these messages contain the same signal values.

My goal is to display the signal values from both nodes on my instrument panel in PCAN-Explorer 6, with one area dedicated to Node 1 and another area dedicated to Node 2.

The issue I am facing is that in PCAN-Explorer 6, I can only assign a signal to a value indicator, but since the signals from both nodes are the same and only differ by their CAN ID, I am unsure how to differentiate and display them separately on the instrument panel.

Could you please provide guidance on how to set up my panel to display the signals from both nodes, taking into account their respective CAN IDs?

Thank you for your assistance.

Best regards,

Scope

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Node addressing

Post by M.Heidemann » Tue 21. May 2024, 09:02

Hi Scope,

Thanks for the clarification!

Okay, you have two options:

Option1:

When selecting the signal, select the display mode "Qualified Short Names" in the Display Dropdown (Upper right corner in the Select Signal window), this way you'll be shown the signal name like this:
SymbolFile.Symbol.Signal

This would ensure you can use the right signal on your Instruments-Panel.

Option2:

You could use a naming scheme in your symbol, that reflects the origin of each signal. However you would need to create a new signal for each and every symbol it is used in. Depending on the size of the symbol used this is not practical, instead see option 1.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

scope
Posts: 18
Joined: Wed 24. Jan 2024, 15:42

Re: Node addressing

Post by scope » Wed 22. May 2024, 10:02

Thanks Marvin,
that was helpful I appreciate the support,
one last question please : How can I change and control the Cycle time of a msg via the Instrument panel ?
I know I need to have a VBScript Sub function but I don't know how to implement it.
Best Regards !
scope

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Node addressing

Post by M.Heidemann » Wed 22. May 2024, 14:29

Hi,

If you only need to do this for a couple of messsages, this approach might be suitable:

The rotary control would be the cycle time, a virtual signal.

Each slider is assigned one signal, each on byte of the message
cycle.png
cycle.png (28.46 KiB) Viewed 2882 times

Code: Select all

'------------------------------------------------------------------------------
'FILE DESCRIPTION: A description was not provided.
'------------------------------------------------------------------------------
Option Explicit

Sub ChangeCycle()

Dim CycleTime, Byte0, Byte1, Byte2, Byte3 

set CycleTime = Signals("CyclicTime")

set Byte0 = Signals("Byte1")
set Byte1 = Signals("Byte2")
set Byte2 = Signals("Byte3")
set Byte3 = Signals("Byte4")

TransmitMessages.clear

   Dim msg

   Set msg = TransmitMessages.Add

   ' Initialize the CAN message

   With msg
      If Connections.Count > 0 Then _
       Set .Connection = Connections(1)
      .ID = &H100
      .DataLength = 4
      .Data(0) = Byte0.Value
      .Data(1) = Byte1.Value
      .Data(2) = Byte2.Value
      .Data(3) = Byte3.Value
	
	msg.CycleTime = CycleTime.Value

   End With
You basically copy the Values from your Signals and create a new transmit message,
you could use a button to run the macro everytime you have made your changes.

However! PCAN-Explorer 6s Object model isn't really ideal to change the cycle time on the fly.
If this gets more complex a PCANBasic based application might be a good idea.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

Post Reply