winIDEA SDK
test_run_stop.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# This Python example demonstrates the usage of the winIDEA SDK
4# CExecutionController class and 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#
8# (c) TASKING Germany GmbH, 2023
9
10import isystem.connect as ic
11
12
13winidea_id = ''
14
15
16def test_run_stop():
17 connMgr = ic.ConnectionMgr()
18 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
19
20 execCtrl = ic.CExecutionController(connMgr)
21
22 execCtrl.run()
23 isRunning = execCtrl.getCPUStatus(False).isRunning()
24 print(f"Is CPU in `RUN` state: {isRunning}")
25
26 execCtrl.stop()
27 isStopped = execCtrl.getCPUStatus(False).isStopped()
28 print(f"Is CPU in `STOP` state: {isStopped}")
29
30
31if __name__ == "__main__":
32 test_run_stop()