トリガーしたい(rp_AcqGetTriggerState
)
1def single_daq_trigger():
2 printf(f"trigger state: {rp.rp_AcqGetTriggerState()[1]}")
3 printf(f"buffer state: {rp.rp_AcqGetBufferFillState()[1]}")
4
5 while 1:
6 trigger_state = rp.rp_AcqGetTriggerState()[1]
7 if trigger_state == rp.RP_TRIG_STATE_TRIGGERED:
8 break
9 print("Triggered!")
10
11 while 1:
12 if rp.rp_AcqGetBufferFillState()[1]:
13 break
14 print("Data Filled!")
15
16 printf(f"trigger state: {rp.rp_AcqGetTriggerState()[1]}")
17 printf(f"buffer state: {rp.rp_AcqGetBufferFillState()[1]}")
トリガー条件を待つために必要な要素をサンプルコードから抜粋してみました。
基本的にwhile 1
のループを使って、トリガー条件とバッファーのステータスを確認します。
ループの前後でステータスを出力してみると、それぞれでなにを確認しているかが理解できると思います。