winIDEA SDK
Loading...
Searching...
No Matches
test_create_config_item.py
1# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_createConfigItem():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 addCtrl = ic.CAddressController(connMgr)
16
17 daqCfgs = ic.DAQConfigVector()
18
19 print("Adding DAQ area by address.size...")
20 symInfo = addCtrl.getSymbolInfo(ic.IConnectDebug.fRealTime, "mainLoopCounter")
21 cfg1 = ic.CDAQConfigItem(symInfo.getSizeMAUs(),
22 symInfo.getMemArea(),
23 symInfo.getAddress(),
24 ic.CDAQController.daqSampleMax,
25 0,
26 0)
27 daqCfgs.push_back(cfg1)
28
29 print("Adding DAQ area by variable name...")
30 cfg2 = ic.CDAQConfigItem("mainLoopCounter",
31 ic.CDAQController.daqSampleMax,
32 0,
33 0)
34 daqCfgs.push_back(cfg2)
35
36 print("Adding DAQ area by program counter (PC) value...")
37 cfg3 = ic.CDAQConfigItem("0x00027000", # "0x12345678"
38 ic.CDAQController.daqSampleMax,
39 0,
40 0)
41 daqCfgs.push_back(cfg3)
42
43
44if __name__ == "__main__":
45 test_createConfigItem()