5import isystem.connect
as ic
11def test_readWriteValue():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
15 dataCtrl = ic.CDataController(connMgr)
16 addCtrl = ic.CAddressController(connMgr)
18 address = addCtrl.getVariableAddress(
"main_loop_counter").getAddress()
20 print(f
"Writing value '{42}' to address: '{hex(address)}'...")
22 valType.m_byType = ic.SType.tUnsigned
23 valType.m_byBitSize = 32
24 cVal = ic.CValueType(valType, 42)
25 dataCtrl.writeValue(ic.IConnectDebug.fRealTime,
30 print(f
"Reading back value...")
31 value = dataCtrl.readValue(ic.IConnectDebug.fRealTime,
35 print(f
"\tValue: '{value.getInt()}'")
37 print(f
"Alternatively, value can be written without updating winIDEA GUI (faster method)...")
38 dataCtrl.writeValue(ic.IConnectDebug.fRealTime,
45if __name__ ==
"__main__":