AN-ISC-8-1067_GenMsgMinAcceptLengths
GenMsgMinAcceptLength with Il_Vector in Geny Version 1.1 2008-09-09 Application Note AN-ISC-8-1067
Author(s) Meiss,
Gunnar
Restrictions Customer
confidential - PSA, Renault and Nissan only
Abstract
This Application Note describes the reception of messages with a DLC smaller or equal
than the described DLC in the database with the Il_Vector and the database attribute
GenMsgMinAcceptLength.
Table of Contents
1.0 Overview ..........................................................................................................................................................
1 1.1 Database Attributes.......................................................................................................................................
1 1.2 Particularities and Limitations .......................................................................................................................
2 1.2.1 Indication Notification..................................................................................................................................
2 1.2.2 Example Without DLC Change...................................................................................................................
2 1.2.3 Example With DLC Change........................................................................................................................
3 1.2.4 Data Changed Flags...................................................................................................................................
4 1.2.5 Timeout Flags and Functions .....................................................................................................................
4 1.2.6 Multiplexed Signals.....................................................................................................................................
4 2.0 Additional Resources .......................................................................................................................................
4 3.0 Contacts...........................................................................................................................................................
5 1.0 Overview
The Specification of PSA defines, that a CAN message has to be accepted by the ECU with different lengths. The
minimum length can be equal to the DLC of a message defined in the database for an ECU or smaller.
If a message is received, where the DLC is smaller than defined in the database, the application has to be
implemented with care according to the rules described in this document. All messages received with a DLC
smaller than the configured GenMsgMinAcceptLength, the messages are discarded by the ECU, because received
length is smaller than the minimum expected one.
1.1 Database Attributes The following table describes the properties of the database attribute GenMsgMinAcceptLength.
Name
GenMsgMinAcceptLength
Description
This value defines the minimum acceptance length in bytes of a CAN message. If no
value is specified, set the value to the DLC.
Type Of Object
Message
Value Type
Integer
Default 8
Minimum 0
Maximum 8
Table 1 – Properties of database attribute
1 Copyright © 2008 - Vector Informatik GmbH
Contact Information: www.vector-informatik.com or ++49-711-80 670-0
GenMsgMinAcceptLength with Il_Vector in Geny
1.2 Particularities and Limitations 1.2.1 Indication Notification If the received DLC of a message is greater or equal to the GenMsgMinAcceptLength configured in the database,
the indication notification (first value flags and indication flags are set and indication functions are called) is
performed for all signals or signal groups which are entirely contained in the received DLC of the message. If a
grouped signal is entirely within the received DLC, but the signal group is not within the received DLC, the
indication notification is not performed.
Note:
The application must check the indication flag or function before the signal value can be read by
the IlGet<SignalName>() signal access function or macro. If the indication flag is not set or the
indication function is not called, the application has to use the default value of the signal.
1.2.2 Example Without DLC Change The following code is an example if a message is received with a DLC smaller as defined in the database but the
DLC does not change during runtime ( GenMsgMinAcceptLength < DLC < DatabaseDLC ).
The example function is the application task which reads the signals “Speed” and “Rpm” of the message
“EngineInfo”.
/* Declare variables for the signal values. */
vuint8 ApplicationSpeedVariable;
vuint8 ApplicationRpmVariable;
void ApplicationTask(void)
{
if(IlGetSpeedIndication())
{
/* Read the received signal value. */
ApplicationSpeedVariable = IlGetRxSpeed();
/* Reset the indication flag. */
IlClrSpeedIndication();
}
else
{
/*
The signal has not been received yet.
Set the default value, if the default value is not configured.
*/
ApplicationSpeedVariable = 5;
}
/*
Read the received signal value or the default value,
which is configured in the generation tool.
*/
ApplicationRpmVariable = IlGetRxRpm();
}
2 Application Note AN-ISC-8-1067

