{"id":32190,"date":"2026-03-09T12:55:27","date_gmt":"2026-03-09T19:55:27","guid":{"rendered":"https:\/\/digilent.com\/blog\/?p=32190"},"modified":"2026-04-15T09:56:02","modified_gmt":"2026-04-15T16:56:02","slug":"why-your-triggered-capture-doesnt-start-at-sample-0-from-the-forum","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/why-your-triggered-capture-doesnt-start-at-sample-0-from-the-forum\/","title":{"rendered":"Why Your Triggered Capture Doesn\u2019t Start at Sample 0: From the Forum"},"content":{"rendered":"<h4>The Question<\/h4>\n<div>\n<p>A user getting started with the <strong>Analog Discovery 3 (AD3)<\/strong> wanted to generate a waveform using the Arbitrary Waveform Generator while simultaneously sampling an analog input &#8211; both synchronized in time using a software trigger.<\/p>\n<p>While the triggers appeared coincident when viewed on an external oscilloscope, the captured analog input data told a different story. The waveform didn\u2019t appear at the start of the sample buffer. Instead, it showed up roughly halfway through a 12,500\u2011sample acquisition.<\/p>\n<p>With both Analog Out and Analog In configured for software triggering, the user couldn\u2019t find anything in the WaveForms SDK or reference documentation explaining this behavior.<\/p>\n<hr \/>\n<h4>The Answer<\/h4>\n<p>The key detail comes down to how trigger position is defined for Analog In acquisitions when using the WaveForms SDK.<\/p>\n<p>Unlike what many users expect from a programming perspective, a trigger position of <code>0.0<\/code> does not place the trigger at the beginning of the data buffer. Instead, the trigger position is defined relative to the center of the acquisition buffer, similar to how a traditional oscilloscope works.<\/p>\n<p>That means:<\/p>\n<ul>\n<li>A trigger position of <code>0.0<\/code> places the trigger <strong>in the middle of the buffer<\/strong><\/li>\n<li>The first half of the buffer contains <strong>pre\u2011trigger samples<\/strong><\/li>\n<li>The second half contains <strong>post\u2011trigger samples<\/strong><\/li>\n<\/ul>\n<p>So if a waveform appears around the midpoint of the buffer, the trigger is behaving exactly as designed.<\/p>\n<p>To shift the trigger to the beginning of the buffer, the trigger position must be explicitly set based on the buffer size and sample rate, rather than assuming index 0 corresponds to the trigger event.<\/p>\n<hr \/>\n<h4>Why This Makes More Sense in WaveForms<\/h4>\n<p>This trigger behavior is easier to visualize in the WaveForms desktop application. In the Scope instrument:<\/p>\n<ul>\n<li><strong>Time Position<\/strong> directly corresponds to trigger position<\/li>\n<li>The trigger marker shows where the trigger falls within the acquisition window<\/li>\n<li>Sample index 0 typically represents time <em>before<\/em> the trigger, not the trigger itself<\/li>\n<\/ul>\n<p>Understanding this mapping makes it much easier to translate between what you see in WaveForms and how captured data appears in the SDK.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2026\/01\/forum-600x475.webp\" alt=\"\" width=\"600\" height=\"475\" class=\"alignnone size-medium wp-image-32191\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2026\/01\/forum-600x475.webp 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2026\/01\/forum-1024x810.webp 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2026\/01\/forum.webp 1148w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<hr \/>\n<h4>The Result<\/h4>\n<p>Once the trigger position was configured with this behavior in mind, the acquisition aligned as expected and the issue was resolved.<\/p>\n<hr \/>\n<h4>Takeaway<\/h4>\n<p>When synchronizing Analog Out and Analog In on the Analog Discovery 3 using the WaveForms SDK, remember:<\/p>\n<ul>\n<li>The trigger position is relative to the <strong>center of the acquisition buffer<\/strong><\/li>\n<li>A trigger position of <code>0.0<\/code> does <strong>not<\/strong> mean \u201cstart at sample 0\u201d<\/li>\n<li>Seeing data appear halfway through a buffer often indicates correct triggering, not a timing issue<\/li>\n<\/ul>\n<p>If your data looks offset, the fix may be as simple as adjusting trigger position, not your timing or wiring.<\/p>\n<p>Read the full forum thread <a href=\"https:\/\/forum.digilent.com\/topic\/33433-delay-in-ad3-analog-in-sampling\/\">HERE<\/a><\/p>\n<\/div>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-32190 jlk' data-task='like' data-post_id='32190' data-nonce='ac068a413b' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-32190 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-32190 jlk' data-task='unlike' data-post_id='32190' data-nonce='ac068a413b' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-32190 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-32190 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>The Question A user getting started with the Analog Discovery 3 (AD3) wanted to generate a waveform using the Arbitrary Waveform Generator while simultaneously sampling an analog input &#8211; both &hellip; <\/p>\n","protected":false},"author":47,"featured_media":32245,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4361,4312,1563],"tags":[4432,4971,5260,5093,5095,5261,5262,452,4422],"ppma_author":[4587],"class_list":["post-32190","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-acquisition","category-usb-scopes-analyzers-generators","category-guide","tag-ad3","tag-arbitrary-waveform-generator","tag-buffer","tag-forum","tag-from-the-forum","tag-trigger","tag-trigger-position","tag-waveforms","tag-waveforms-sdk"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2026\/02\/FTF-TriggeredCapture-735x400-1.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4587,"user_id":0,"is_guest":1,"slug":"digilent","display_name":"Digilent","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/32190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/47"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=32190"}],"version-history":[{"count":3,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/32190\/revisions"}],"predecessor-version":[{"id":32264,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/32190\/revisions\/32264"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/32245"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=32190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=32190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=32190"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=32190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}