winIDEA SDK
test_run_stop.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2# (c) TASKING Germany GmbH, 2023
3#
4# This Python example calls the run() and stop()
5# functions which start or stop the target CPU. It then prints
6# out whether the CPU is in a running or stopped state.
7
8import isystem.connect as ic
9
10
11winidea_id = ''
12
13
14def test_run_stop():
15 connMgr = ic.ConnectionMgr()
16 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
17
18 execCtrl = ic.CExecutionController(connMgr)
19
20 execCtrl.run()
21 isRunning = execCtrl.getCPUStatus(False).isRunning()
22 print(f"Is CPU in `RUN` state: {isRunning}")
23
24 execCtrl.stop()
25 isStopped = execCtrl.getCPUStatus(False).isStopped()
26 print(f"Is CPU in `STOP` state: {isStopped}")
27
28
29if __name__ == "__main__":
30 test_run_stop()