Is it Possible to Use a DBC for Ethernet Configuration?
Yes it is, but a Signal Protocol DLL is necessary for sending and interpreting in Trace/Data/Graphic Window the Ethernet signals that have been previously defined within a DBC database.
The DLL supports the interpretation of signals with fix offset and length, which are contained in an Ethernet packet corresponding to just a single frame out of the DBC. It is not possible, using a DBC as network description, to have several frames payloads contained in one Ethernet packet, or one payload split over several Ethernet packets (TCP or IP fragmentation), the signal protocol is mostly used with proprietary protocols.
Meanwhile Ethernet networks are defined by the OEMs using AUTOSAR ARXML format, which no more requires any signal protocol DLL as CANoe/CANalyzer contains a built-in support for the protocols SOME/IP, AUTOSAR PDU, XCP or DoIP.
However if you want to start with a DBC, you can either:
- Develop your own DLL following the instruction of Online Help page called Implementation of a Signal Protocol DLL
- Use Vector SignalProtocol.dll delivered as project example in the Sample Configuration EthernetSystemDemo of CANoe/CANalyzer Installation up to version 10. It interprets the UDP frames that have been transmitted on Port 40001. The UDP payload has to begin with a 32-bit identifier, defined as CAN identifier in the DBC. If your proprietary protocol corresponds to this design, then the signal protocol can easily be adapted to your usage.
The signal protocol DLL has to be assigned to the Eth bus (Configuration Menu | Network Hardware).
If you use CANoe 64-bit, then you additionally need a 64 bit version of your signal protocol DLL that has to be stored in the same directory as the 32-bit one, that you have configured above.
Both DLL shall have the same name and the 64-bit version one shall be called Name64.dll, like for instance:
The DBC shall first contain the BusType attribute set to Ethernet to be able to create signals and messages with DLC larger than 8:
Using the signal protocol DLL, in CAPL you can directly access the signals received within an Ethernet frame as follows:
To send these Ethernet messages, you have to create the corresponding CAPL data structures. See also the PacketDef.cin file included in the delivered Project Example. It contains this code part:
In the main program, you shall define a variable of this type:
Then you are able to use the EthInitPacket function to initialize the packet and then the EthSetToken function to set the protocol fields of this Ethernet frame (here it is a UDP frame):
// Prepare Message_1 ethernet packet
EthSetTokenInt(m1_Handle, "udp" , "source" , 40001 );
EthSetTokenInt(m1_Handle, "udp" , "destination", 40001 );
EthSetTokenInt(m1_Handle,"vc-sig","contentId",0x100); // message ID as defined in DBC
EthResizeToken(m1_Handle,"vc-sig","data",64); // length of raw message as defined in DBC
The following code sets the signals:
EthSetTokenSignalValue (m1_Handle, EngineSpeed, 1000.0 );
EthSetTokenSignalValue (m1_Handle, CoolantTemperature, 56.7 );
EthOutputPacket(m1_Handle); // sends the frame with the signals
For more information on this topic see following CANoe’s online help: