winIDEA SDK
Loading...
Searching...
No Matches
test_cs_read_memory.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
import isystem.connect as ic
winidea_id = ''
def test_csReadMemory():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
dataCtrl = ic.CDataController(connMgr)
addCtrl = ic.CAddressController(connMgr)
MEM_START = addCtrl.getVariableAddress("mainLoopCounter").getAddress()
MEM_SIZE = 4
codeStore = dataCtrl.csCreate()
dataContainer = ic.VectorBYTE(MEM_SIZE)
codeStore.insert(MEM_START, dataContainer)
print(f"Reading '{MEM_SIZE}' bytes of memory from '{hex(MEM_START)}'...")
readCodeStore = dataCtrl.csReadMemory(0, codeStore)
print(f"\tMemory read, explore 'readCodeStore' object.")
# NOTE: Returned diff object is again `ic.CCodeStore` object, explore other available methods.
if __name__ == "__main__":
test_csReadMemory()