winIDEA SDK
test_data_evaluate.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_evaluate():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 dataCtrl = ic.CDataController(connMgr)
16
17 print(f"Getting data of 'main_loop_counter' variable:")
18 value = dataCtrl.evaluate(ic.IConnectDebug.fRealTime, "main_loop_counter")
19 print(f"\tBit size: {value.getBitSize()}")
20 print(f"\tValue (double): {value.getDouble()}")
21 print(f"\tValue (int): {value.getInt()}")
22 print(f"\tValue (str): {value.getResult()}")
23
24 # NOTE: Returned object is `ic.CValueType` object, explore other available methods.
25
26
27if __name__ == "__main__":
28 test_evaluate()