Hello,
I'm currently trying to handle flexible data rate but when I try to set up the DLC an exception appears : The specified data length code is not valid. Value must be between 0 and 15. However I saw that normally CAN FD is working with my version : 4.9.0.942.
First, I set the message type and then the dlc. Is there something to do to make it works?
Matthieu
CAN FD DLC beetween 0 to 15
Re: CAN FD DLC beetween 0 to 15
Hi,
which value for DLC do you set in your application? Can you please share parts of the code? Which PCAN hardware do you use?
regards
Michael
which value for DLC do you set in your application? Can you please share parts of the code? Which PCAN hardware do you use?
regards
Michael
Re: CAN FD DLC beetween 0 to 15
the value isn't always the same, this time it was 22.
Code: Select all
if (dataBaseMessage.DLC <= 8)
{
if (!dataBaseMessage.isExtID ?? false)
this.MsgType = MessageType.Standard;
else if (dataBaseMessage.isExtID ?? false)
this.MsgType = MessageType.Extended;
}
else
this.MsgType = MessageType.FlexibleDataRate;
this.DLC = dataBaseMessage.DLC;
this.ID = dataBaseMessage.ID;
public byte DLC
{
get { return messageBC.Message.DLC; }
set
{
messageBC.Message.DLC = value;
OnPropertyChanged(nameof(DLC));
}
}
Re: CAN FD DLC beetween 0 to 15
Hi,
DLC values can only have a value between 0 and 15. Looks like your "dataBaseMessage.DLC" is not valid. From where did you get it? Please see help of PCANBasic for more details about possible DLC:
regards
Michael
DLC values can only have a value between 0 and 15. Looks like your "dataBaseMessage.DLC" is not valid. From where did you get it? Please see help of PCANBasic for more details about possible DLC:
regards
Michael
Re: CAN FD DLC beetween 0 to 15
Hi,
the DLC that I retrieve is from a dbc file and the message is characterized by this line : "BO_ 2566741502 DM43: 22 Vector__XXX"
Anyway, I wasn't aware of the way DLC is working for CAN FD, so I couldn't get it to work properly.
Now that I'm aware, I guess I should set the DLC to the value just above, depending on the format of the DLC?
Matthieu,
Br
the DLC that I retrieve is from a dbc file and the message is characterized by this line : "BO_ 2566741502 DM43: 22 Vector__XXX"
Anyway, I wasn't aware of the way DLC is working for CAN FD, so I couldn't get it to work properly.
Now that I'm aware, I guess I should set the DLC to the value just above, depending on the format of the DLC?
Matthieu,
Br
Re: CAN FD DLC beetween 0 to 15
Hello,
yes, you must keep the DLC values as specified in the PCANBasic help (0-15 only).
regards
Michael
yes, you must keep the DLC values as specified in the PCANBasic help (0-15 only).
regards
Michael