GenMsgMinAcceptLength with Il_Vector in Geny
1.2.3 Example With DLC Change The following code is an example if a network is used where the DLC of a received messages changes during
runtime. The example function is the application task which reads the signals “Speed” and “Rpm” of the message
“EngineInfo”.
Note:
The application has to implement a message based CAN Driver PreCopy function which has to
clear all signal indication flags of the message and the polling feature of the Il_Vector must be
activated for this message. The following figure shows the configured attributes in GENy.
Figure 1 – Rx Messages of GENy
/* Declare variables for the signal values. */
vuint8 ApplicationSpeedVariable;
vuint8 ApplicationRpmVariable;
void ApplicationTask(void)
{
if(IlGetSpeedIndication())
{
/* Read the received signal value. */
ApplicationSpeedVariable = IlGetRxSpeed();
/* Reset the indication flag. */
IlClrSpeedIndication();
}
else
{
/*
The signal has not been received yet.
Set the default value, if the default value is not configured.
*/
ApplicationSpeedVariable = 5;
}
/*
Read the received signal value or the default value,
which is configured in the generation tool.
*/
ApplicationRpmVariable = IlGetRxRpm();
}
3 Application Note AN-ISC-8-1067
GenMsgMinAcceptLength with Il_Vector in Geny
vuint8 EngineInfoPreCopy(CanRxInfoStructPtr rxStruct)
{
rxStruct = rxStruct;
/*
Clear all signal indication Flags of the message to guarantee,
that only received signals are processed by the application.
*/
IlClrSpeedIndication();
IlClrRpmIndication();
return kCanCopyData;
}
1.2.4 Data Changed Flags The “Data Changed Flag” of a rx signal is only valid, if the indication flag is set or the signal indication function is
called previously.
Note:
Indication Flags have to be cleared by the application, or use the IlGetClr macros to get and clear
the indication flags.
1.2.5 Timeout Flags and Functions Message is never received after IlRxStart Timeout flags are set and timeout functions are called for all signals in the message if the timeout is elapsed.
Message is received minimum once after IlRxStart Timeout flags are set and timeout functions are called for all signals in the message, which are received with a
DLC greater than GenMsgMinAcceptLength, but smaller than the Size of the receive buffer.
1.2.6 Multiplexed Signals The database attribute GenMsgMinAcceptLength must not be used with messages containing multiplexed signals.
2.0 Additional Resources
See additional in the Technical Reference of the Il_Vector.
4 Application Note AN-ISC-8-1067
GenMsgMinAcceptLength with Il_Vector in Geny
3.0 Contacts Vector Informatik GmbH Vector CANtech, Inc. VecScan AB Ingersheimer Straße 24
39500 Orchard Hill Pl., Ste 550
Theres Svenssons Gata 9
70499 Stuttgart
Novi, MI 48375
41755 Göteborg
Germany
USA
Sweden
Tel.: +49 711-80670-0
Tel: +1-248-449-9290
Tel: +46 (0)31 764 76 00
Fax: +49 711-80670-111
Fax: +1-248-449-9704
Fax: +46 (0)31 764 76 19
Email: info@vector-informatik.de
Email: info@vector-cantech.com
Email: info@vecscan.com
Vector France SAS Vector Japan Co. Ltd. Vector Korea IT Inc. 168 Boulevard Camélinat
Seafort Square Center Bld. 18F
Daerung Post Tower III, 508
92240 Malakoff
2-3-12, Higashi-shinagawa,
182-4 Guro-dong, Guro-gu
France
Shinagawa-ku
Seoul, 152-790
Tel: +33 (0)1 42 31 40 00
Tokyo 140-0002
Republic of Korea
Fax: +33 (0)1 42 31 40 09
Japan
Tel.: +82-2-2028-0600
Email: information@vector-france.fr
Tel.: +81 3 5769 7800
Fax: +82-2-2028-0604
Fax: +81 3 5769 6975
Email: info@vector-korea.com
Email: info@vector-japan.co.jp
5 Application Note AN-ISC-8-1067