pyCANape#
Description#
pyCANape is a pythonic wrapper around the VECTOR CANape API.
With pyCANape you can:
open existing CANape projects:
canape = pycanape.CANape( project_path=r"C:\Users\Public\Documents\Vector CANape 17\Examples\XCPDemo", modal_mode=True, clear_device_list=False, )
load CANape configurations:
canape.load_cna_file( cna_file=r"C:\Users\Public\Documents\Vector CANape 17\Examples\XCPDemoXCPsimDemo.cna" )
connect and disconnect devices:
xcpsim = canape.get_module_by_name("XCPSim") xcpsim.switch_ecu_on_offline(online=True)
start/stop data acquisition:
canape.start_data_acquisition() canape.stop_data_acquisition()
define and start/stop recorders:
recorder = canape.get_selected_recorder() recorder.set_mdf_filename(filename="test.mf4") recorder.start() recorder.stop()
get/set ECU variables:
map1_counter = xcpsim.get_calibration_object("map1Counter") old_value = map1_counter.value map1_counter.value = 0