winIDEA SDK
Loading...
Searching...
No Matches
test_data_evaluate.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 script focuses on the CDataController2.evaluateComposite() function, which handles arrays and structures regardless of its size.
# It enables the retrieval and inspection of complex composite variables like g_complexStruct.
import isystem.connect as ic
winidea_id = ''
def test_evaluate():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
dataCtrl = ic.CDataController(connMgr)
print(f"Getting data of 'mainLoopCounter' variable:")
value = dataCtrl.evaluate(ic.IConnectDebug.fRealTime, "mainLoopCounter")
print(f"\tBit size: {value.getBitSize()}")
print(f"\tValue (double): {value.getDouble()}")
print(f"\tValue (int): {value.getInt()}")
print(f"\tValue (str): {value.getResult()}")
# NOTE: Returned object is `ic.CValueType` object, explore other available methods.
if __name__ == "__main__":
test_evaluate()