import Pass as p if __name__ == '__main__': # There are five different functions for uploading and download calibration to and from files: # updateCalibrationsInFile - Update calibration parameters in a parameter file # uploadCalibrationsToFileAll - Upload all calibration parameters in ECU to file # uploadCalibrationsToFileSelected - Upload a selection of calibration parameters in ECU to file # downloadCalibrationFromFile - Download all calibration parameters in a file to ECU # downloadCalibrationsFromFileSelected - Download a selection of calibration parameters in a file to ECU # # Both CDFX and DCM file formats are supported. # Note that A2L filename needs to be a raw string if it contains backslash p.loadA2lFile(r"C:\Repos\sumac\Test试\G001_1_GTT_SinX3\G001_1_GTT.a2l") print("Connecting to ECU...") p.connectToXcpSlaveCanClassic('') # Empty string => Use first found physical device print("Uploading all to DCM...") p.uploadCalibrationsToFileAll(r'C:\tmp\upload.dcm', p.PageType.WORKING) print("Uploading all to CDFX...") p.uploadCalibrationsToFileAll(r'C:\tmp\upload.cdfx', p.PageType.WORKING) print("Uploading some calibration parameters to CDFX...") p.uploadCalibrationsToFileSelected(r'C:\tmp\upload_selected.cdfx', ['T_SinA_AmpMap', 'T_SinA_AmpMapXAxisInput'], p.PageType.WORKING) p.disconnectFromXcpSlave()