import Pass as p import time as t if __name__ == '__main__': # Note that A2L filename needs to be a raw string if it contains backslash # Empty string for device to connect through => Use first found physical device p.addXcpEcu("ecu", r"C:\Repos\sumac\Test\G001_1_GTT_SinX3\G001_1_GTT_stripped_Ascii_2dArray.a2l", p.XcpConnectionType.XCP_CAN_CLASSIC, "") p.connectToXcpEcus() start = t.time() while t.time() - start < 5: t.sleep(0.1) try: print("Measured CpuLoad_Total: ", p.uploadXcpMeasurement("ecu.CpuLoad_Total")) except Exception as e: print(e) print("Connection broken...") break p.disconnectFromAllXcpEcus()