7import isystem.connect
as ic
14 connMgr = ic.ConnectionMgr()
15 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
17 execCtrl = ic.CExecutionController(connMgr)
18 daqCtrl = ic.CDAQController(connMgr)
20 print(
"Configuring DAQ to observe variable 'main_loop_counter' (item with index 0)...")
21 daqCfg = ic.DAQConfigVector()
22 cfg = ic.CDAQConfigItem(
"main_loop_counter", ic.CDAQController.daqSampleMax, 0)
24 daqCtrl.configure(daqCfg)
25 daqCtrl.enableGlobal(
True)
27 print(
"Running CPU and recording variable...")
32 status = daqCtrl.status()
33 print(
"Recording finished, current DAQ status:")
34 print(f
"\tDAQ globally enabled: {status.getGlobalEnable()}")
35 print(f
"\tNumber of available samples: {status.getNumSamplesAvailable()}")
36 print(f
"\tLast loop time: {status.getLastLoopTime()}")
37 print(f
"\tNumber of DAQ loops: {status.getNumLoops()}")
38 print(f
"\tIs overflow: {status.getOverflow()}")
39 print(f
"\tDAQ internal time: {status.getTime()}")
43 print(f
"\tMax items: {info.getMaxItems()}")
44 print(f
"\tBuffer size: {info.getBufSize()}")
45 print(f
"\tMax item size: {info.getMaxItemSize()}")
47 print(f
"First 10 samples (out of {status.getNumSamplesAvailable()}):")
48 samples = ic.DAQSampleVector()
50 for index, sample
in enumerate(samples[:10]):
52 value = daqCtrl.getDataValue(sample).getInt()
53 timeUs = sample.getTime()
54 print(f
"\tSample {index}: {value} @ {timeUs} us (DAQ item: {sample.getIndex()})")
56 daqCtrl.enableGlobal(
False)
59if __name__ ==
"__main__":