Get Started with ARXML Files
This example shows you how to parse and view the information in an ARXML file.
Access is provided via an ARXML file object. The ARXML file object can be used for:
Input for the raw message decoding methods.
Observing the missing elements that could cause a decode failure.
Finding the information about the messages, PDUs, or Signals of interest.
Understanding the formation of the ARXML file.
This example describes the situation for CAN.
Open the ARXML File
Open the example file SampleFile.arxml
using arxmlDatabase
MATLAB function. The ARXML File Object includes three properties, the Name
, Path
and CAN
.
arxmlObj = arxmlDatabase("SampleFile.arxml")
arxmlObj = Database with properties: Name: "SampleFile.arxml" Path: "/tmp/Bdoc25a_2864802_1971459/tpcbc94420/vnt-ex86715502/SampleFile.arxml" CAN: [1×1 shared.vnt.arxml.protocol.CAN]
View the Entity Values from the ARXML File
The CAN
property is an object containing CAN-protocol-specific ARXML information. Currently, only the CAN protocol is supported, and all information within the object is read-only.
The CAN
object includes three properties: Frame
, PDU
, and ISignal
, reflecting the basic structure of the ARXML file.
arxmlObj.CAN
ans = CAN with properties: Frame: [2×9 table] PDU: [1×1 shared.vnt.arxml.shared.PDU] ISignal: [6×9 table]
View Frame Information
Call the Frame
property to view the Frame table.
arxmlObj.CAN.Frame
ans=2×9 table
Name Path ID Extended StartBit Length ByteOrder PDU FrameTriggering
____________ _____________________________ ____ ________ ________ ______ _______________________ ________________________________ ___________________
"ML_Frame_1" "/MathWorks/FRAME/ML_Frame_1" 1000 false 0 8 mostSignificantByteLast /MathWorks/PDUS/ML_ISignalIPDU_1 "FrameTriggering_1"
"ML_Frame_2" "/MathWorks/FRAME/ML_Frame_2" 1001 true 0 4 mostSignificantByteLast /MathWorks/PDUS/ML_ISignalIPDU_2 "FrameTriggering_2"
The Frame table includes the information defined in ARXML file for CAN. This table includes all the information required to decode CAN Frames to ISignalIPDUs.
The table defines the terms following the AUTOSAR standard.
Path
reflects the hierarchical organization from top to bottom, illustrating how elements are contained within each other.PDU
(Protocol Data Unit) is a data packet used for communication between software components and ECUs. It uses the same representation asPath
in the table.FrameTriggering
defines the timing and conditions under which theFrame
is sent or received on a network.ByteOrder
reflects the endianess. It uses the termmostSignificantByteLast
(Little Endian) andmostSignificantByteFirst
(Big Endian).
View PDU Information
Call the PDU
property to view the PDU information for CAN. The PDU
is an object with various types of PDUs as properties. Currently, only ISignalIPDU
is supported.
arxmlObj.CAN.PDU
ans = PDU with properties: ISignalIPDU: [2×6 table]
Call the ISignalIPDU
to view the ISignalIPDU table.
arxmlObj.CAN.PDU.ISignalIPDU
ans=2×6 table
Name Frame ISignal StartBit Length ByteOrder
__________________ ___________________________ ___________ ________ ______ _______________________
"ML_ISignalIPDU_1" /MathWorks/FRAME/ML_Frame_1 {4×5 table} 0 8 mostSignificantByteLast
"ML_ISignalIPDU_2" /MathWorks/FRAME/ML_Frame_2 {2×5 table} 0 4 mostSignificantByteLast
The ISignalIPDU table includes the ISignalIPDU information defined in ARXML file for CAN. The ISignal
column lists the ISignals contained within a specific ISignalIPDU
.
arxmlObj.CAN.PDU.ISignalIPDU.ISignal{1}
ans=4×5 table
Name StartBit Length ByteOrder BaseType
______________ ________ ______ ________________________ ____________
"ML_ISignal_1" 0 1 mostSignificantByteLast {1×1 struct}
"ML_ISignal_2" 1 2 mostSignificantByteFirst {1×1 struct}
"ML_ISignal_3" 3 2 opaque {1×1 struct}
"ML_ISignal_4" 5 1 mostSignificantByteLast {1×1 struct}
arxmlObj.CAN.PDU.ISignalIPDU.ISignal{2}
ans=2×5 table
Name StartBit Length ByteOrder BaseType
______________ ________ ______ _______________________ ____________
"ML_ISignal_5" 0 2 mostSignificantByteLast {1×1 struct}
"ML_ISignal_6" NaN NaN mostSignificantByteLast {1×1 struct}
This ISignal table includes the basic information, such as the bit position of the ISignal in the ISignalIPDU. Complete ISignal information is available in the ISignal table.
View ISignal Information
Call the ISignal property to view the ISignal table.
arxmlObj.CAN.ISignal
ans=6×9 table
Name CompuMethod StartBit Length ByteOrder BaseType Unit PDU SystemSignal
______________ ___________________________________________________ ________ ______ ________________________ ____________ ___________ ________________________________ _______________________________________________
"ML_ISignal_1" 1×1 shared.vnt.arxml.shared.compumethod.CompuMethod 0 1 mostSignificantByteLast {1×1 struct} F /MathWorks/PDUS/ML_ISignalIPDU_1 "/MathWorks/SYSTEM_SIGNALS/ML_ISignal_1_System"
"ML_ISignal_2" 1×1 shared.vnt.arxml.shared.compumethod.CompuMethod 1 2 mostSignificantByteFirst {1×1 struct} min /MathWorks/PDUS/ML_ISignalIPDU_1 "/MathWorks/SYSTEM_SIGNALS/ML_ISignal_2_System"
"ML_ISignal_3" 1×1 shared.vnt.arxml.shared.compumethod.CompuMethod 3 2 opaque {1×1 struct} rpm /MathWorks/PDUS/ML_ISignalIPDU_1 "/MathWorks/SYSTEM_SIGNALS/ML_ISignal_3_System"
"ML_ISignal_4" 1×1 shared.vnt.arxml.shared.compumethod.CompuMethod 5 1 mostSignificantByteLast {1×1 struct} F /MathWorks/PDUS/ML_ISignalIPDU_1 "/MathWorks/SYSTEM_SIGNALS/ML_ISignal_4_System"
"ML_ISignal_5" 1×1 shared.vnt.arxml.shared.compumethod.CompuMethod 0 2 mostSignificantByteLast {1×1 struct} F /MathWorks/PDUS/ML_ISignalIPDU_2 "/MathWorks/SYSTEM_SIGNALS/ML_ISignal_5_System"
"ML_ISignal_6" 1×1 shared.vnt.arxml.shared.compumethod.CompuMethod NaN NaN mostSignificantByteLast {1×1 struct} <undefined> /MathWorks/PDUS/ML_ISignalIPDU_2 ""
The CompuMethod
column displays the CompuMethod
object, allowing you to view the properties of supported CompuMethods. More details will be provided if we call the item in the table.
For example, ISignal "ML_ISignal_2
" uses a CompuMethod of the type TextTable.
arxmlObj.CAN.ISignal.CompuMethod(2)
ans = TextTable with properties: Name: "ML_ISignal_2_Encoding" Unit: "min" VT: ["Group1" "Group2" "Group3"] LowerLimit: [1 2 3] UpperLimit: [1 2 3] DefaultValue: "" InverseValue: [NaN NaN NaN]
The BaseType column displays the information of the physical data type. It specifies the encoding method and size of the data.
arxmlObj.CAN.ISignal.BaseType{1}
ans = struct with fields:
BaseTypeEncoding: 'NONE'
BaseTypeSize: 16
Missing Elements
In ARXML, certain elements are optional. If they are not defined in the file, they might be absent from the ARXML file object table.
Different datatypes have different representation of "missing" in the table.
arxmlObj.CAN.ISignal(6,:)
ans=1×9 table
Name CompuMethod StartBit Length ByteOrder BaseType Unit PDU SystemSignal
______________ _____________________________________________ ________ ______ _______________________ ____________ ___________ ________________________________ ____________
"ML_ISignal_6" 1×1 shared.vnt.arxml.shared.compumethod.Empty NaN NaN mostSignificantByteLast {1×1 struct} <undefined> /MathWorks/PDUS/ML_ISignalIPDU_2 ""