import Pass as p if __name__ == '__main__': # 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") # If we want to attach to a specific device by name then # we can list all available devices and parse out the one we need # # Note! It is still possible to omit the device string. # In that case we get the first found CAN dongle. # # xcp_device = "" # for dev in p.getAvailableDevicesCanClassic(): # if dev.startswith("Kvaser Leaf"): # xcp_device = dev # break print("Connecting to ECU...") p.connectToXcpSlaveCanClassic('') # Empty string => Use first found physical device variable = "T_LatAccFeelMax_Tq" p.downloadCalibrationScalar(variable, 1.2) p.disconnectFromXcpSlave()