CAN Bus ArbitrationId

2 nodes CAN bus…
I was able to properly configure the masks ID and the reception work properly with 3 bytes ID ( masked or not ).
But now I have a problem in sended messages.
Transmitting a message with a 3 bytes Arbitration Id this is sent with only lower byte as Arbitration Id .

Msg arbitration Id= 0x4D4330 … msg ID contains only the 0x30 byte

Data bytes len and values are correct.
So I tried RX with a CAN datalogger and the ID of the message is really a single byte, the least significant.
What’d I miss?

You 'll have to set the IsExtendedId property to true.

actually I’ve set but thanks to your advice I double-checked the source and in fact it is probably the wrong order.

Existing source:

        Dim msg As New ControllerAreaNetwork.Message()
        msg.ArbitrationId = &H4D4330
        msg.IsExtendedId = True
        msg.Length = 8
        msg.Data = New Byte() {&H01, &H02, &H03, &H04, &H05, &H06, &H07, &H08}

it should be (better)

        Dim msg As New ControllerAreaNetwork.Message()
        msg.IsExtendedId = True
        msg.ArbitrationId = &H4D4330
        msg.Length = 8
        msg.Data = New Byte() {&H01, &H02, &H03, &H04, &H05, &H06, &H07, &H08}

I had already seen that you have to explicitly indicate the bytes number to be sent.
for the moment I can not try

I was wondering what is your “&” before the arbid and discover what it stands for under VB. But in the same time I discover the other suffix such as UI. (and arbid is an unsigned int) My feeling is that you should write 0x4D4330.

Hope it will help…

@ coccoliso -

The order is not important.

If you set extend id already then please check if you are using latest version if your device is Cerberus or G80.

Hi Dat,

  • Visual Studio Enterprise 2015 14.0.24720.00 update 1
  • G80TH.

 HalSystemInfo.halVersion :
 HalSystemInfo.halVendorInfo :Copyright GHI Electronics, LLC
 ClrInfo.clrVersion :
 ClrInfo.clrVendorInfo :Copyright GHI Electronics, LLC
 ClrInfo.targetFrameworkVersion :
 SolutionReleaseInfo.solutionVendorInfo: Copyright (C) GHI Electronics, LLC
 SoftwareVersion.BuildDate: Jul 30 2015
 SoftwareVersion.CompilerVersion: 410713

  • GHI Electronics NETMF SDK 2015 R1
  • Microsoft .NET Micro Framework 4.3 (QFE2)

I also tried creating single line

Dim Data = New Byte() {&H01, &H02, &H03, &H04, &H05, &H06, &H07, &H08}
CanInterface.SendMessage(New ControllerAreaNetwork.Message(CUInt(&H4D4330), Data, 0, 8, False, True))

but the result does not change, only the last byte of ID is sent.

@ coccoliso -

And the most important is, what version firmware are you using, please?
Can you confirm that this version has the problem?
With the SDK 2016 R1 prerelease seems have a debug problem with VS2015… you confirm it?
I have to move back to VS2013 and latest SDK?

@ coccoliso -

Can you confirm that this version has the problem?[/quote]

Confirm that version had problem with extendID CAN. You have to update to latest SDK to fix it.

[quote]With the SDK 2016 R1 prerelease seems have a debug problem with VS2015… you confirm it?
Not confirm :slight_smile:

VS2015 is still not supported, even in 2016R1 pre-release. Stay on VS2013 to be supported!

1 Like

We need an “Agree but dislike” button up there next to the “Like” button :wink:

I get my dislike button first!

OK, with the new SDK extended ID issue it has been resolved :clap: .
Now I wanted one more thing.
I have a quite long CAN bus and wanted to know if someone has tried to use the G80 with two CAN bus to get a CAN repeater and if I can do it. ::slight_smile:
There is a chips that do this but given the cost can I use a G80 with 2 MCP2562?

I don’t think that it is quite as simple as that. Normally CAN repeaters will pass through any errors etc. They don’t actually process the CAN data, they just pass the bits back and forth.

How long is LONG in your case. I’ve run CAN over 1500M of twisted pair cable at 10Kbps.