Skip to Content
SeekDAS S100M4X

触发采集

在给定通道上各采 N 点,CONV 由一路模拟输入的边沿给出

触发分三步:设置触发目标(哪些通道、每通道多少点)、设置 CONV 通道(哪一路输入、上升沿或下降沿、阈值)、启动并管理运行。 每个 CONV 边沿给每个目标通道各一个值,所以运行结束时每个通道正好 N 点。

#include <seekdas/seekdas.hpp>
using namespace seekdas;

Device dev("192.168.1.128");

Trigger trig;
// 1. 触发目标:S0A、S0B、S1C 各 50000 点
trig.target({Channel::S0A, Channel::S0B, Channel::S1C}, 50000);
// 2. CONV 通道:S2A 的下降沿,阈值 1000 码(±10 V 档约 1.57 V)
trig.conv(Channel::S2A, Edge::Falling, 1000);

// 3. 启动;运行中可以读状态,也可以边收边做别的
dev.start_trigger(trig);
Capture cap = dev.wait_trigger();          // 连续 10 s 没有新点时抛 TimeoutError(CONV 输入上没有信号?)

for (Channel c : cap.channels().channels()) {
    View<std::int16_t> v = cap.channel(c);            // 50000 个值,ADC 码
    std::printf("%s: %zu points\n", to_string(c).c_str(), v.size());
}
View<std::uint64_t> t = cap.times();                  // 每点的 CONV 时刻,T/64
double period_s = double(t[t.size() - 1] - t[0]) / double(t.size() - 1) / 64.0 / dev.sample_rate_hz();
cap.write_csv("trigger.csv");

可调的设置

C++ / Rust默认说明
target(channels, n)—必填。至少一个通道,n ≥ 1
conv(input, edge, threshold) / conv_channel—必填。只用这一路(替换已有的),迟滞 200 码
add_conv(...) / add_conv_channel—再加一路,最多共 4 路,见 CONV 通道
bandwidth(hz)20 MHz重采样滤波的带宽:输出是 CONV 时刻(1/64 采样周期分辨率)的带限插值。带宽越窄噪声越低
raw()—不滤波:CONV 时刻之前最近的一个原始采样
timestamps(bool)开每点带 CONV 时刻和来源(每点多 4 字节)
standard_mtu()关1472 字节小包,网络不支持巨帧时用
time_calibration(ticks)0取点时刻整体平移,单位 T/64(有符号)

示例程序

host/seekdas-rs/cpp/examples/trigger.cpp(构建产物 seekdas_trigger)把三步和状态显示放在一起:

seekdas_trigger ch=S0A,S0B n=10000 conv=S2A edge=rising thr=1400
seekdas_trigger ch=all n=50000 conv=S2A edge=falling thr=1000 raw csv=out.csv
seekdas_trigger port=15500 ch=S0A n=20000 conv=S0A edge=both thr=1031 hyst=50

实板上的输出(100 kHz 方波接 S2A):

device 192.168.1.128: PL 0.2.1 (2026-12-02 03:14:48), sample clock 100.0009 MHz, SDK 0.2.0
before: done, start allowed 1
second start while running: refused (busy: an acquisition is running; wait until it is done or stop it first)
  running 8752 / 10000 points, start allowed 0, CONV edges 11777
after: done, complete 1, start allowed 1, rejected 0, 0.239 s; late 0, invalid points 0
10000 points per channel
  S0A: 10000 points, mean   1032.77 codes (+1.6213 V at +-10 V), rms 451.62
  S0B: 10000 points, mean    -20.01 codes (-0.0314 V at +-10 V), rms 4.33
CONV: mean interval 999.998 samples = 9.999889 us (100.001 kHz), rms jitter 64.0 ps
stream: 101 packets, 0 retransmitted; device lost 0, late 0, dropped 0

On this page