winIDEA SDK
test_daq_configure.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_configure():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 daqCtrl = ic.CDAQController(connMgr)
16
17 daqCfg = ic.DAQConfigVector()
18
19 cfg = ic.CDAQConfigItem("mainLoopCounter", ic.CDAQController.daqSample100ms, 0)
20 daqCfg.push_back(cfg)
21 daqCtrl.configure(daqCfg)
22
23 print("Adding 'interrupt_counter' variable to DAQ configuration...")
24 cfg = ic.CDAQConfigItem("iInterruptCounter", ic.CDAQController.daqSampleMax, 0)
25 daqCfg.push_back(cfg)
26 daqCtrl.configure(daqCfg)
27
28 print(f"DAQ configured, {daqCtrl.getNumItems()} variables observed.")
29
30
31if __name__ == "__main__":
32 test_configure()