winIDEA SDK
Loading...
Searching...
No Matches
test_run_until_function.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
# (c) TASKING Germany GmbH, 2023
#
# This Python example runs the target until the specified function,
# and the CSessionCtrl class to begin the program.
import isystem.connect as ic
winidea_id = ''
def test_run_until_function():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
execCtrl = ic.CExecutionController(connMgr)
sessionCtrl = ic.CSessionCtrl(connMgr)
sessionCtrl.begin_program()
print("Running CPU to function 'main' (without timeout)...")
execCtrl.runUntilFunction("main")
print("Running CPU to function 'SoCInit' (with 1 sec timeout)...")
execCtrl.runUntilFunction("SoCInit",
ic.CExecutionController.TOUT_1s,
True) # raise exception on timeout
print("Running to the same function ('SoCInit') again will fail...")
if execCtrl.runUntilFunction("SoCInit",
ic.CExecutionController.TOUT_1s,
False): # do not raise exception on timeout
print("\tOK: exception was not raised, although timeout was reached.")
if __name__ == "__main__":
test_run_until_function()