www.gusucode.com > vnt 源码程序 matlab案例代码 > vnt/demoXCP_AccessXCPA2LFiles.m
%% Access XCP A2L Files % This example shows how to access information stored in A2L files for % use with XCP connections. It uses a freely available XCP slave simulator % from Vector and Vector Virtual CAN channels. % % Copyright 2012-2013 The MathWorks, Inc. %% Run a Slave Simulator % This example requires installing a free, third-party XCP implementation % from Vector. The package includes an XCP slave simulator and A2L file. To % install this driver, please follow these instructions: % % # Go to www.vector.com and navigate to the "DOWNLOADS" page. % # Search for "Demos" under "Categories" and "XCP" under "Standards". % # Download and install the available version of "XCP Sample % Implementation". % # In MATLAB, navigate to where you installed the sample package, and % then go to .\Samples\XCPSim\CANape. % # The MATLAB XCP examples will use the XCPSIM.a2l file and the % XCPsim.exe slave simulator. Run XCPsim.exe. %% Open an A2L File % Open an A2L file to parse and inspect the contents and make it usable for % subsequent XCP activities. a2lObj = xcpA2L('XCPSIM.a2l') %% Inspect A2L Information % The properties of the A2L file object allow you to inspect the many % configuration parameters contained within the file. Of special note is % the |Measurements| property which contains the names of all available % measurements for use in DAQ/STIM lists. a2lObj.Measurements %% Query for Event Information % Use the |getEventInfo| command to retrieve detailed information about an % event by name. getEventInfo(a2lObj, '10 ms') %% Query for Measurement Information % Use the |getMeasurementInfo| command to retrieve detailed information % about a measurement by name. getMeasurementInfo(a2lObj, 'Triangle')