6This example shows FNet Counter controller initialization and usage.
10import isystem.connect
as ic
17 connMgr = ic.ConnectionMgr()
18 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
21 SessionCtrl = ic.CSessionCtrl(connMgr)
22 FNetCtrl = ic.CFNetCtrl(connMgr)
23 CounterCtrl = FNetCtrl.counter(
'Root.COUNTER1')
28 SessionCtrl.begin_prepare()
36 optCounterOp = CounterCtrl.op()
38 CounterCtrl.op_qualifier_enable(FTrigQ)
39 CounterCtrl.op_qualifier_enable_on_start(
False)
42 optChannel = optCounterOp.opt_channel(nChannel = 1)
44 optChannel.set_count_on(bCount =
True, nPeriod_us = 10, nFEvent = 4)
46 optChannel.set_on_increment(nFTrig = 0)
48 optChannel.set_active(bStart =
True, nFTrigRestart = 5, nFTrigSuspend = 6, nFTrigResume = 7)
50 optChannel.set_limit(bLimit =
True, nLimit = 1000, nFTrig = 8, bRestart =
False)
52 optChannel.set_record(bOnChange =
True)
59 nCount = CounterCtrl.ctrl_get_FTrig_count(FTrigQ)
61 CounterCtrl.ctrl_reset_FTrig_count(nFTrig = 1)
67 CounterCtrl.ctrl_reset (nChannel = 1)
68 CounterCtrl.ctrl_suspend(nChannel = 1)
69 CounterCtrl.ctrl_resume (nChannel = 1)
73 Status = CounterCtrl.ctrl_get_status(nChannel = 1)
74 print(f
"count: {Status.m_nCount}, active: {Status.m_bActive}")
76except Exception
as ex: