ATSSDKGuide 750

Download as pdf or txt
Download as pdf or txt
You are on page 1of 208

ATS-SDK User Guide

Version 7.5.0
June 4, 2021
CONTENTS

1 License Agreement 3
1.1 Important . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Ownership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Rights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Limited Warranty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Getting Started 7
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Programming Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Sample code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4 Contacting us . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3 Programmer’s Guide 15
3.1 Addressing a board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Resetting a board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Configuring a board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4 Acquiring data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.5 Processing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

4 AlazarDSP API Documentation 71


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.2 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

5 Advanced Topics 75
5.1 External clock issues for OCT applications . . . . . . . . . . . . . . . . . . . . . . . 75

6 API Reference 79
6.1 AlazarAbortAsyncRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
6.2 AlazarAbortCapture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
6.3 AlazarAllocBufferU16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
6.4 AlazarAllocBufferU16Ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
6.5 AlazarAllocBufferU8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
6.6 AlazarAllocBufferU8Ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
6.7 AlazarAsyncRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
6.8 AlazarBeforeAsyncRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
6.9 AlazarBoardsFound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

i
6.10 AlazarBoardsInSystemByHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.11 AlazarBoardsInSystemBySystemID . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6.12 AlazarBusy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6.13 AlazarConfigureAuxIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
6.14 AlazarConfigureLSB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.15 AlazarConfigureRecordAverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.16 AlazarConfigureSampleSkipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
6.17 AlazarCoprocessorDownload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
6.18 AlazarCoprocessorRegisterRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6.19 AlazarCoprocessorRegisterWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.20 AlazarCreateStreamFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.21 AlazarDSPAbortCapture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6.22 AlazarDSPGenerateWindowFunction . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.23 AlazarDSPGetBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.24 AlazarDSPGetInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
6.25 AlazarDSPGetModules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
6.26 AlazarDSPGetNextBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.27 AlazarDSPGetParameterFloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
6.28 AlazarDSPGetParameterS32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
6.29 AlazarDSPGetParameterU32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.30 AlazarDSPSetParameterFloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.31 AlazarDSPSetParameterS32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
6.32 AlazarDSPSetParameterU32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
6.33 AlazarErrorToText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
6.34 AlazarExtractFFTNPTFooters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.35 AlazarExtractNPTFooters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.36 AlazarExtractTimeDomainNPTFooters . . . . . . . . . . . . . . . . . . . . . . . . . 122
6.37 AlazarFFTBackgroundSubtractionGetRecordS16 . . . . . . . . . . . . . . . . . . . 123
6.38 AlazarFFTBackgroundSubtractionSetEnabled . . . . . . . . . . . . . . . . . . . . 123
6.39 AlazarFFTBackgroundSubtractionSetRecordS16 . . . . . . . . . . . . . . . . . . . 124
6.40 AlazarFFTGetMaxTriggerRepeatRate . . . . . . . . . . . . . . . . . . . . . . . . . . 124
6.41 AlazarFFTSetScalingAndSlicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.42 AlazarFFTSetWindowFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
6.43 AlazarFFTSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.44 AlazarForceTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.45 AlazarForceTriggerEnable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
6.46 AlazarFreeBufferU16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
6.47 AlazarFreeBufferU16Ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
6.48 AlazarFreeBufferU8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
6.49 AlazarFreeBufferU8Ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
6.50 AlazarGetBoardBySystemHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
6.51 AlazarGetBoardBySystemID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
6.52 AlazarGetBoardKind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.53 AlazarGetBoardRevision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.54 AlazarGetCPLDVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.55 AlazarGetChannelInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
6.56 AlazarGetChannelInfoEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6.57 AlazarGetDriverVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

ii
6.58 AlazarGetMaxRecordsCapable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
6.59 AlazarGetParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
6.60 AlazarGetParameterLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
6.61 AlazarGetParameterUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
6.62 AlazarGetSDKVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
6.63 AlazarGetStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
6.64 AlazarGetSystemHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
6.65 AlazarGetTriggerAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
6.66 AlazarGetTriggerTimestamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
6.67 AlazarGetWhoTriggeredBySystemHandle . . . . . . . . . . . . . . . . . . . . . . . 147
6.68 AlazarGetWhoTriggeredBySystemID . . . . . . . . . . . . . . . . . . . . . . . . . . 148
6.69 AlazarHyperDisp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
6.70 AlazarInputControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
6.71 AlazarInputControlEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.72 AlazarNumOfSystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.73 AlazarOCTIgnoreBadClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.74 AlazarPostAsyncBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
6.75 AlazarQueryCapability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
6.76 AlazarQueryCapabilityLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
6.77 AlazarRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
6.78 AlazarReadEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
6.79 AlazarResetTimeStamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
6.80 AlazarSetADCBackgroundCompensation . . . . . . . . . . . . . . . . . . . . . . . 165
6.81 AlazarSetBWLimit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
6.82 AlazarSetCaptureClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
6.83 AlazarSetExternalClockLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
6.84 AlazarSetExternalTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
6.85 AlazarSetLED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
6.86 AlazarSetParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
6.87 AlazarSetParameterLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
6.88 AlazarSetParameterUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
6.89 AlazarSetRecordCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
6.90 AlazarSetRecordSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
6.91 AlazarSetTriggerDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
6.92 AlazarSetTriggerOperation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
6.93 AlazarSetTriggerOperationForScanning . . . . . . . . . . . . . . . . . . . . . . . . 180
6.94 AlazarSetTriggerTimeOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
6.95 AlazarSleepDevice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
6.96 AlazarStartCapture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
6.97 AlazarTriggered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6.98 AlazarWaitAsyncBufferComplete . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6.99 AlazarWaitNextAsyncBufferComplete . . . . . . . . . . . . . . . . . . . . . . . . . 184

7 Board-Specific Information 187


7.1 Supported impedances and input ranges . . . . . . . . . . . . . . . . . . . . . . . 187
7.2 Samples per record requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.3 Samples per timestamp and trigger delay alignment . . . . . . . . . . . . . . . . 188
7.4 Aux I/O output Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

iii
7.5 Possible input channel configurations . . . . . . . . . . . . . . . . . . . . . . . . . 190
7.6 Supported sample rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
7.7 Miscellaneous features support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
7.8 External trigger level support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
7.9 Supported clock types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
7.10 Frequency limits for external clock types . . . . . . . . . . . . . . . . . . . . . . . 193
7.11 Valid frequencies in PLL mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

Index 195

iv
ATS-SDK Documenta on, Release 7.5.0

Note: This is the documentation for AlazarTech’s ATS-SDK version 7.5.0. Please visit our
documentation homepage to find documentation for other versions or products.

©2008-2021 Alazar Technologies Inc. 1


ATS-SDK Documenta on, Release 7.5.0

2 ©2008-2021 Alazar Technologies Inc.


CHAPTER

ONE

LICENSE AGREEMENT

Copyright (c) 2008-2021 Alazar Technologies Inc. All rights reserved.

1.1 Important

CAREFULLY READ THIS SOFTWARE LICENSE AGREEMENT. BY CLICKING THE APPLICA-


BLE BUTTON TO COMPLETE THE INSTALLATION PROCESS, YOU AGREE TO BE BOUND
BY THE TERMS OF THIS AGREEMENT. IF YOU DO NOT WISH TO BECOME A PARTY TO
THIS AGREEMENT AND BE BOUND BY ITS TERMS AND CONDITIONS, DO NOT INSTALL OR
USE THE SOFTWARE, AND RETURN THE SOFTWARE (WITH ANY ACCOMPANYING MEDIA)
WITHIN THIRTY (30) DAYS OF RECEIPT. ALL RETURNS TO ALAZAR TECHNOLOGIES INC.
(“ALAZARTECH”) WILL BE SUBJECT TO ALAZARTECH’S THEN-CURRENT POLICY. IF YOU
ARE ACCEPTING THESE TERMS ON BEHALF OF AN ENTITY, YOU AGREE THAT YOU HAVE
AUTHORITY TO BIND THE ENTITY TO THESE TERMS.

1.2 Ownership

AlazarTech retains the ownership of ATS-SDK software (“Software”). It is licensed to you


for use under the following conditions:

1.2.1 Grant of License

You may only concurrently use the Software on the computers that have an AlazarTech
waveform digitizer card plugged in (for example, if you have purchased one AlazarTech
card, you have a license for one concurrent usage). If the number of users of the Software
exceeds the number of AlazarTech cards you have purchased, you must have a reasonable
process in place to assure that the number of persons concurrently using the Software does
not exceed the number of AlazarTech cards purchased.
This license is non-transferable.

3
ATS-SDK Documenta on, Release 7.5.0

1.2.2 Restric ons

You may not copy the documentation or Software except as described in the installation
section of the Software manual. You may not distribute, rent, sub-lease or lease the Software
or documentation, including translating or decomposing. You may not modify, reverse-
engineer, decompile, or disassemble any part of the Software or documentation, or produce
any derivative work other than software applications that communicate with AlazarTech
hardware using the published Application Programming Interface (API).
You may not remove, block, or modify any titles, logos, trademarks, copyright and/or patent
notices, digital watermarks, disclaimers, or other legal notices that are included in the Soft-
ware.

1.2.3 Termina on

This license and your right to use this Software automatically terminates if you fail to com-
ply with any provision of this license agreement.

1.3 Rights

AlazarTech retains all rights not expressly granted. Nothing in this agreement constitutes
a waiver of AlazarTech’s rights under the Canadian and U.S. copyright laws or any other
Federal or State law.

1.4 Limited Warranty

Although AlazarTech has tested the Software and reviewed the documentation,
ALAZARTECH MAKES NO WARRANTY OF REPRESENTATION, EITHER EXPRESSED OR
IMPLIED, WITH RESPECT TO THIS SOFTWARE OR DOCUMENTATION, ITS QUALITY,
PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A
RESULT, THIS SOFTWARE AND DOCUMENTATION IS LICENSED “as is” AND YOU, THE
LICENSEE, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND PERFORMANCE. IN
NO EVENT WILL ALAZARTECH BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THIS
SOFTWARE OR DOCUMENTATION, even if advised of the possibility of such damages. In
particular, AlazarTech shall have no liability for any data acquired, stored or processed
with this Software, including the costs of recovering such data.
THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL
OTHERS, ORAL OR WRITTEN, EXPRESSED OR IMPLIED. No AlazarTech dealer, agent or em-
ployee is authorized to make any modifications or additions to this warranty.
Information in this document is subject to change without notice and does not represent
a commitment on the part of AlazarTech. The Software described in this document is fur-

4 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

nished under this license agreement. The Software may be used or copied only in accor-
dance with the terms of the agreement.
Some jurisdictions do not allow the exclusion of implied warranties or liability for inciden-
tal or consequential damages, so the above limitation or exclusion may not apply to you.
This warranty gives you specific legal rights, and you may also have other rights, which
vary from jurisdiction to jurisdiction.

©2008-2021 Alazar Technologies Inc. 5


ATS-SDK Documenta on, Release 7.5.0

6 ©2008-2021 Alazar Technologies Inc.


CHAPTER

TWO

GETTING STARTED

2.1 Introduc on

AlazarTech supplies device drivers for Windows and Linux that allow software to configure
AlazarTech digitizers, and transfer sample data from the digitizer to application buffers.
The AlazarTech software developer’s kit (ATS-SDK) includes header and library files re-
quired to call functions exported by these device drivers in user written applications, as
well as documentation and sample code describing how to use these functions.
This document is a part of the ATS-SDK. It describes how to call functions exported by
AlazarTech device drivers to control one or more digitizer boards. It is divided into the
following sections:
• A programming guide that describes how to configure, and acquire data from, digitizer
boards.
• A reference guide that describes the functions exported by the device drivers.
To get the most from your AlazarTech digitizer:
• Read the user manual supplied their digitizer board. It provides an overview of the
digitizer hardware, as well as detailed specifications.
• Read the “Programmer’s guide” section of this document. It describes how to program
the digitizer hardware to make an acquisition, and to transfer sample data into appli-
cation buffers.
• Browse the SDK sample programs. They include sample code that demonstrates how
to make many types of acquisitions supported by the digitizer.
Note that this document includes descriptions of board specific features and options that
may not be available on your digitizer board. Please refer your board’s user manual for its
specifications.

7
ATS-SDK Documenta on, Release 7.5.0

Document naviga on

This manual contains intra-document links. You will need a PDF viewer with “Previous
View” functionality to navigate through the manual with ease.
If you are opening this PDF manual with the built-in Mozilla® Firefox® PDF viewer, you
can right-click anywhere in the PDF window to access page navigation:

Otherwise, this PDF manual is best viewed using a PDF viewer with “Previous View” func-
tionality. If your preferred PDF viewer does not include this functionality, you may wish to
use one of the following1 options:
• Foxit® Reader: https://www.foxitsoftware.com/pdf-reader/ (available for Linux and
Windows)
• PDF Studio 2018: https://www.qoppa.com/pdfstudioviewer/download/ (available for
Linux and Windows)
• Adobe® Acrobat® Reader DC: https://get.adobe.com/reader/ (available for Windows)
If you are using Adobe Acrobat Reader, you will need to enable the Previous View and Next
View Page Navigation tools: Right-click on the top toolbar and go to Show Page Navigation
Tools, then select Previous View. Repeat the process for Next View.
1
This manual includes links to information created and maintained by other private and/or public orga-
nizations. Alazar Technologies Inc. (AlazarTech) provides these links solely for our users’ information and
convenience. AlazarTech does not control or guarantee the accuracy, relevance, or completeness of informa-
tion contained on a linked website. Furthermore, AlazarTech does not endorse these organizations or the views
they express or the products/services they offer. AlazarTech is not responsible for transmissions users receive
from linked websites, nor is it responsible for or liable in any way for commercial transactions which users
transact with linked websites.

8 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

2.2 Programming Environments

2.2.1 C/C++ Linux

C/C++ developers under Linux should include the following header files in source files that
use functions exported by the ATS-SDK library:

#include "AlazarError.h"
#include "AlazarApi.h"
#include "AlazarCmd.h"

These modules should also link against libATSApi.so.


The development package for Linux defaults to installing the header files in
/usr/local/AlazarTech/include, and the library files in the standard library directory
for the target distribution.

2.2.2 C/C++ Windows

C/C++ developers should include the following header files in source files that use functions
exported by the API library:

#include "AlazarError.h"
#include "AlazarApi.h"
#include "AlazarCmd.h"

These applications should also link against the 32- or 64-bit version of ATSApi.lib, as re-
quired.

©2008-2021 Alazar Technologies Inc. 9


ATS-SDK Documenta on, Release 7.5.0

The SDK setup program installs the header files in “Samples_C\Include”, and the library files
in “Samples_C\Library”.

2.2.3 C#

C# developers should either:


• Add the file AlazarApi.cs to their project; or
• Add a reference to AlazarApiNet.dll to their project.
The ATS-SDK includes a wrapper class that declares many of the constants and unmanaged
functions exported by AlazarTech device drivers. This class is provided both as a C# source
file (AlazarApi.cs), and as a compiled assembly (AlazarApiNet.dll).
The SDK setup program copies AlazarApi.cs to the “Sam-
ples_CSharp\AlazarApiNet\AlazarApiNet” directory and AlazarApiNet.dll to the “Sam-
ples_CSharp” directory.
Note that you can use the solution “Samples_CSharp\AlazarApiNet” to build AlazarAp-
iNet.dll from AlazarApi.cs.

2.2.4 LabVIEW

LabVIEW developers can either:


• Use the sub-VIs provided with the ATS-SDK (recommended)
• Call functions from ATSApi.dll directly using the LabVIEW interface for shared li-
braries.
The ATS-SDK sub-VIs consists of a very thin wrapper on top of the functions exported by
the ATS-SDK. The VIs are named after the functions that they wrap. They are located
in “Samples_LabVIEW\Library”, and are used by all the code samples available in “Sam-
ples_LabVIEW”.
The only difference between the connector panes of the VIs and the C function signatures
is that an error cluster is propagated through the VIs. If the input error cluster contains an
error, the VI simply returns without doing anything.
The error cluster output depends on the function:
• If the function does not generate errors, the input error cluster is simply propagated
to the output.
• If the function returns an error code, it is converted to a cluster and send to the output
• If the function can return errors using special return values, then these errors are
detected by the VI, an appropriate error code is generated, converted to a cluster and
sent to the output

10 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

2.2.5 Python

Python developers can use the atsapi.py module provided in the “Samples_Python\Library”
directory. It provides a very thin wrapper around the AlazarTech C/C++ API, with only mi-
nor differences:
• The ‘Alazar’ prefixes have been removed from the function names, and the first letter
is not capitalized. For example, ‘AlazarAbortAsyncRead’ becomes ‘abortAsyncRead’.
• Board handles have been removed. Instead, a Board class has been added. All the
functions that take a board handle as a parameter are moved to being member func-
tions of the Board class.
• A DMABuffer convenience class has been added, that takes care of memory allocation
of DMA transfers.
• Some functions of the API use return parameters to give back to the caller primitive
types. In Python, the signature of these functions is changed so that the return param-
eters are replaced with return types.

2.2.6 MATLAB

MATLAB developers should use the functions provided in “Samples_MATLAB/Include” to


call functions from the ATSApi DLL. There is a one to one mapping between MATLAB and
C ATSApi functions, but the arguments and return values differ in the following ways:
1. MATLAB functions do not return error codes, instead, they throw exceptions if the
return code of the associated C function is not ApiSuccess. For example, a C program
that wants to call the AlazarStartCapture() function should be written like so:
RETURN_CODE rc = AlazarStartCapture(boardHandle);
if (rc != ApiSuccess) {
// TODO: handle error (e.g. return a failure code).
}

By opposition, a MATLAB program that wishes to call the same function should simply
use the following at the call site:
AlazarStartCapture(boardHandle);

Note that because this function will throw in case of an error, it is necessary for the
MATLAB program to include exception handling code higher in the call stack if termi-
nating upon error is not acceptable.
2. Output parameters in C functions are return values in their MATLAB equivalents.
Here is how AlazarGetChannelInfo() can be called from a C program:
U32 memorySize = 0;
U32 bitsPerSample = 0;
RETURN_CODE rc = AlazarGetChannelInfo(boardHandle,
&memorySize,
(continues on next page)

©2008-2021 Alazar Technologies Inc. 11


ATS-SDK Documenta on, Release 7.5.0

(continued from previous page)


&bitsPerSample);
if (rc != ApiSuccess) {
// TODO: handle error (e.g. return a failure code).
}

By contrast, here is the same function call in a MATLAB program:

[memorySizeInSamples, bitsPerSample] = AlazarGetChannelInfo(boardHandle)

3. In C programs, arrays are always allocated by the user code, and are passed as a pair
of arguments (a pointer and a size). In MATLAB, arrays are passed to or returned from
functions by value instead.
This change significantly simplifies some function calls. For example, here is how to
generate a window function in a C program:

U32 windowType = ...;


U32 windowLength = ...;
U32 paddingLength = ...;
float* window = (float*) malloc(windowLength + paddingLength, sizeof(float));
if (!window) {
// TODO: handle error
}
RETURN_CODE rc AlazarDSPGenerateWindowFunction(windowType,
window,
windowLength,
paddingLength);
if (rc != ApiSuccess) {
// TODO: handle error (e.g. return a failure code).
}

Here is how to generate this function from MATLAB:

windowType = ...;
windowLength = ...;
paddingLength = ...;
window = AlazarDSPGenerateWindowFunction(windowType,
windowLength,
paddingLength);

Note: This change does not apply to DMA buffers. For performance reasons (to avoid
costly copies), buffers are passed by reference in MATLAB functions.

12 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

2.2.7 C++/CLI

C++/CLI programmers should include a reference to “Samples_CSharp\AlazarApiNet.dll” in


their solutions. This assembly provides a .NET interface to the functions and constants
defined in the ATS-SDK.
The ATS-SDK does not currently include C++/CLI sample code. See the C# samples for .NET
sample code.

2.3 Sample code

ATS-SDK includes sample programs that demonstrate how to configure and acquire data
from AlazarTech digitizers.
The SDK setup program installs the sample programs to “C:\AlazarTech\ATS-
SDK\%API_VERSION%” under Microsoft Windows, and “/usr/local/AlazarTech” under
Linux. See the “ReadMe.htm” file in the ATS-SDK base directory for a description of the
samples included.
Sample programs are available for the following programming environments in the follow-
ing sub-directories:

Language Sub-directory
C/C++ Samples_C
C# Samples_CSharp
MATLAB Samples_MATLAB
LabVIEW Samples_LabVIEW
Python Samples_Python

Note: Note that the sample programs contain many parameters that should be modified.
These lines of code are preceded by “TODO” comments. Please search for these lines and
modify them as required for your application.

Warning: Many sample programs require a trigger input. These sample programs
configure a board to trigger when a signal connected to its CH A rises through 0V. Before
running these samples, connect a 1 kHz sine waveform of amplitude about 90% of the
board’s input range from a function generator to the CH A connector, or modify trigger
parameters as required. For example, the ATS9360 has an input range of +/- 400 mV. For
this board, a sine wave of 700 mVpp is appropriate. If an appropriate trigger signal is
not supplied, these samples will fail with an acquisition timeout error.

©2008-2021 Alazar Technologies Inc. 13


ATS-SDK Documenta on, Release 7.5.0

2.4 Contac ng us

Contact us if you have any questions or comments about this document, or the sample code.

Web https://www.alazartech.com/
Email support@alazartech.com
Phone +1-514-426-4899
Fax +1-514-426-2723
Mail

Alazar Technologies Inc.


6600 Trans-Canada Highway, Suite 310
Pointe-Claire, QC
Canada H9R 4S2

Note that you can download the latest drivers and documentation from our web site.
https://www.alazartech.com/Support/Downloads

14 ©2008-2021 Alazar Technologies Inc.


CHAPTER

THREE

PROGRAMMER’S GUIDE

3.1 Addressing a board

3.1.1 Ge ng a board iden fier

AlazarTech organizes its digitizer boards into “board systems”. A board system is a group
of one or more digitizer boards that share trigger and clock signals. To create a “board
system” comprised of two or more boards, the boards need to be connected together using
an AlazarTech SyncBoard. All of the channels in a board system trigger and are sampled
simultaneously.
ATS-SDK assigns a “system identifier” number to each board system. The first system de-
tected is assigned system ID number of 1. In addition, a “board identifier” number is as-
signed to each board in a board system. This number uniquely identifies a board within its
board system.
• If a digitizer board is not connected to any other boards using a SyncBoard, then the
SDK assigns it a board ID of 1.
• If two or more boards are connected together using a SyncBoard, then the SDK as-
signs each board an ID number that depends on how the board is connected to the
SyncBoard. The board connected to the “master” slot on the SyncBoard is the master
board in the board system and is assigned a board ID number of 1.
Call the AlazarNumOfSystems() function to determine the number of board systems detected
by the SDK, and call the AlazarBoardsInSystemBySystemID() function to determine the num-
ber of boards in the board system specified by its system identifier. The following code
fragment lists the system and board identifiers of each board detected by the device drivers:

U32 systemCount = AlazarNumOfSystems();


for (U32 systemId = 1; systemId <= systemCount; systemId++) {
U32 boardCount = AlazarBoardsInSystemBySystemID(systemId);
for (U32 boardId = 1; boardId <= boardCount; boardId++) {
printf("Found SystemID %u Board ID = %u\\n", systemId, boardId);
}
}

15
ATS-SDK Documenta on, Release 7.5.0

3.1.2 Ge ng a board handle

ATS-SDK associates a handle with each digitizer board. Most functions require a board
handle as a parameter. For example, the AlazarSetLED() function allows an application to
control the LED on the PCI/PCIe mounting bracket of a board specified by its handle.
Use the AlazarGetBoardBySystemID() API function to get a handle to a board specified by its
system identifier and board identifier numbers.

Single board installa ons

If only one board is installed in a computer, ATS-SDK assigns it system ID 1 and board ID 1.
The following code fragment gets a handle to such a board, and uses this handle to toggle
the LED on the board’s PCI/PCIe mounting bracket:

// Select a board
U32 systemId = 1;
U32 boardId = 1;

// Get a handle to the board


HANDLE boardHandle = AlazarGetBoardBySystemID(systemId, boardId);

// Toggle the LED on the board’s PCI/PCIe mounting bracket


AlazarSetLED(boardHandle, LED_ON);
Sleep(500);
AlazarSetLED(boardHandle, LED_OFF);

Mul ple board installa ons

If more than one board is installed in a PC, the boards are organized into board systems, and
are assigned system and board identifier numbers. The following code fragment demon-
strates how to obtain a handle to each board in such an installation, and use the handle to
toggle the LED on the board’s PCI/PCIe mounting bracket:

U32 systemCount = AlazarNumOfSystems();


for (U32 systemId = 1; systemId <= systemCount; systemId++) {
U32 boardCount = AlazarBoardsInSystemBySystemID(systemId);
for (U32 boardId = 1; boardId <= boardCount; boardId++) {
printf("SystemID %u Board ID = %u\\n", systemId, boardId);

// Get a handle to the board


HANDLE handle = AlazarGetBoardBySystemID(systemId, boardId);

// Toggle the LED on the board’s PCI/PCIe mounting bracket


AlazarSetLED(handle, LED_ON);
Sleep(500);
AlazarSetLED(handle, LED_OFF);
}
}

16 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

System handles

Several ATS-SDK functions require a “system handle”. A system handle is the handle of the
master board in a board system.
• If a board is not connected to other boards using a SyncBoard, then its board handle
is the system handle.
• If a board is connected to other boards using a SyncBoard, then the board that is con-
nected to the master connector on the SyncBoard is the master board, and its board
handle is the system handle.

3.1.3 Closing a board handle

ATS-SDK maintains a list of board handles in order to support master-slave board systems.
The SDK creates board handles when it is loaded into memory, and destroys these handles
when it is unloaded from memory. An application should not need to close a board handle.

3.1.4 Using a board handle

ATS-SDK includes a number of functions that return information about a board specified
by its handle. These functions include:
AlazarGetBoardKind() Get a board’s model from its handle.
AlazarGetChannelInfo() Get the number of bits per sample, and on-board memory size in
samples per channel.
AlazarGetCPLDVersion() Get the CPLD version of a board.
AlazarGetDriverVersion() Get the driver version of a board.
AlazarGetParameter() Get a board parameter as a signed 32-bit value.
AlazarGetParameterUL() Get a board parameter as an unsigned 32-bit value.
AlazarQueryCapability() Get a board capability as an unsigned 32-bit value.
The sample program “%ATS_SDK_DIR%\Samples\AlazarSysInfo” demonstrates how get a
board handle and use it to obtain board properties. The API also exports functions that use
a board handle to configure a board, arm it to make an acquisition, and transfer sample data
from the board to application buffers. These topics are discussed in the following sections.

©2008-2021 Alazar Technologies Inc. 17


ATS-SDK Documenta on, Release 7.5.0

3.2 Rese ng a board

The ATS-SDK resets all digitizer boards during its initialization procedure. This initializa-
tion procedure automatically runs when the API library is loaded into memory.
• If an application statically links against the API library, the API resets all boards when
the application is launched.
• If an application dynamically loads the API library, the API resets all boards when the
application loads the API into memory.

Warning: Note that when an application using the API is launched, all digitizer boards
are reset. If one application using the API is running when a second application using
the API is launched, configuration settings written by the first application to a board may
be lost. If a data transfer between the first application and a board was in progress, data
corruption may occur.

3.3 Configuring a board

Before acquiring data from a board system, an application must configure the timebase,
analog inputs, and trigger system settings of each board in the board system.

3.3.1 Timebase

The timebase of the ADC converters on AlazarTech digitizer boards may be supplied by:
• Its on-board oscillators.
• A user supplied external clock signal.
• An on-board PLL clocked by a user supplied 10 MHz reference signal.

Internal clock

To use on-board oscillators as a timebase, call AlazarSetCaptureClock() specifying INTER-


NAL_CLOCK as the clock source identifier, and select the desired sample rate with a sample
rate identifier appropriate for the board. The following code fragment shows how to select
a 10 MS/s internal sample rate:

AlazarSetCaptureClock(handle, // HANDLE -- board handle


INTERNAL_CLOCK, // U32 -- clock source Id
SAMPLE_RATE_10MSPS, // U32 -- sample rate Id or value
CLOCK_EDGE_RISING, // U32 -- clock edge Id
0 // U32 -- decimation
);

18 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

See AlazarSetCaptureClock() or the board reference manual for a list of sample rate identi-
fiers appropriate for a board.

External clock

AlazarTech boards optionally support using a user-supplied external clock signal input to
the ECLK connector on its PCI/PCIe mounting bracket to clock its ADC converters.
To use an external clock signal as a timebase, call AlazarSetCaptureClock() specifying SAM-
PLE_RATE_USER_DEF as the sample rate identifier, and select a clock source identifier appro-
priate for the board model and the external clock properties. The following code fragment
shows how to configure an ATS460 to acquire at 100 MS/s with a 100 MHz external clock:
AlazarSetCaptureClock(handle, // HANDLE -- board handle
FAST_EXTERNAL_CLOCK, // U32 -- clock source Id
SAMPLE_RATE_USER_DEF, // U32 -- sample rate Id or value
CLOCK_EDGE_RISING, // U32 -- clock edge Id
0 // U32 -- decimation
);

See the board reference manual for the properties of an external clock signal that are appro-
priate for a board, and AlazarSetCaptureClock() for a list of external clock source identifiers.

External clock level

Some boards allow adjusting the comparator level of the external clock input receiver to
match the receiver to the clock signal supplied to the ECLK connector. If necessary, call
AlazarSetExternalClockLevel() to set the relative external clock input receiver comparator
level, in percent.
AlazarSetExternalClockLevel( handle, // HANDLE –- board handle
level_percent, // float –- external clock level in percent );

10 MHz PLL

Some boards can generate a timebase from an on-board PLL clocked by user supplied ex-
ternal 10 MHz reference signal input to its ECLK connector.

ATS660

In 10 MHz PLL external clock mode, the ATS660 can generate a sample clock between 110
and 130 MHz, in 1 MHz, steps from an external 10 MHz reference input. Call AlazarSetCap-
tureClock() specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source identifier, the desired
sample rate between 110 and 130 MHz in 1 MHz steps, and a decimation factor of 1 to
100000. Note that the decimation value should be one less than the desired decimation fac-
tor. The following code fragment shows how to generate a 32.5 MS/s sample rate (130 MHz
/ 3) from a 10 MHz PLL external clock input:

©2008-2021 Alazar Technologies Inc. 19


ATS-SDK Documenta on, Release 7.5.0

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
130000000, // U32 �- sample rate Id or value
CLOCK_EDGE_RISING, // U32 �- clock edge Id
2 // U32 �- decimation value
);

ATS9325

In 10 MHz PLL external clock mode, the ATS9325 generates a 500 MHz sample clock from
an external 10 MHz reference input. The 500 MS/s sample data can be decimated by a factor
of 2, 4, or any multiple of 5.
Call AlazarSetCaptureClock() specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source and
500 MHz as the sample rate, and select a decimation factor of 2, 4, or any multiple of 5, up
to 100000. For example, the following code fragment shows how to generate a 100 MS/s
sample rate (500 MHz / 5) from a 10 MHz external clock input:

AlazarSetCaptureClock(
handle, // HANDLE -- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 -- clock source Id
500000000, // U32 -- sample rate Id
CLOCK_EDGE_RISING, // U32 -- clock edge Id
5 // U32 -- decimation
);

ATS9350/ATS9351/ATS9352/ATS9353

In 10 MHz PLL external clock mode, the ATS9350, ATS9351, ATS9352 and ATS9553 generate a
500 MHz sample clock from an external 10 MHz reference input. The 500 MS/s sample data
can be decimated by a factor of 1, 2, 4, or any multiple of 5. Call AlazarSetCaptureClock()
specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source and 500 MHz as the sample rate,
and select a decimation factor of 1, 2, 4, or any multiple of 5 up to 100000. For example, the
following code fragment shows how to generate a 100 MS/s sample rate (500 MHz / 5) from
a 10 MHz external clock input:

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
500000000, // U32 �- sample rate Id
CLOCK_EDGE_RISING, // U32 �- clock edge Id
5 // U32 �- decimation
);

20 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

ATS9360

In 10 MHz PLL external clock mode, the ATS9360 can generate any sample clock frequency
between 300 MHz and 1800 MHz that is a multiple of 1 MHz. Call AlazarSetCaptureClock()
specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source identifier, the desired sample rate
between 300 MS/s and 1800 MS/s, and 1 as the decimation ratio. The sample rate must be
a multiple of 1 MHz. For example, the following code fragment shows how to generate a
1.382 GS/s sample clock from a 10 MHz reference:

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
1382000000, // U32 �- sample rate
CLOCK_EDGE_RISING, // U32 �- clock edge Id
1 // U32 �- decimation
);

ATS9371

In 10 MHz PLL external clock mode, the ATS9371 can generate any sample clock frequency
between 300 MHz and 1000 MHz that is a multiple of 1 MHz. Call AlazarSetCaptureClock()
specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source identifier, the desired sample rate
between 300 MS/s and 1000 MS/s, and 1 as the decimation ratio. The sample rate must be a
multiple of 1 MHz. For example, the following code fragment shows how to generate a 882
MS/s sample clock from a 10 MHz reference:

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
882000000, // U32 �- sample rate
CLOCK_EDGE_RISING, // U32 �- clock edge Id
1 // U32 �- decimation
);

ATS9373

In 10 MHz PLL external clock mode, the ATS9373 can generate any sample clock frequency
between 500 MHz and 2000 MHz that is a multiple of 1 MHz in either single or dual channel
mode. In addition, it can generate any sample clock frequency between 2000 MHz and 4000
MHz that is a multiple of 2 MHz in single channel mode.
Call AlazarSetCaptureClock() specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source iden-
tifier, the desired sample rate between 300 MS/s and 4000 MS/s, and 1 as the decimation
ratio. The sample rate must be a multiple of 1 MHz in dual channel if the frequency is less
than or equal to 2000 MHz, and a multiple of 2 MHz if the frequency is above 2000 MHz.
For example, the following code fragment shows how to generate a 1.382 GS/s sample clock
from a 10 MHz reference:

©2008-2021 Alazar Technologies Inc. 21


ATS-SDK Documenta on, Release 7.5.0

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
1382000000, // U32 �- sample rate
CLOCK_EDGE_RISING, // U32 �- clock edge Id
1 // U32 �- decimation
);

ATS9440

In 10 MHz PLL external clock mode, the ATS9440 can generate either a 125 MHz or 100 MHz
sample clock from an external 10 MHz reference input. The 125 MS/s or 100 MS/s sample
data can be decimated by a factor of 2, 4, or any multiple of 5.
Call AlazarSetCaptureClock() specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source either
125 MHz or 100 MHz as the sample rate, and select a decimation radio between 1 and
100000. For example, the following code fragment shows how to generate a 25 MS/s sample
rate (125 MHz / 5) from a 10 MHz external clock input:

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
125000000, // U32 �- sample rate Id
CLOCK_EDGE_RISING, // U32 �- clock edge Id
5 // U32 �- decimation
);

ATS9462

In 10 MHz PLL external clock mode, the ATS9462 can generate a sample clock between 150
and 180 MHz in 1 MHz steps from an external 10 MHz reference input. Sample data can be
decimated by a factor of 1 to 100000.
Call AlazarSetCaptureClock() specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source, the
desired sample rate between 150 and 180 MHz in 1 MHz steps, and the decimation factor of
1 to 100000. Note that the decimation value should be one less than the desired decimation
factor. For example, the following code fragment shows how to generate a 15 MS/s sample
rate (150 MHz / 10) from a 10 MHz external clock input:

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
150000000, // U32 �- sample rate Id or value
CLOCK_EDGE_RISING, // U32 �- clock edge Id
9 // U32 �- decimation value
);

22 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

ATS9625/ATS9626

In 10 MHz PLL external clock mode, the ATS9625/ATS9626 can generate a 250 MHz sample
clock from an external 10 MHz reference input. Sample data can be decimated by a factor
of 1 to 100000.
Call AlazarSetCaptureClock() specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source, 250
MHz has the sample rate value, and a decimation ratio of 1 to 100000. For example, the
following code fragment shows how to generate a 25 MS/s sample rate (250 MHz / 10) from
a 10 MHz external clock input:

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
250000000, // U32 �- sample rate Id or value
CLOCK_EDGE_RISING, // U32 �- clock edge Id
10 // U32 �- decimation value
);

ATS9850

In 10 MHz PLL external clock mode, the ATS9850 generates a 500 MHz sample clock from
an external 10 MHz reference input. The 500 MS/s sample data can be decimated by a factor
of 1, 2, 4, or any multiple of 10.
Call AlazarSetCaptureClock() specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source and
500 MHz as the sample rate value, and a decimation of 1, 2, 4, or any multiple of 10 up
to 100000. For example, the following code fragment shows how to generate a 125 MS/s
sample rate (500 MHz / 4) from a 10 MHz external clock input:

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
500000000, // U32 �- sample rate Id or value
CLOCK_EDGE_RISING, // U32 �- clock edge Id
4 // U32 �- decimation value
);

ATS9870

In 10 MHz PLL external clock mode, the ATS9870 generates a 1 GHz sample clock from an
external 10 MHz reference input. The 1 GS/s sample data can be decimated by a factor of 1,
2, 4, or any multiple of 10.
Call AlazarSetCaptureClock() specifying EXTERNAL_CLOCK_10MHZ_REF as the clock source and 1
GHz as the sample rate value, and a decimation of 1, 2, 4, or any multiple of 10 up to 100000.
For example, the following code fragment shows how to generate a 250 MS/s sample rate (1
GHz / 4) from a 10 MHz external clock input:

©2008-2021 Alazar Technologies Inc. 23


ATS-SDK Documenta on, Release 7.5.0

AlazarSetCaptureClock(
handle, // HANDLE �- board handle
EXTERNAL_CLOCK_10MHZ_REF, // U32 �- clock source Id
1000000000, // U32 �- sample rate Id or value
CLOCK_EDGE_RISING, // U32 �- clock edge Id
4 // U32 �- decimation value
);

3.3.2 Input control

AlazarTech digitizers have analog amplifier sections that process the signals input to its
analog input connectors before they are sampled by its ADC converters. The gain, coupling,
and termination of the amplifier sections should be configured to match the properties of
the input signals.

Input range, coupling, and impedance

Call AlazarInputControl() to specify the desired input range, termination, and coupling of
an input channel. The following code fragment configures input CH A for a range of ±800
mV, DC coupling, and 50Ω termination:

AlazarInputControl(
boardHandle, // HANDLE -- board handle
CHANNEL_A, // U8 -- input channel
DC_COUPLING, // U32 -- input coupling id
INPUT_RANGE_PM_800_MV, // U32 -- input range id
IMPEDANCE_50_OHM // U32 -- input impedance id
);

See AlazarInputControl() and the board reference manual for a list of input range, coupling,
and impedance identifiers appropriate for the board.

Bandwidth filter

Some digitizers have a low pass filters that attenuate signals above about 20 MHz. By de-
fault, these filters are disabled. Call AlazarSetBWLimit() to enable or disable the bandwidth
limit filter. The following code fragment enables the CH A bandwidth limit filter:

AlazarSetBWLimit (
boardHandle, // HANDLE -- board handle
CHANNEL_A, // U32 -- channel identifier
1 // U32 -- 0 = disable, 1 = enable
);

24 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Amplifier bypass

Some digitizer models support “amplifier bypass” mode. In this mode, the analog signal
supplied to an input connector is connected directly the ADC driver of that channel, by-
passing its amplifier section. Amplifier bypass mode must be enabled in hardware either
through DIP switches on the board, or as a factory option. Once enabled in hardware, the
following code fragment shows how to configure this option in software:

AlazarInputControl(
handle, // HANDLE -- board handle
CHANNEL_A, // U8 -- input channel
DC_COUPLING, // U32 �- not used
INPUT_RANGE_HI_FI, // U32 -- input range id
IMPEDANCE_50_OHM // U32 �- not used
);

Note that when amplifier bypass mode option is enabled for an input channel, the channel’s
full-scale input range is fixed. The following table lists the nominal full-scale input range
values that may be used to convert sample code values to volts.

Model Full scale input range


ATS460 ± 525 mV
ATS660 ± 550 mV
ATS9325/ATS9350 ± 200 mV
ATS9351 ± 400 mV
ATS9462 ± 550 mV
ATS9850/ATS9870 ± 256 mV

See your board’s hardware reference manual for more information about using amplifier
bypass.

3.3.3 Trigger control

AlazarTech digitizer boards have a flexible triggering system with two separate trigger en-
gines that can be used independently, or combined together to generate trigger events.

Warning: As opposed to what earlier documentation mentioned, the only way to com-
bine trigger events is with the OR operator.

©2008-2021 Alazar Technologies Inc. 25


ATS-SDK Documenta on, Release 7.5.0

AlazarSetTriggerOpera on

Use the AlazarSetTriggerOperation() API function to configure each of the two trigger en-
gines, and to specify how they should be used to make the board trigger:

RETURN_CODE
AlazarSetTriggerOperation (
HANDLE handle,
U32 TriggerOperation,
U32 TriggerEngineId1,
U32 SourceId1,
U32 SlopeId1,
U32 Level1,
U32 TriggerEngineId2,
U32 SourceId2,
U32 SlopeId2,
U32 Level2
);

The following paragraphs describe each of the function’s parameters, and provide examples
showing how to use the function.

Trigger engine

The trigger engine identifier parameter specifies which of the two trigger engines you wish
to configure. The parameter may have one of the following values:
TRIG_ENGINE_J Configure trigger engine J
TRIG_ENGINE_K Configure trigger engine K

Data source

The data source identifier parameter selects the where the specified trigger engine should
get its data. Refer to the documentation of the AlazarSetTriggerOperation() function for a
list of all possible values.

Trigger slope

The trigger slope identifier parameter selects whether rising or falling edges of the trigger
source are detected as trigger events.
TRIGGER_SLOPE_POSITIVE The trigger engine detects a trigger event when sample values from
the trigger source rise above a specified level.
TRIGGER_SLOPE_NEGATIVE The trigger engine detects a trigger event when sample values from
the trigger source fall below a specified level.

26 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Trigger level

The trigger level parameter sets the level that the trigger source must rise above, or fall
below, for the selected trigger engine to become active. The trigger level is specified as an
unsigned 8-bit code that represents a fraction of the full-scale input range of the trigger
source; 0 represents the negative full-scale input, 128 represents a 0-volt input, and 255
represents the positive full-scale input. For example, if the trigger source is CH A, and the
CH A input range is ± 800 mV, then 0 represents a –800 mV trigger level, 128 represents a 0
V trigger level, and 255 represents +800 mV trigger level.
In general, the trigger level value is given by:

TriggerLevelCode = 128 + 127 * TriggerLevelVolts / InputRangeVolts.

The following table gives examples of how trigger level codes map to trigger levels in volts
according to the full-scale input range of the trigger source.

Code Frac on of input range Level with ±1 V range Level with ±5 V range
0 -100% -1V -5V
64 -50% -500 mV -2.5 V
96 -25% -250 mV -1.25 V
128 0% 0V 0V
160 +25 % 250 mV 1.25 V
192 +50% +500 mV +2.5 V
255 +100% +1V +5V

Trigger opera on

Finally, the trigger operation identifier specifies how the trigger events detected by the trig-
ger engines are combined to make the board trigger. Possible values are:
TRIG_ENGINE_OP_J The board triggers when trigger engine J detects a trigger event. Events
detected by engine K are ignored.
TRIG_ENGINE_OP_K The board triggers when trigger engine K detects a trigger event. Events
detected by engine J are ignored.
TRIG_ENGINE_OP_J_OR_K The board triggers when a trigger event is detected by any of trigger
engines J and K.

©2008-2021 Alazar Technologies Inc. 27


ATS-SDK Documenta on, Release 7.5.0

AlazarSetTriggerOpera on examples

The following code fragment configures a board to trigger when the signal connected to CH
A rises above 0V. This example only uses trigger engine J:

AlazarSetTriggerOperation(
handle, // HANDLE -- board handle
TRIG_ENGINE_OP_J, // U32 -- trigger operation
TRIG_ENGINE_J, // U32 -- trigger engine id
TRIG_CHAN_A, // U32 -- trigger source id
TRIGGER_SLOPE_POSITIVE, // U32 -- trigger slope id
128, // U32 -- trigger level (128 = 0V)
TRIG_ENGINE_K, // U32 -- trigger engine id
TRIG_DISABLE, // U32 -- trigger source id for engine K
TRIGGER_SLOPE_POSITIVE, // U32 -- trigger slope id
128 // U32 -- trigger level (0 � 255)
);

The following code fragment configures a board to trigger when the signal connected to CH
B rises above 500 mV, or falls below -200 mV, if CH B’s input range is ±1V. This example uses
both trigger engine J and K:

double inputRange_volts = 1.; // ±1V range


double TriggerLevelJ_volts = .5; // +500 mV trigger level
U32 triggerLevelJ = (U32)(128 + 127 * triggerLevelJ_volts / inputRange_volts);
double triggerLevelK_volts = -.2; // -200 mV trigger level
U32 triggerLevelK = (U32)(128 + 127 * triggerLevelK_volts / inputRange_volts);
AlazarSetTriggerOperation(
handle, // HANDLE -- board handle
TRIG_ENGINE_OP_J_OR_K, // U32 -- trigger operation
TRIG_ENGINE_J, // U32 -- trigger engine id
TRIG_CHAN_B, // U32 -- trigger source id
TRIGGER_SLOPE_POSITIVE, // U32 -- trigger slope id
triggerLevelJ, // U32 -- trigger level from 0 to 255
TRIG_ENGINE_K, // U32 -- trigger engine id
TRIG_CHAN_B, // U32 -- trigger source id for engine K
TRIGGER_SLOPE_NEGATIVE, // U32 -- trigger slope id
triggerLevelK, // U32 -- trigger level from 0 to 255
);

External trigger

AlazarTech digitizer boards can trigger on a signal connected to its TRIG IN connector. To
use an external trigger input:
• Call AlazarSetTriggerOperation() with TRIG_EXTERNAL as the trigger source identifier of
at least one of the trigger engines; and
• Call AlazarSetExternalTrigger() to select the range and coupling of the external trigger
input.

28 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

The following code fragment configures a board to trigger when the signal connected to the
TRIG IN falls below +2 V, assuming the signal’s range is less than ± 5V with DC coupling:

// Calculate the trigger level code from the level and range
double triggerLevel_volts = 2.; // trigger level
double triggerRange_volts = 5.; // input range
U32 triggerLevel_code =
(U32)(128 + 127 * triggerLevel_volts / triggerRange_volts);

// Configure trigger engine J to generate a trigger event


// on the falling edge of an external trigger signal.
AlazarSetTriggerOperation(
handle, // HANDLE -- board handle
TRIG_ENGINE_OP_J, // U32 -- trigger operation
TRIG_ENGINE_J, // U32 -- trigger engine id
TRIG_EXTERNAL, // U32 -- trigger source id
TRIGGER_SLOPE_NEGATIVE, // U32 -- trigger slope id
triggerLevel, // U32 -- trigger level (0 � 255)
TRIG_ENGINE_K, // U32 -- trigger engine id
TRIG_DISABLE, // U32 -- trigger source id for engine K
TRIGGER_SLOPE_POSITIVE, // U32 -- trigger slope id
128 // U32 -- trigger level (0 � 255)
);

// Configure the external trigger input to +/-5V range,


// with DC coupling
AlazarSetExternalTrigger(
handle, // HANDLE -- board handle
DC_COUPLING, // U32 -- coupling id
ETR_5V // U32 -- external range id
);

Trigger meout

AlazarTech digitizer boards can be configured to automatically trigger when the board is
waiting for a trigger event, but no trigger events arrive after a specified time interval. This
behavior is similar to the “automatic” trigger mode of oscilloscopes, and may be useful to
capture waveforms when trigger conditions are unknown. Call AlazarSetTriggerTimeOut()
to specify the amount of time that a board should wait for a hardware trigger event before
automatically generating a software trigger event and, as a result, acquiring one record.

Note: The trigger timeout value should be set to zero once stable trigger parameters have
been found. Otherwise, a board may generate unexpected trigger events if the trigger time-
out interval expires before a hardware trigger event occurs.

The following code fragment configures a board to automatically trigger and acquire one
record if it does not receive a trigger event after some time:

©2008-2021 Alazar Technologies Inc. 29


ATS-SDK Documenta on, Release 7.5.0

AlazarSetTriggerTimeOut(
boardHandle, // HANDLE -- board handle
1000 // U32 -- Timeout in ticks
);

The following code fragment configures a board to wait forever for trigger events:

AlazarSetTriggerTimeOut(
boardHandle, // HANDLE -- board handle
0 // U32 -- timeout in ticks
);

Trigger delay

An AlazarTech digitizer board can be configured to wait for a specified amount of time after
it receives a trigger event before capturing a record for the trigger. Call AlazarSetTriggerDe-
lay() to specify a time, in sample clock periods, to wait after receiving a trigger event for a
record before capturing samples for that record. The following code fragment shows how
to set a trigger delay of 1 ms, given a sample rate of 100 MS/s:

double triggerDelay_sec = 1.e-3; // 1 ms


double samplesPerSec = 100.e6; // 100 MS/s
U32 triggerDelay_samples =
(U32)(triggerDelay_sec * samplesPerSec + 0.5);
AlazarSetTriggerDelay(
boardHandle, // HANDLE -- board handle
triggerDelay_samples // U32 -- trigger delay in samples
);

3.3.4 AUX I/O

AlazarTech digitizer boards with an AUX I/O connector can be configured to supply a
5V TTL-level output signal, or to receive a TTL-level input signal on this connector. Use
AlazarConfigureAuxIO() to configure the function of the AUX I/O connector.
The ATS9440 has two AUX I/O connectors: AUX I/O 1 and AUX I/O 2. AUX I/O 1 is configured
by firmware as a trigger output signal, while AUX I/O 2 is configured by software using
AlazarConfigureAuxIO(). A custom FPGA is required to change the operation of AUX I/O 1.
The ATS9625 and ATS9626 have two AUX I/O connectors: AUX1 and AUX2. AUX1 is config-
ured by software using AlazarConfigureAuxIO(), while AUX2 is configured by the main FPGA
as a trigger output signal by default. AUX2 can be controlled by its user-programmable
FPGA as desired by the FPGA designer.

30 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Trigger output

The AUX I/O connector can be configured to supply a trigger output signal, where the edge
of the trigger output signal is synchronized with the edge of the sample clock. Note that
this is the default power-on mode for the AUX I/O connector. The following code fragment
configures the AUX I/O connector as a trigger output signal:

AlazarConfigureAuxIO(
handle, // HANDLE -- board handle
AUX_OUT_TRIGGER, // U32 -- mode
0 // U32 -- parameter
);

Pacer output

The AUX I/O connector can be configured to output the sample clock divided by a pro-
grammable value. This option may be used to generate a clock signal synchronized with
the sample clock of the digitizer board. The following code fragment generates a 10 MHz
signal on an AUX I/O connector, given a sample rate of 180 MS/s:

AlazarConfigureAuxIO(
handle, // HANDLE -- board handle
AUX_OUT_PACER, // U32 -- mode
18 // U32 �- sample clock divider
);

Note that the sample rate divider value must be greater than 2, and that the signal output
may be limited by the bandwidth of the output’s TTL drivers.

Digital output

The AUX I/O connector can be configured to output a TTL high or low signal. This mode
allows a programmer to use the AUX I/O connector as a general purpose digital output. The
following code fragment configures the AUX I/O connector as a digital output:

AlazarConfigureAuxIO(
handle, // HANDLE -- board handle
AUX_OUT_SERIAL_DATA, // U32 -- mode
0 // U32 �- 0 = low, 1 = high
);

©2008-2021 Alazar Technologies Inc. 31


ATS-SDK Documenta on, Release 7.5.0

Trigger enable input

The AUX I/O connector can be configured as an AutoDMA trigger enable input signal. When
enabled, a board will:
• Wait for a rising or falling edge on the AUX I/O.
• Wait for the number of trigger events necessary to capture the number of “records
per buffer” in one AutoDMA segment specified at the start of the acquisition.
• Repeat.
The following code fragment configures the AUX I/O connector to acquire “records per
buffer” records after it receives the rising edge of a TTL pulse connected on the AUX I/O
connector:

AlazarConfigureAuxIO(
handle, // HANDLE -- board handle
AUX_IN_TRIGGER_ENABLE, // U32 -- mode
TRIGGER_SLOPE_POSITIVE // U32 -- parameter
);

See Scanning Applications for more information.

Digital input

The AUX I/O connector can be configured to read the TTL level of a signal input to the AUX
connector. This mode allows a programmer to use the AUX I/O connector as a general-
purpose digital input. The following code fragment configures the AUX I/O connector as a
digital input:

AlazarConfigureAuxIO(
handle, // HANDLE -- board handle
AUX_IN_AUXILIARY, // U32 -- mode
0 // U32 �- not used
);

Once configured as a serial input, the following code fragment reads the AUX input level:

long level;
AlazarGetParameter(
handle, // HANDLE -- board handle
0, // U8 -- channel
GET_AUX_INPUT_LEVEL, // U32 -- parameter
&level // long* �- 0 = low, 1 = high
);

32 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

3.3.5 Data packing

By default, all the boards that have more than 8-bit per sample sampling transfer data to
the host computer with 2 bytes (16 bit) per sample. This behavior can be changed on some
boards by packing the data, either to 8- or 12-bits per sample. This is done by calling the
AlazarSetParameter function with the PACK_MODE parameter and a packing option (either
PACK_DEFAULT, PACK_8_BITS_PER_SAMPLE or PACK_12_BITS_PER_SAMPLE). The parameter must be
set before calling AlazarBeforeAsyncRead.
For a list of boards that implement 8-bit packing, 12-bit packing and both; please refer to
Table 9 – Miscellaneous Features Support.

3.3.6 Dual edge sampling

Some AlazarTech digitizers are capable of dual edge sampling (DES), meaning that sample
data is acquired both at the rising and falling edge of the clock signal. This mode can apply
both to internal and external clocks. For example, ATS9373 is capable of 2 GS/s sampling
in non-DES mode, and 4 GS/s in DES mode. When using the internal clock, DES sampling
is activated automatically. Data must be acquired from channel A only. To use DES sam-
pling in external clock mode, one must call AlazarSetParameter as follows before calling
AlazarSetCaptureClock():

AlazarSetParameterUL(
handle, // HANDLE -- board handle
channelMask, // U8 -- channel to acquire
SET_ADC_MODE,
ADC_MODE_DES
);

Programs that wish to use DES-capable digitizers in non-DES mode (i.e. ATS9373 at sampling
frequencies at or below 2GS/s) do not need to be modified.

3.3.7 NPT footers

Footers can be included to the data and contain additional information about the acqui-
sition of each record. The footers include a timestamp, the record number in the current
acquisition, a frame count and the state of the AUX I/O signal at the time of the acquisition.
As the name implies, this option is only available in NPT acquisition mode.
Depending if on-FPGA FFT is used or not, the function to retrieve the NPT footers and their
position in memory is different. If FFT is not enabled, NPT footers will replace the last 16
bytes of a record, leading to a loss of a few data points. These NPT footers are labeled Time-
Domain to highlighting the fact that FFT is not used. When one channel is enabled, the last
8 samples of the data will be removed. When two channels are enabled, only one footer will
be appended per record and will take the place of the last 4 samples from each channel.
When using on-FPGA FFT, a 128-byte word will be appended to each record. The last 16
bytes of this 128-byte word contain the footer.

©2008-2021 Alazar Technologies Inc. 33


ATS-SDK Documenta on, Release 7.5.0

For convenience, a structure named NPTFooter should be used. Here is how to enable and
obtain the NPT footers:
• Connect the start of frame signal to the AUX I/O connector.
• Append the flag ADMA_ENABLE_RECORD_FOOTERS to the options passed to AlazarBeforeAsyn-
cRead() by using a binary OR (|). Make sure the acquisition mode is set to ADMA_NPT and
FFT processing is enabled if applicable.
• Call AlazarConfigureAuxIO() specifying AUX_IN_AUXILIARY as the mode with 0 as param-
eter.
• Create an array that will contain the NPT footers. This array needs to be contiguous
in memory and can thus be a standard C array or a std::vector with preallocated size.
• Call AlazarExtractTimeDomainNPTFooters() or AlazarExtractFFTNPTFooters() to retrieve
the NPT footers for each buffer and store them in the array. The recordSize_bytes pa-
rameter needs to take into account the number of active channels.
• Browse the array to see the frame associated with each record and count the number
of records in each frame if needed.
See the API reference documentation for details about the specific parameters to use with
each function.

3.4 Acquiring data

AlazarTech digitizers may be configured to acquire in one of the following modes:


• Dual port AutoDMA acquisition mode acquires to on-board memory while, at the same
time, transferring data from on-board memory to application buffers.
• Single port acquisition mode acquires data to on-board memory and then, after the
acquisition is complete, transfers data from on-board memory to application buffers.

Note: Dual-port AutoDMA is the recommended acquisition mode for data acquisition with
AlazarTech digitizers, because it offers much better performance and flexibility. Single-port
acquisitions should only be used with PCI bus digitizers that do not have dual-port memory
(i.e. ATS460 and ATS860 without dual-port memory upgrade, ATS310, ATS330, ATS850).

34 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

3.4.1 Dual port AutoDMA acquisi on

AutoDMA allows a board to capture sample data to on-board dual-port memory while – at
the same time – transferring sample data from on-board dual-port memory to a buffer in
host memory. Data acquisition and data transfer are done in parallel, so any trigger events
that occur while the board is transferring data will not be missed.
AutoDMA may be used if:
• A board has dual-port or FIFO on-board memory.
• An application acquires at an average rate, in MB/s, that is less than maximum transfer
rate of your board’s PCI or PCIe host bus interface.
AutoDMA must be used if:
• A board has FIFO on-board memory.
• An application cannot miss trigger events that occur while it transfers data to host
memory, or re-arms for another acquisition.
• An application acquires more sample points or records than can be stored in on-board
memory.
Applications such as ultrasonic testing, OCT, radar, and imaging should use AutoDMA. An
AutoDMA acquisition is divided into segments. AutoDMA hardware on a board transfers
sample data, one segment at a time, from on-board memory to a buffer in host memory.
There may be an unlimited number of segments in an AutoDMA acquisition, so a board can
be armed to make an acquisition of infinite duration. There are four AutoDMA operating
modes:
Traditional AutoDMA This mode acquires multiple records, one per trigger event. Each
record may contain samples before and after its trigger event. Each buffer contains
one or more records. A record header may optionally precede each record. Supports
low trigger repeat rates.
NPT AutoDMA Acquires multiple records, one per trigger event. Some boards support a
very limited number of pre-trigger samples. Otherwise, only post-trigger samples are
possible. Each buffer contains one or more record. Supports high trigger repetition
rates.
Triggered streaming AutoDMA Acquires a single, gapless record spanning one or more
DMA buffers. Each DMA buffer then contains only a segment of the record. This mode
waits for a trigger event before acquiring the record.
Continuous streaming AutoDMA Acquires a single, gapless record spanning one or more
DMA buffers. Each DMA buffer then contains only a segment of the record. This mode
does not wait for a trigger event before acquiring the record.
To make an AutoDMA acquisition, an application must:
• Specify the AutoDMA mode, samples per record, records per buffer, and records per
acquisition.
• Arm the board to start the acquisition.

©2008-2021 Alazar Technologies Inc. 35


ATS-SDK Documenta on, Release 7.5.0

• Wait for an AutoDMA buffer to be filled, process the buffer, and repeat until the ac-
quisition is complete.

Note: An additional acquisition mode called Synchronous AutoDMA was available in ad-
dition to the modes presented here in former versions of the SDK. Support for this API was
removed with ATSApi version 6.0.0. Refer to Annex 1 for more information.

Tradi onal AutoDMA

Use traditional mode to acquire multiple records – one per trigger event – with sample
points after, and optionally before, the trigger event in each record. A record header may
optionally precede each record in the AutoDMA buffer. The programmer specifies the num-
ber of samples per record, records per buffer, and buffers in the acquisition. Traditional
AutoDMA supports low trigger repeat rates. For high trigger repeat rates, use NPT AutoDMA
mode. Digitizers with four analog input channels do not support 3-channel operation, and
require sample interleave to allow for high transfer rates from on-board memory.
Each buffer is organized in memory as follows if a board has on-board memory. Rxy rep-
resents a contiguous array of samples from record x of channel y.

Enabled channels Buffer organiza on


CH A R1A, R2A, R3A, … RnA
CH B R1B, R2B, R3B … RnB
CH A and CH B R1A, R1B, R2A, R2B, R3A, R3B … RnA, RnB
CH C R1C, R2C, R3C … RnC
CH A and CH C R1A, R1C, R2A, R2C, R3A, R3C … RnA, RnC
CH B and CH C R1B, R1C, R2B, R2C, R3B, R3C … RnB, RnC
CH D R1D, R2D, R3D … RnD
CH A and CH D R1A, R1D, R2A, R2D, R3A, R3D … RnA, RnD
CH B and CH D R1B, R1D, R2B, R2D, R3B, R3D … RnB, RnD
CH C and CH D R1C, R1D, R2C, R2D, R3C, R3D … RnC, RnD
CH A, CH B, CH C and R1A, R1B, R1C, R1D, R2A, R2B, R2C, R2D, R3A, R3B, R3C, R3D …
CH D RnA, RnB, RnC, RnD

Each buffer is organized in memory as follows if a board does not have on-board memory, or
if sample interleave is enabled. Rxy represents a contiguous array of samples from record
x of channel y, Rx[uv] represents interleaved samples from record x of channels u and v,
and Rx[uvyz] represents interleaved samples from channels u, v, y, and z.

36 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Enabled channels Buffer organiza on


CH A R1A, R2A, R3A, … RnA
CH B R1B, R2B, R3B … RnB
CH A and CH B R1[ABAB…], R2[ABAB…], … Rn[ABAB…]
CH C R1C, R2C, R3C … RnC
CH A and CH C R1[ACAC…], R2[ACAC…], … Rn[ACAC…]
CH B and CH C R1[BCBC…], R2[BCBC…], … Rn[BCBC…]
CH D R1D R2D, R3D … RnD
CH A and CH D R1[ADAD…], R2[ADAD…], … Rn[ADAD…]
CH B and CH D R1[BDBD…], R2[BDBD…], … Rn[BDBD…]
CH C and CH D R1[CDCD…], R2[CDCD…], … Rn[CDCD…]
CH A, CH B, CH C and CH C R1[ABCDABDC …], R2[ABDCABDC …], … Rn[ABDCABDC…]

See “%ATS_SDK_DIR%\Samples\DualPort\TR” for a sample program that demonstrates how


to make an AutoDMA acquisition in Traditional mode.
If record headers are enabled, then a 16-byte record header will precede each record in an
AutoDMA buffer. The record header contains a record timestamp, as well as acquisition
metadata. See Record headers and timestamps below for a discussion of AutoDMA record
headers.

NPT AutoDMA

Use NPT mode to acquire multiple records – one per trigger event – with no sample points
before the trigger event in each record, and with no record headers. The programmer
specifies the number of samples per record, records per buffer, and buffers in the acquisi-
tion. Note that NPT mode is highly optimized, and supports higher trigger repeats rate than
possible in Traditional mode. Digitizers with four analog input channels do not support
3-channel operation, and require sample interleave to allow for high transfer rates from
on-board memory.
Each buffer is organized in memory as follows if a board has on-board memory. Rxy rep-
resents a contiguous array of samples from record x of channel y.

©2008-2021 Alazar Technologies Inc. 37


ATS-SDK Documenta on, Release 7.5.0

Enabled channels Buffer organiza on


CH A R1A, R2A, R3A, … RnA
CH B R1B, R2B, R3B … RnB
CH A and CH B R1A, R2A, R3A … RnA, R1B, R2B, R3B … RnB
CH C R1C, R2C, R3C, … RnC
CH A and CH B R1A, R2A, R3A … RnA, R1B, R2B, R3B … RnB
CH B and CH C R1B, R2B, R3B … RnB, R1C, R2C, R3C … RnC
CH D R1D, R2D, R3D, … RnD
CH A and CH D R1A, R2A, R3A … RnA, R1D, R2D, R3D … RnD
CH B and CH D R1B, R2B, R3B … RnB, R1D, R2D, R3D … RnD
CH C and CH D R1C, R2C, R3C … RnC, R1D, R2D, R3D … RnD
CH A, CH B, CH C, R1A, R2A, R3A … RnA, R1B, R2B, R3B … RnB, R1C, R2C, R3C … RnC,
and CH D R1D, R2D, R3D … RnD

Each buffer is organized in memory as follows if a board does not have on-board memory, or
if sample interleave is enabled. Rxy represents a contiguous array of samples from record
x of channel y, Rx[uv] represents interleaved samples from record x of channels u and v,
and Rx[uvyz] represents interleaved samples from record x of channels u, v, y, and z.

Enabled channels Buffer organiza on


CH A R1A, R2A, R3A, … RnA
CH B R1B, R2B, R3B … RnB
CH A and CH B R1[ABAB…], R2[ABAB…], … Rn[ABAB…]
CH C R1C, R2C, R3C … RnC
CH A and CH C R1[ACAC…], R2[ACAC…], … Rn[ACAC…]
CH B and CH C R1[BCBC…], R2[BCBC…], … Rn[BCBC…]
CH D R1D R2D, R3D … RnD
CH A and CH D R1[ADAD…], R2[ADAD…], … Rn[ADAD…]
CH B and CH D R1[BDBD…], R2[BDBD…], … Rn[BDBD…]
CH C and CH D R1[CDCD…], R2[CDCD…], … Rn[CDCD…]
CH A, CH B, CH C and CH D R1[ABCDABCD …], R2[ABCDABCD …], … Rn[ABCDABCD…]

See “%ATS_SDK_DIR%\Samples\DualPort\NPT” for a sample program that demonstrates


how to make an AutoDMA acquisition in NPT mode.

Con nuous streaming AutoDMA

Use continuous streaming mode to acquire a single, gapless record that spans multiple
buffers without waiting for a trigger event to start the acquisition. The programmer speci-
fies the number of samples per buffer, and buffers per acquisition. Each buffer is organized
as follows if a board has on-board memory. R1x represents a contiguous array of samples
from channel x.

38 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Enabled channels Buffer organiza on


CH A R1A
CH B R1B
CH A and CH B R1A, R1B
CH C R1C
CH A and CH C R1A, R1C
CH B and CH C R1B, R1C
CH D R1D
CH A and CH D R1A, R1D
CH B and CH D R1B, R1D
CH C and CH D R1C, R1D
CH A, CH B, CH C and CH D R1A, R1B, R1C, R1D

Each buffer is organized as follows if a board does not have on-board memory, or if sample
interleave is enabled. R1x represents a contiguous array of samples from channel x, R1[uv]
represents samples interleaved from channels u and v, and R1[uvyz] represents samples
interleaved from channels u, v, y, and z.

Enabled channels Buffer organiza on


CH A R1A
CH B R1B
Both CH A and CH B R1[ABAB…]
CH C R1C
CH A and CH C R1[ACAC…]
CH B and CH C R1[BCBC…]
CH D R1D
CH A and CH D R1[ADAD…]
CH B and CH D R1[BDBD…]
CH C and CH D R1[CDCD…]
CH A, CH B, CH C and CH D R1[ABCDABCD …]

See “%ATS_SDK_DIR%\Samples\DualPort\CS” for a sample program that demonstrates how


to make an AutoDMA acquisition in continuous streaming mode.

Triggered streaming AutoDMA

Use triggered streaming mode to acquire a single, gapless record that spans two or more
buffers after waiting for a trigger event to start the acquisition. The programmer specifies
the number of samples in each buffer, and buffers in the acquisition. Each buffer is orga-
nized as follows if a board has on-board memory. R1x represents a contiguous array of
samples from channel x.

©2008-2021 Alazar Technologies Inc. 39


ATS-SDK Documenta on, Release 7.5.0

Enabled channels Buffer organiza on


CH A R1A
CH B R1B
CH A and CH B R1A, R1B
CH C R1C
CH A and CH C R1A, R1C
CH B and CH C R1B, R1C
CH D R1D
CH A and CH D R1A, R1D
CH B and CH D R1B, R1D
CH C and CH D R1C, R1D
CH A, CH B, CH C and CH D R1A, R2B, R1C, R1D

Each buffer is organized as follows if a board does not have on-board memory, or if sample
interleave is enabled. R1x represents a contiguous array of samples from channel x, R1[uv]
represents samples interleaved from channels u and v, and R1[uvyz] represents samples
interleaved from channels u, v, y, and z.

Enabled channels Buffer organiza on


CH A R1A
CH B R1B
Both CH A and CH B R1[ABAB…]
CH C R1C
CH A and CH C R1[ACAC…]
CH B and CH C R1[BCBC…]
CH D R1D
CH A and CH D R1[ADAD…]
CH B and CH D R1[BDBD…]
CH C and CH D R1[CDCD…]
CH A, CH B, CH C and CH D R1[ABCDABCD …]

See “%ATS_SDK_DIR%\Samples\DualPort\TS” for a sample program that demonstrates how


to make a triggered streaming AutoDMA acquisition.

Record headers and mestamps

In traditional AutoDMA mode, a 16-byte record header may optionally precede each record
in a buffer. When record headers are enabled, the following table shows the buffer layout if
a board has on-board memory. Record headers are not supported if a board does not have
on-board memory. Rxy represents a contiguous array of samples from record x of channel
y, and Hxy is a 16-byte record header from record x of channel y.

40 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Enabled chan- Buffer organiza on


nels
CH A H1A, R1A, H2A, R2A … HnA, RnA
CH B H1B, R1B, H2B, R2B … HnB, RnB
CH A and CH B H1A, R1A, H1B, R1B, H2A, R2A, H2B, R2B… HnA, RnA, HnB, RnB
CH C H1C, R1C, H2C, R2C … HnC, RnC
CH A and CH C H1A, R1A, H1C, R1C, H2A, R2A, H2C, R2C… HnA, RnA, HnC, RnC
CH B and CH C H1B, R1B, H1C, R1C, H2B, R2B, H2C, R2C… HnB, RnB, HnC, RnC
CH D H1D, R1D, H2D, R2D … HnD, RnD
CH A and CH D H1A, R1A, H1D, R1D, H2A, R2A, H2D, R2D… HnA, RnA, HnD, RnD
CH B and CH D H1B, R1B, H1D, R1D, H2B, R2B, H2D, R2D… HnB, RnB, HnD, RnD
CH C and CH D H1C, R1C, H1D, R1D, H2C, R2C, H2D, R2D… HnC, RnC, HnD, RnD
CH A, CH B, CH H1A, R1A, H1B, R1B, H1C, R1C, H1D, R1D, H2A, R2A, H2B, R2B H2C, R2C,
C and CH D H2D, R2D… HnA, RnA, HnB, RnB, HnC, RnC, HnD, RnD

Record headers

A record header is a 16-byte structure defined in AlazarApi.h as follows:

struct _HEADER0 {
unsigned int SerialNumber:18; // bits 17..0
unsigned int SystemNumber:4; // bits 21..18
unsigned int WhichChannel:1; // bit 22
unsigned int BoardNumber:4; // bits 26..23
unsigned int SampleResolution:3; // bits 29..27
unsigned int DataFormat:2; // bits 31..30
};

struct _HEADER1 {
unsigned int RecordNumber:24; // bits 23..0
unsigned int BoardType:8; // bits 31..24
};

struct _HEADER2 {
U32 TimeStampLowPart; //bits 31..0
};

struct _HEADER3 {
unsigned int TimeStampHighPart:8; // bits 7..0
unsigned int ClockSource:2; // bits 9..8
unsigned int ClockEdge:1; // bit 10
unsigned int SampleRate:7; // bits 17..11
unsigned int InputRange:5; // bits 22..18
unsigned int InputCoupling:2; // bits 24..23
unsigned int InputImpedance:2; // bits 26..25
unsigned int ExternalTriggered:1; // bit 27
unsigned int ChannelBTriggered:1; // bit 28
unsigned int ChannelATriggered:1; // bit 29
(continues on next page)

©2008-2021 Alazar Technologies Inc. 41


ATS-SDK Documenta on, Release 7.5.0

(continued from previous page)


unsigned int TimeOutOccurred:1; // bit 30
unsigned int ThisChannelTriggered:1; // bit 31
};

typedef struct _ALAZAR_HEADER {


struct _HEADER0 hdr0;
struct _HEADER1 hdr1;
struct _HEADER2 hdr2;
struct _HEADER3 hdr3;
} *PALAZAR_HEADER;

typedef struct _ALAZAR_HEADER ALZAR_HEADER;

See ALAZAR_HEADER for more information about each of the fields of this structure. See
“%ATS_SDK_DIR%\Samples\DualPort\TR_Header” for a full sample program that demon-
strates how to make an AutoDMA acquisition in Traditional mode with record headers.

Record mestamps

AlazarTech digitizer boards include a high-speed 40-bit counter that is clocked by the sam-
ple clock source scaled by a board specific divider. When a board receives a trigger event to
capture a record to on-board memory, it latches the value of this counter. This timestamp
value gives the time, relative to when the counter was reset, when the trigger event for this
record occurred. By default, this counter is reset to zero at the start of each acquisition. Use
AlazarResetTimeStamp() to control when the record timestamp counter is reset. The follow-
ing code fragment demonstrates how to extract the timestamp from a record header, and
covert the value from counts to seconds:

double samplesPerTimestampCount = 2; // board specific constant


double samplesPerSec = 100.e6; // sample rate
void* pRecord; // points to record header in buffer
ALAZAR_HEADER *pHeader = (ALAZAR_HEADER*) pRecord;
__int64 timestamp_counts;
timestamp_counts = (INT64) pHeader->hdr2.TimeStampLowPart;
timestamp_counts = timestamp_counts |
(((__int64) (pHeader->hdr3.TimeStampHighPart & 0x0ff)) << 32);
double timestamp_sec = samplesPerTimestampCount *
timestamp_counts / samplesPerSec;

Call AlazarGetParameter() with the GET_SAMPLES_PER_TIMESTAMP_CLOCK parameter to


determine the board specific “samples per timestamp count” value. Samples per record
requirements lists these values. See “%ATS_SDK_DIR%\Samples\DualPort\TR_Header” for a
full sample program that demonstrates how to make an AutoDMA acquisition in Traditional
mode with record headers, and convert the timestamp to seconds.

42 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

AutoDMA acquisi on flow

The AutoDMA functions allow an application to add user-defined number of buffers to a list
of buffers available to be filled by a board, and to wait for the board to receive sufficient
trigger events to fill the buffers with sample data. The board uses AutoDMA to transfer data
directly into a buffer without making any intermediate copies in memory. As soon as one
buffer is filled, the driver automatically starts an AutoDMA transfer into the next available
buffer.

AlazarPostBuffer

C/C++ applications should call AlazarPostAsyncBuffer() to make buffers available to be filled


by the board, and AlazarWaitAsyncBufferComplete() to wait for the board to receive sufficient
trigger events to fill the buffers. The following code fragment outlines the steps required to
make an AutoDMA acquisition using AlazarPostAsyncBuffer() and AlazarWaitAsyncBuffer-
Complete():

// Configure the board to make an AutoDMA acquisition


AlazarBeforeAsyncRead(
handle, // HANDLE -- board handle
channelMask, // U32 -- enabled channel mask
-(long)preTriggerSamples, // long -- trigger offset
samplesPerRecord, // U32 -- samples per record
recordsPerBuffer, // U32 -- records per buffer
recordsPerAcquisition, // U32 -- records per acquisition
flags // U32 -- AutoDMA mode and options
);

// Add two or more buffers to a list of buffers


// available to be filled by the board
for (i = 0; i < BUFFER_COUNT; i++) {
AlazarPostAsyncBuffer(
handle, // HANDLE -- board handle
BufferArray[i], // void* -- buffer pointer
BytesPerBuffer // U32 -- buffer length in bytes
);
}

// Arm the board to begin the acquisition


AlazarStartCapture(handle);

// Wait for each buffer in the acquisition to be filled


U32 buffersCompleted = 0;
while (buffersCompleted < buffersPerAcquisition) {
// Wait for the board to receives sufficient trigger events
// to fill the buffer at the head of its list of
// available buffers.
U32 bufferIndex = buffersCompleted % BUFFER_COUNT;
U16* pBuffer = BufferArray[bufferIndex];
AlazarWaitAsyncBufferComplete(handle, pBuffer, timeout_ms);
(continues on next page)

©2008-2021 Alazar Technologies Inc. 43


ATS-SDK Documenta on, Release 7.5.0

(continued from previous page)


buffersCompleted++;

// The buffer is full, process it.


// Note that while the application processes this buffer,
// the board is filling the next available buffer
// as trigger events arrive.
ProcessBuffer(pBuffer, bytesPerBuffer);

// Add the buffer to the end of the list of buffers


// available to be filled by this board. The board will
// fill it with another segment of the acquisition after
// all of the buffers preceding it have been filled.
AlazarPostAsyncBuffer(handle, pBuffer, bytesPerBuffer);
}

// Abort the acquisition and release resources.


// This function must be called after an acquisition.
AlazarAbortAsyncRead(boardHandle);

See “%ATS_SDK_DIR%\Samples\DualPort\NPT” for a full sample program that demonstrates


make an AutoDMA acquisition using AlazarPostAsyncBuffer.

ADMA_ALLOC_BUFERS

C#, and LabVIEW applications may find it more convenient to allow the API to allocate and
manage a list of buffers available to be filled by the board. These applications should call
AlazarBeforeAsyncRead() with the AMDA_ALLOC_BUFFERS option selected in the “Flags” param-
eter. This option will cause the API to allocate and manage a list of buffers available to be
filled by the board. The application must call AlazarWaitNextAsyncBufferComplete() to wait
for a buffer to be filled. When the board receives sufficient trigger events to fill a buffer, the
API will copy the data from the internal buffer to the user-supplied buffer. The following
code fragment outlines how make an AutoDMA acquisition using the ADMA_ALLOC_BUFFERS
flag and AlazarWaitNextAsyncBufferComplete():
// Allow the API to allocate and manage AutoDMA buffers
flags |= ADMA_ALLOC_BUFFERS;

// Configure a board to make an AutoDMA acquisition


AlazarBeforeAsyncRead(
handle, // HANDLE -- board handle
channelMask, // U32 -- enabled channel mask
-(long)preTriggerSamples, // long -- trigger offset
samplesPerRecord, // U32 -- samples per record
recordsPerBuffer, // U32 -- records per buffer
recordsPerAcquisition, // U32 -- records per acquisition
flags // U32 -- AutoDMA mode and options
);

// Arm the board to begin the acquisition


(continues on next page)

44 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

(continued from previous page)


AlazarStartCapture(handle);

// Wait for each buffer in the acquisition to be filled


RETURN_CODE retCode = ApiSuccess;
while (retCode == ApiSuccess) {
// Wait for the board to receive sufficient
// trigger events to fill an internal AutoDMA buffer.
// The API will copy data from the internal buffer
// to the user-supplied buffer.
retCode =
AlazarWaitNextAsyncBufferComplete(
handle, // HANDLE -- board handle
pBuffer, // void* -- buffer to receive data
bytesToCopy, // U32 -- bytes to copy into buffer
timeout_ms // U32 -- time to wait for buffer
);

// The buffer is full, process it


// Note that while the application processes this buffer,
// the board is filling the next available internal buffer
// as trigger events arrive.
ProcessBuffer(pBuffer, bytesPerBuffer);
}

// Abort the acquisition and release resources.


// This function must be called after an acquisition.
AlazarAbortAsyncRead(boardHandle);

See “%ATS_SDK_DIR%\Samples\DualPort\CS_WaitNextBuffer” for a full sample program


that demonstrates make an AutoDMA acquisition using ADMA_ALLOC_BUFFERS. An application
can get or set the number of DMA buffers allocated by the API by calling AlazarGetParame-
ter() or AlazarSetParameter() with the parameter SETGET_ASYNC_BUFFCOUNT.
Note that applications may combine ADMA_ALLOC_BUFFERS with options to perform operations
that would be difficult in high-level programming languages like LabVIEW. They include:
• Data normalization – This option enables the API to process sample data so that the
data always has the same arrangement in the application buffer, independent of Au-
toDMA mode. See ADMA_GET_PROCESSED_DATA for more information.
• Disk streaming – This option allows the API to use high-performance disk I/O functions
to stream buffer data to files. See AlazarCreateStreamFile() below for more informa-
tion.

©2008-2021 Alazar Technologies Inc. 45


ATS-SDK Documenta on, Release 7.5.0

AlazarAsyncRead

Some C/C++ applications under Windows may require waiting for an event to be set to the
signaled state to indicate when an AutoDMA buffer is full. These applications should use
the AlazarAsyncRead() API. The following code fragment outlines how use AlazarAsyncRead()
to make an asynchronous AutoDMA acquisition:

// Configure the board to make an AutoDMA acquisition


AlazarBeforeAsyncRead(
handle, // HANDLE -- board handle
channelMask, // U32 -- enabled channel mask
-(long)preTriggerSamples, // long -- trigger offset
samplesPerBuffer, // U32 -- samples per buffer
recordsPerBuffer, // U32 -- records per buffer
recordsPerAcquisition, // U32 -- records per acquisition
admaFlags // U32 -- AutoDMA flags
);

// Add two or more buffers to a list of buffers


// available to be filled by the board
for (i = 0; i < BUFFER_COUNT; i++) {
AlazarAsyncRead (
handle, // HANDLE -- board handle
IoBufferArray[i].buffer, // void* -- buffer
IoBufferArray[i].bytesPerBuffer, // U32 -- buffer length
&IoBufferArray[i].overlapped // OVERLAPPED*
);
}

// Arm the board to begin the acquisition


AlazarStartCapture(handle);

// Wait for each buffer in the acquisition to be filled.


U32 buffersCompleted = 0;
while (buffersCompleted < buffersPerAcquisition)
{
// Wait for the board to receives sufficient
// trigger events to fill the buffer at the head of its
// list of available buffers.
// The event handle will be set to the signaled state when
// the buffer is full.
U32 bufferIndex = buffersCompleted % BUFFER_COUNT;
IO_BUFFER *pIoBuffer = IoBufferArray[bufferIndex];
WaitForSingleObject(pIoBuffer->hEvent, INFINTE);
buffersCompleted++;

// The buffer is full, process it


// Note that while the application processes this buffer,
// the board is filling the next available buffer
// as trigger events arrive.
ProcessBuffer(pIoBuffer->buffer, pIoBuffer->bytesPerBuffer);

(continues on next page)

46 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

(continued from previous page)


// Add the buffer to the end of the list of buffers.
// The board will fill it with another segment from the
// acquisition after the buffers preceding it have been filled.
AlazarAsyncRead (
handle, // HANDLE -- board handle
pIoBuffer->buffer, // void* -- buffer
pIoBuffer->bytesPerBuffer, // U32 -- buffer length
&pIoBuffer->overlapped // OVERLAPPED*
);
}

// Stop the acquisition. This function must be called if unfilled buffers are
// pending.
AlazarAbortAsyncRead(handle);

See “%ATS_SDK_DIR%\Samples\DualPort\CS_AsyncRead” for a full sample program that


demonstrates make an AutoDMA acquisition using AlazarAsyncRead().

AlazarAbortAsyncRead

The asynchronous API driver locks application buffers into memory so that boards may
DMA directly into them. When a buffer is completed, the driver unlocks it from memory.
An application must call AlazarAbortAsyncRead() if, at the end of an acquisition, any of the
buffers that it supplies to a board have not been completed. AlazarAbortAsyncRead() com-
pletes any pending buffers, and unlocks them from memory.

Warning: If an application exits without calling AlazarAbortAsyncRead(), the API driver


may generate a DRIVER_LEFT_LOCKED_PAGES_IN_PROCESS (0x000000CB) bug check error un-
der Windows, or leak the locked memory under Linux. This may happen, for example, if
a programmer runs an application that uses the API under a debugger, stops at a break-
point, and then stops the debugging session without letting the application or API exit
normally.

Buffer count

An application should supply at least two buffers to a board. This allows the board to fill
one buffer while the application consumes the other. As long as the application can con-
sume buffers faster than the board can fill them, the acquisition can continue indefinitely.
However, Microsoft Windows and general-purpose Linux distributions are not real time
operating systems. An application thread may be suspended for an indeterminate amount
of time to allow other threads with higher priority to run. As a result, buffer processing
may take longer than expected. The board is filling AutoDMA buffers with sample data in
real time. If an application is unable to supply buffers as fast a board fills them, the board
will run out of buffers into which it can transfer sample data. The board can continue to ac-

©2008-2021 Alazar Technologies Inc. 47


ATS-SDK Documenta on, Release 7.5.0

quire data until it fills is on-board memory, but then it will abort the acquisition and report
a buffer overflow error.
It is recommended that an application supply three or more buffers to a board. This allows
some tolerance for operating system latencies. The programmer may need to increase the
number of buffers according to the application.

Note: The number of buffers required by a board is not the same as the number of buffers
required by an application. There may be little benefit in supplying a board with more
than a few tens of buffers, each of a few million samples. If an application requires much
more sample data for data analysis or other purposes, the programmer should consider
managing application buffers separately from AutoDMA buffers.

Scanning applica ons

Scanning applications divide an acquisition into frames, where each frame is composed of
a number of scan lines, and each scan line is composed of a number of sample points. These
applications typically:
• Wait for a “start of frame” event.
• Wait for a number of “start of line” events, capturing a specified number of sample
points after each “start of line” event.
• Wait for the next “start of frame” event and repeat.
To implement a scanning application using a hardware “start of frame” signal:
• Connect a TTL signal that will serve as the “start of frame” event to the AUX I/O con-
nector.
• Call AlazarConfigureAuxIO() specifying AUX_IN_TRIGGER_ENABLE as the mode, and
the active edge of the trigger enable signal as the parameter.
• Configure the board to make an NPT() or Traditional() mode AutoDMA acquisition
where the number of “records per buffer” is equal to the number of scan lines per
frame.
• Call AlazarStartCapture() to being the acquisition.
• Supply a TTL pulse to the AUX I/O connector (or call AlazarForceTriggerEnable()) to
arm the board to capture one frame. The board will wait for sufficient trigger events
to capture the number of records in an AutoDMA buffer, and then wait for the next
trigger enable event.
To implement a scanning application using a software “start of frame” command:
• Call AlazarConfigureAuxIO() specifying AUX_OUT_TRIGGER_ENABLE as the mode,
along with the signal to output on the AUX I/O connector.

48 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• Configure the board to make an NPT() or Traditional() mode AutoDMA acquisition


where the number of “records per buffer” is equal to the number of scan lines per
frame.
• Call AlazarStartCapture() to begin the acquisition.
• Call AlazarForceTriggerEnable() to arm the board to capture one frame. The board
will wait for sufficient trigger events to capture the number of records in an AutoDMA
buffer, and then wait for the next trigger enable event.
Note that if the number of records per acquisition is set to infinite, software arms
the digitizer once to make an AutoDMA acquisition with an infinite number of frames.
The hardware will continue acquiring frame data until the acquisition is aborted. See
“%ATS_SDK_DIR%\Samples\DualPort\NPT_Scan” for sample programs that demonstrate
how to make a scanning application using hardware trigger enable signals.

Other scanning applica ons (NPT Footers)

In some other applications, an acquisition is divided several frames, but the number of
records per frame is not constant. This happens in imaging applications such as intravascu-
lar OCT. The rotation speed of the imaging probe is not constant and the number of records
(A-lines) may vary from one frame to the other.
For this situation, the AUX I/O connector should not be used as a trigger enable input as
in conventional scanning application. Instead, it can be used a frame counter. The frame
number can be appended to each data record so the used can recover the frame number
for each record and then reconstruct each frame correctly. These are called footers and can
only be used in NPT acquisition mode. See the NPT footers section for more details about
using NPT footers.

Master-slave applica ons

If a dual-port acquisition API is used to acquire from master-slave board system:


• Call AlazarBeforeAsyncRead() on all slave boards before the master board.
• Call AlazarStartCapture() only on the master board.
• Call AlazarAbortAsyncRead() on the master board before the slave boards.
• The board system acquires the boards in the board system in parallel. As a result, an
application must consume a buffer from each board in the board system during each
cycle of the acquisition loop.
• Do not use synchronous API functions with master-slave systems – use the asyn-
chronous API functions instead.
The following sample programs demonstrate how to acquire from
a master-slave system: “%ATS_SDK_DIR%\Samples\DualPort\TR_MS”,
“%ATS_SDK_DIR%\Samples\DualPort\NPT_MS”, “%ATS_SDK_DIR%\Samples\DualPort\CS_MS”,
and “%ATS_SDK_DIR%\Samples\DualPort\TS_MS”.

©2008-2021 Alazar Technologies Inc. 49


ATS-SDK Documenta on, Release 7.5.0

Buffer size and alignment

AlazarTech digitizer boards must be configured to acquire a minimum number of samples


per record, and each record must be a multiple of a specified number of samples. Records
may shift within a buffer if alignment requirements are not met. Please refer to Samples
per record requirements for a list of requirements.
The number of pre-trigger samples in single-port and dual-port “traditional” AutoDMA
mode must be a multiple of the pre-trigger alignment value above. See AlazarSetRecord-
Count() and AlazarSetRecordSize() for more information.
The address of application buffers passed to the following data transfer functions must
meet the buffer alignment requirement in Samples per record requirements: AlazarRead(),
AlazarReadEx(), AlazarAsyncRead(), AlazarPostAsyncBuffer(), and AlazarWaitAsyncBufferCom-
plete(). For example, the address of a buffer passed to AlazarPostAsyncBuffer to receive
data from an ATS9350 must be aligned to a 32-sample, or 64-byte, address.
Note that AlazarWaitNextAsyncBufferComplete() has no alignment requirements. As a result,
an application can use this function to transfer data if it is impossible to allocate correctly
aligned buffers.

Data format

By default, AlazarTech digitizers generate unsigned sample data. For example, 8-bit digitiz-
ers such as the ATS9870 generate sample codes between 0 and 255 (0xFF) where: 0 repre-
sents a negative full-scale input voltage, 128 (0x80) represents ~0V input voltage, 255 (0xFF)
represents a positive full-scale input voltage. Some AlazarTech digitizer can be configured
to generate signed sample data in two’s complement format. For example, the ATS9870
can be configured to generate sample codes where: 0 represents ~0V input voltage, 127
(0x7F) represents a positive full-scale input voltage, and –128 (0x80) represents a negative
full-scale input voltage.
Call AlazarSetParameter() with parameter SET_DATA_FORMAT before the start of an acquisi-
tion to set the sample data format, and call AlazarGetParameter() with GET_DATA_FORMAT
to get the current data format. The following code fragment demonstrates how to select
signed sample data output:

AlazarSetParameter(
handle, // HANDLE -- board handle
0, // U8 -- channel Id (not used)
SET_DATA_FORMAT, // U32 -- parameter to set
DATA_FORMAT_SIGNED // long -- value (0 = unsigned, 1 = signed)
);

50 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

3.4.2 Single port acquisi on

The single-port acquisition API allows an application to capture records to on-board mem-
ory – one per trigger event – and transfer records from on-board to host memory. Data
acquisition and data transfer are made serially, so trigger events may be missed if they
occur during data transfers.

Note: The single port acquisition mode is not recommended for new designs. It should
only be used with PCI bus digitizers that are not capable of making dual-port acquisitions:
ATS460 and ATS860 without dual-port memory upgrade, ATS310, ATS330, ATS850.

Acquiring to on-board memory

All channels mode

By default, AlazarTech digitizer boards share on-board memory equally between both of a
board’s input channels. A single-port acquisition in dual-channel mode captures samples
from both input channels simultaneously to on-board memory and, after the acquisition
is complete, allows samples from either input channel to be transferred from on-board
memory to an application buffer. To program a board acquire to on-board memory in dual-
channel mode:
1. Call AlazarSetRecordSize() to set the number of samples per record, where a record
may contain samples before and after its trigger event.
2. Call AlazarSetRecordCount() to set the number records per acquisition – the board cap-
tures one record per trigger event.
3. Call AlazarStartCapture() to arm the board to wait for trigger events.
4. Call AlazarBusy() in a loop to poll until the board has received all trigger events in the
acquisition, and has captured all records to on-board memory.
5. Call AlazarRead(), AlazarReadEx(), or AlazarHyperDisp() to transfer records from on-
board memory to host memory.
6. Repeat from step 3, if necessary.
The following code fragment acquires to on board memory with on-board memory shared
between both input channels:

// 1. Set record size


AlazarSetRecordSize (
boardHandle, // HANDLE -- board handle
preTriggerSamples, // U32 -- pre-trigger samples
postTriggerSamples // U32 -- post-trigger samples
);

// 2. Set record count


(continues on next page)

©2008-2021 Alazar Technologies Inc. 51


ATS-SDK Documenta on, Release 7.5.0

(continued from previous page)


AlazarSetRecordCount(
boardHandle, // HANDLE -- board handle
recordsPerCapture // U32 -- records per acquisition
);

// 3. Arm the board to wait for trigger events


AlazarStartCapture(boardHandle);

// 4. Wait for the board to receive all trigger events and capture all
// records to on-board memory

while (AlazarBusy (boardHandle))


{
// The acquisition is in progress
}

// 5. The acquisition is complete. Call AlazarRead or AlazarHyperDisp to


// transfer records from on-board memory to your buffer.

Single channel mode

Note: The single port acquisition mode is not recommended for new designs. It should
only be used with digitizers that are not capable of making dual-port acquisitions: ATS310,
ATS330 and ATS850.

ATS9325, ATS9350, ATS9351, ATS9440, ATS9625, ATS9626, ATS9850, and ATS9870 and digi-
tizer boards can be configured to dedicate all on-board memory to one of a board’s input
channels. A single-port acquisition in single-channel mode only captures samples from the
specified channel to on-board memory and, after the acquisition is complete, only allows
samples from the specified channel to be transferred from on-board memory to an appli-
cation buffer.
To program a board to acquire to on-board memory in single-channel mode:
1. Call AlazarSetRecordSize() to set the number of samples per record, where a record
may contain samples before and after its trigger event.
2. Call AlazarSetRecordCount() to set the number records per acquisition – the board cap-
tures one record per trigger event.
3. Call AlazarSetParameter() with the parameter SET_SINGLE_CHANNEL_MODE, and specify the
channel to use all memory.
4. Call AlazarStartCapture() to arm the board to wait for trigger events.
5. Call AlazarBusy() in a loop to poll until the board has received all trigger events in the
acquisition, and has captured all records to on-board memory.

52 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6. Call AlazarRead(), AlazarReadEx(), or AlazarHyperDisp() to transfer records from on-


board memory to host memory.
7. Repeat from step 3, if necessary.
The following code fragment acquires to on-board memory from CH A in single channel
mode:

// 1. Set record size


AlazarSetRecordSize (
boardHandle, // HANDLE -- board handle
preTriggerSamples, // U32 -- pre-trigger samples
postTriggerSamples // U32 -- post-trigger samples
);

// 2. Set record count


AlazarSetRecordCount(
boardHandle, // HANDLE -- board handle
recordsPerCapture // U32 -- records per acquisition
);

// 3. Enable single channel mode


AlazarSetParameter(
boardHandle, // HANDLE -- board handle
0, // U8 -- channel Id (not used)
SET_SINGLE_CHANNEL_MODE, // U32 -- parameter
CHANNEL_A // long � CHANNEL_A or CHANNEL_B
);

// 4. Arm the board to wait for trigger events


AlazarStartCapture(boardHandle);

// 5. Wait for the board to receive all trigger events


// and capture all records to on-board memory
while (AlazarBusy (boardHandle))
{
// The acquisition is in progress
}

// 6. The acquisition is complete. Call AlazarRead or


// AlazarHyperDisp to transfer records from on-board memory
// to your buffer.

Note: A call to AlazarSetParameter() must be made before each call to AlazarStartCapture().

If the of number of samples per record specified in AlazarSetRecordSize() is greater than


the maximum number of samples per channel in dual-channel mode, but is less than the
maximum number of samples per record in single-channel mode, and AlazarSetParameter()
is not called before calling AlazarStartCapture(), then AlazarStartCapture() will fail with
error ApiNotSupportedInDualChannelMode.

©2008-2021 Alazar Technologies Inc. 53


ATS-SDK Documenta on, Release 7.5.0

Using AlazarRead

Use AlazarRead() to transfer samples from records acquired to on-board memory to a buffer
in host memory.

Transferring full records

The following code fragment transfers a full CH A record from on-board memory to a buffer
in host memory:

// Allocate a buffer to hold one record.


// Note that the buffer must be at least 16 samples
// larger than the number of samples per record.
U32 allocBytes = bytesPerSample * (samplesPerRecord + 16);
void* buffer = malloc(allocBytes);

// Transfer a CHA record into our buffer


AlazarRead (
boardHandle, // HANDLE -- board handle
CHANNEL_A, // U32 -- channel Id
buffer, // void* -- buffer
bytesPerSample, // int -- bytes per sample
(long) record, // long -- record (1 indexed)
-((long)preTriggerSamples), // long -- trigger offset
samplesPerRecord // U32 -- samples to transfer
);

See “%ATS_SDK_DIR%\Samples\SinglePort\AR” for a complete sample program that demon-


strates how to use AlazarRead() to read full records.

Transferring par al records

AlazarRead() can transfer a segment of a record from on-board memory to a buffer in host
memory. This may be useful if:
• The number of bytes in a full record in on-board memory exceeds the buffer size in
bytes that an application can allocate in host memory.
• An application wishes to reduce the time required for data transfer when it acquires
relatively long records to on-board memory, but is only interested in a relatively small
part of the record.
Use the transferOffset parameter in the call to AlazarRead() to specify the offset, in samples
from the trigger position in the record, of the first sample to transfer from on-board memory
to the application buffer. And use the transferLength parameter to specify the number of
samples to transfer from on-board memory to the application buffer, where this number of
samples may be less than the number of samples per record. The following code fragment
divides a record into segments, and transfers the segments from on-board to host memory:

54 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

// Allocate a buffer to hold one record segment.


// Note that the buffer must be at least 16 samples
// larger than the number of samples per buffer.
U32 allocBytes = bytesPerSample * (samplesPerBuffer + 16);
void* buffer = malloc(allocBytes);

// Transfer a record in segments from on-board memory


U32 samplesToRead = samplesPerRecord;
long triggerOffset_samples = -(long)preTriggerSamples;
while (samplesToRead > 0) {
// Transfer a record segment from on-board memory
U32 samplesThisRead;
if (samplesToRead > samplesPerBuffer)
samplesThisRead = samplesPerBuffer;
else
samplesThisRead = samplesToRead;
AlazarRead (
boardHandle, // HANDLE -- board handle
CHANNEL_A, // U32 -- channel Id
buffer, // void* -- buffer
bytesPerSample, // int -- bytes per sample
(long) record, // long -- record (1 indexed)
triggerOffset_samples, // long -- trigger offset
samplesThisRead // U32 -- samples to transfer
);

// Process the record segment here


WriteSamplesToFile(buffer, samplesThisRead);

// Point to next record segment in on-board memory


triggerOffset_samples += samplesThisRead;

// Decrement number of samples left to read


samplesToRead -= samplesThisRead;
}

See “%ATS_SDK_DIR%\Samples\SinglePort\AR_Segments” for a complete sample program


that demonstrates how to read records in segments.

Using AlazarReadEx

AlazarRead() can transfer samples from records acquired to on-board memory that con-
tain up to 2,147,483,647 samples. If a record contains 2,147,483,648 or more samples, use
AlazarReadEx() rather than AlazarRead(). AlazarReadEx() uses signed 64-bit transfer off-
sets, while AlazarRead() uses signed 32-bit transfer offsets. Otherwise, AlazarReadEx() and
AlazarRead() are identical.

©2008-2021 Alazar Technologies Inc. 55


ATS-SDK Documenta on, Release 7.5.0

Using AlazarHyperDisp

HyperDisp technology enables the FPGA on an AlazarTech digitizer board to process sample
data. The FPGA divides a record in on-board memory into intervals, finds the minimum
and maximum sample values during each interval, and transfers an array of minimum
and maximum value pairs to host memory. This allows the acquisition of relatively long
records to on-board memory, but the transfer of relatively short processed records across
the PCI/PCIe bus to host memory.
For example, an ATS860-256M would require over 2 seconds per channel to transfer
256,000,000 samples across the PCI bus. However, with HyperDisp enabled the ATS860
would require a fraction of a second to calculate HyperDisp data, and transfer a few kilo-
bytes of processed data across the PCI bus. If an application was searching these records
for glitches, it may save a considerable amount of time by searching HyperDisp data for the
glitches and, if a glitch were found, transfer the raw sample data from the interval from
on-board memory to host memory.
Use AlazarHyperDisp() to enable a board to process records in on-board memory, and trans-
fer processed records to host memory. The following code fragment enables an ATS860-
256M to process a record in on-board memory containing 250,000,000 samples into an array
of 100 HyperDisp points, where each point contains the minimum and maximum sample
values over an interval of 2,500,000 samples in the record:

// Specify number of samples per record


U32 preTriggerSamples = 125000000;
U32 postTriggerSamples = 125000000;
U32 samplesPerRecord = preTriggerSamples + postTriggerSamples;
U32 recordsPerCapture = 1;

// Acquire to on-board memory (omitted)


// Specify the number of HyperDisp points
U32 pointsPerRecord = 100;

// Allocate a buffer to store the HyperDisp data


U32 bytesPerSample = 1; // ATS860 constant
U32 samplesPerPoint = 2; // HyperDisp constant
U32 bytesPerBuffer = bytesPerSample * samplesPerPoint * pointsPerRecord;
U8 *buffer = (U8*) malloc(bytesPerBuffer);

// Enable ATS860 FPGA to process the 250M sample record


// in on-board memory into an array of 100 HyperDisp points,
// and transfer the HyperDisp points into our buffer
U32 error;

AlazarHyperDisp (
boardHandle, // HANDLE -- board handle
NULL, // void* -- reserved
samplesPerRecord, // U32 -- BufferSize
(U8*) buffer, // U8* -- ViewBuffer
bytesPerBuffer, // U32 -- ViewBufferSize
pointsPerRecord, // U32 -- NumOfPixels
(continues on next page)

56 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

(continued from previous page)


1, // U32 -- Option (1 = HyperDisp)
CHANNEL_A, // U32 -- ChannelSelect
1, // U32 -- record (1 indexed)
-(long)preTriggerSamples, // long -- TransferOffset
&error // U32* -- error
);

See “%ATS_SDK_DIR%\Samples\SinglePort\HD” for a complete sample program that demon-


strates how to use AlazarHyperDisp().

Record mestamps

AlazarTech digitizer boards include a 40-bit counter clocked by the sample clock source
scaled by a board specific divider. When a board receives a trigger event to capture a record
to on-board memory, it latches and saves the value of this counter. The counter value gives
the time, relative to when the counter was reset, when the trigger event for the record
occurred.
By default, this counter is reset to zero at the start of each acquisition. Use AlazarReset-
TimeStamp() to control when the record timestamp counter is reset.
Use AlazarGetTriggerAddress() to retrieve the timestamp, in timestamp clock ticks, of a
record acquired to on-board memory. This function does not convert the timestamp value
to seconds. The following code fragment gets the record timestamp of a record acquired to
on-board memory, and converts the timestamp value from clocks ticks to seconds:

// Read the record timestamp


U32 triggerAddress;
U32 timestampHigh;
U32 timestampLow;

AlazarGetTriggerAddress (
boardHandle, // HANDLE -- board handle
record, // U32 -- record number (1-indexed)
&triggerAddress, // U32* -- trigger address
&timestampHigh, // U32* -- timestamp high part
&timestampLow // U32* -- timestamp low part
);

// Convert the record timestamp from counts to seconds


__int64 timeStamp_cnt;
timeStamp_cnt = ((__int64) timestampHigh) << 8;
timeStamp_cnt |= timestampLow & 0x0ff;
double samplesPerTimestampCount = 2; // board specific constant
double samplesPerSec = 50.e6; // sample rate
double timeStamp_sec = (double) samplesPerTimestampCount *
timeStamp_cnt / samplesPerSec;

Call AlazarGetParameter() with the GET_SAMPLES_PER_TIMESTAMP_CLOCK parameter to obtain


the board specific “samples per timestamp count” value. See Samples per record require-

©2008-2021 Alazar Technologies Inc. 57


ATS-SDK Documenta on, Release 7.5.0

ments for a list of these values. See “%ATS_SDK_DIR%\Samples\SinglePort\AR_Timestamps”


for a complete sample program that demonstrates how to retrieve record timestamps and
convert them to seconds.

Master-slave applica ons

If the single-port API is used to acquire from master-slave board system, only the master
board in the board system should receive calls to the following API functions: AlazarStart-
Capture(), AlazarAbortCapture(), AlazarBusy(), AlazarTriggered() and AlazarForceTrigger().
See “%ATS_SDK_DIR%\Samples\SinglePort\AR_MasterSlave” for a sample program that
demonstrates how to acquire from a master-slave system.

3.5 Processing data

3.5.1 Conver ng sample values to volts

The data acquisition APIs transfer an array of sample values into an application buffer.
Each sample value occupies 1 or 2 bytes in the buffer, where a sample code is stored in the
most significant bits of the sample values. Sample values that occupy two bytes are stored
with their least significant bytes at the lower byte addresses (little-endian byte order) in the
buffer. To convert sample values in the buffer to volts:
• Get a sample value from the buffer.
• Get the sample code from the most-significant bits of the sample value.
• Convert the sample code to volts.
Note that the arrangement of samples values in the buffer into records and channels de-
pends on the API used to acquire the data.
• Single-port acquisitions return a contiguous array of samples for a specified channel.
(See Single Port Acquisition above.)
• Dual-port AutoDMA acquisitions return sample data whose arrangement depends on
the AutoDMA mode and options chosen. (See section Dual port AutoDMA Acquisition
above.)
Also note that AlazarTech digitizer boards generate unsigned sample codes by default. (See
Data format above.)

58 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

8-bits per sample

Ge ng 1-byte sample values from the buffer

The hexadecimal editor view below shows the first 128-bytes of data in a buffer from an
8-bit digitizer such as the ATS850, ATS860, ATS9850, and ATS9870.

00000 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F
00010 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F
00020 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F
00030 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F
00040 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F
00050 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F
00060 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F
00070 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F

Each 8-bit sample occupies 1-byte in the buffer, so the block above displays 128 samples
(128 bytes / 1 byte per sample). The following code fragment demonstrates how to access
each 8-bit sample value in a buffer:

U8 *pSamples = (U8*) buffer;


for (U32 sample = 0; sample < samplesPerBuffer; sample++) {
U8 sampleValue = *pSamples++;
printf("sample value = %02Xn", sampleValue);
}

Ge ng 8-bit sample codes from 1-byte sample values

Each 8-bit sample value stores an 8-bit sample code. For example, the first byte in buffer
above stores the sample code 0x7F, or 127 decimal.

Conver ng unsigned 8-bit sample codes to volts

A sample code of 128 (0x80) represents ~0V input voltage, 255 (0xFF) represents a positive
full-scale input voltage, and 0 represents a negative full-scale input voltage. The following
table illustrates how unsigned 8-bit sample codes map to values in volts according to the
full-scale input range of the input channel.

Hex value Frac on of input range Volts for ±100 mV range Volts for ±1 V range
0x00 -100% -100 mV -1 V
0x40 -50% -50 mV -.5 V
0x80 0% 0V 0V
0xC0 +50% 50 mV +.5 V
0xFF +100% +100 mV +1 V

©2008-2021 Alazar Technologies Inc. 59


ATS-SDK Documenta on, Release 7.5.0

The following code fragment shows how to convert a 1-byte sample value containing an
unsigned 8-bit code to in volts:

double SampleToVoltsU8(U8 sampleValue, double inputRange_volts)


{
// AlazarTech digitizers are calibrated as follows

double codeZero = (double)UCHAR_MAX/2;


double codeRange = (double)UCHAR_MAX/2;
// Convert sample code to volts
double sampleVolts = inputRange_volts *
((double) (sampleValue - codeZero) / codeRange);
return sampleVolts;
}

Conver ng signed 8-bit sample codes to volts

A signed code of 0 represents ~0V input voltage, 127 (0x7F) represents a positive full-scale
input voltage, and –128 (0x80) represents a negative full-scale input voltage. The following
table illustrates how signed 8-bit sample codes map to values in volts according to the full-
scale input range of the input channel.

Hex value Frac on of input range Volts for ±100 mV range Volts for ±1 V range
0x81 -100% -100 mV -1 V
0xC0 -50% -50 mV -.5 V
0x00 0% 0V 0V
0x40 +50% 50 mV +.5 V
0x7F +100% +100 mV +1 V

The following code fragment shows how to convert a 1-byte sample value containing a
signed 8-bit sample code to in volts:

double SampleToVoltsS8(S8 sampleValue, double inputRange_volts)


{
// AlazarTech digitizers are calibrated as follows
double codeZero = 0;
double codeRange = (double)SCHAR_MAX;
// Convert sample code to volts
double sampleVolts = inputRange_volts *
((double) (sampleCode - codeZero) / codeRange);
return sampleVolts;
}

60 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

12-bits per sample

Ge ng 2-byte sample values from the buffer

The hexadecimal editor view below displays the first 128-bytes of data in a buffer from a
12-bit digitizer such as the ATS310, ATS330, ATS9325, ATS9350, ATS9351, ATS9352, ATS9353,
ATS9360, ATS9371, and ATS9373.

00000 E0 7F F0 7F 00 80 F0 7F F0 7F 10 80 E0 7F 00 80
00010 F0 7F 00 80 E0 7F E0 7F 00 80 E0 7F F0 7F F0 7F
00020 E0 7F F0 7F 00 80 F0 7F F0 7F 10 80 E0 7F 00 80
00030 F0 7F 00 80 E0 7F E0 7F 00 80 E0 7F F0 7F F0 7F
00040 E0 7F F0 7F 00 80 F0 7F F0 7F 10 80 E0 7F 00 80
00050 F0 7F 00 80 E0 7F E0 7F 00 80 E0 7F F0 7F F0 7F
00060 E0 7F F0 7F 00 80 F0 7F F0 7F 10 80 E0 7F 00 80
00070 F0 7F 00 80 E0 7F E0 7F 00 80 E0 7F F0 7F F0 7F

Each 12-bit sample value occupies a 2-bytes in the buffer, so the view above displays 64
sample values (128 bytes / 2 bytes per sample). The first 2 bytes in the buffer are 0xE0 and
0x7F. Two-byte sample values are stored in little-endian byte order in the buffer, so the first
sample value in the buffer is 0x7FE0. The following code fragment demonstrates how to
access each 16-bit sample value in a buffer:

U16 *pSamples = (U16*)buffer;


for (U32 sample = 0; sample < samplesPerBuffer; sample++) {
U16 sampleValue = *pSamples++;
printf("sample value = %04X\n", sampleValue);
}

Ge ng 12-bit sample codes from 16-bit sample values

A 12-bit sample code is stored in the most significant bits (MSB) of each 16-bit sample value,
so right-shift each 16-bit value by 4 (or divide by 16) to obtain the 12-bit sample code. In the
example above, the 16-bit sample value 0x7FE0 right-shifted by four results in the 12-bit
sample code 0x7FE, or 2046 decimal.

16-bit sample value in decimal 32736


16-bit sample value in hex 7FE0
16-bit sample value in binary 0111 1111 1110 0000
12-bit sample code from MSBs of 16-bit value 0111 1101 1110
12-bit sample code in hex 7FE
12-bit sample code in decimal 2046

©2008-2021 Alazar Technologies Inc. 61


ATS-SDK Documenta on, Release 7.5.0

Conver ng unsigned 12-bit sample codes to volts

An unsigned code of 2048 (0x800) represents ~0V input voltage, 4095 (0xFFF) represents a
positive full-scale input voltage, and 0 represents a negative full-scale input voltage. The fol-
lowing table illustrates how unsigned 12-bit sample codes map to values in volts according
to the full-scale input range of the input channel.

Hex value Frac on of input range Volts for ±100 mV range Volts for ±1 V range
0x000 -100% -100 mV -1 V
0x400 -50% -50 mV -.5 V
0x800 0% 0V 0V
0xC00 +50% 50 mV +.5 V
0xFFF +100% +100 mV +1 V

The following code fragment demonstrates how to convert a 2-byte word containing an
unsigned 12-bit sample code to in volts:

double SampleToVoltsU12(U16 sampleValue, double inputRange_volts)


{
// Right-shift 16-bit sample word by 4 to get 12-bit sample code
int bitShift = 4;
U16 sampleCode = sampeValue >> bitShift;
// AlazarTech digitizers are calibrated as follows
int bitsPerSample = 12;
double codeZero = (1 << (bitsPerSample - 1)) - 0.5;
double codeRange = (1 << (bitsPerSample - 1)) - 0.5;
// Convert sample code to volts
double sampleVolts = inputRange_volts *
((double) (sampleCode - codeZero) / codeRange);
return sampleVolts;
}

Conver ng signed 12-bit sample codes to volts

A signed code of 0 represents ~0V input voltage, 2047 (0x7FF) represents a positive full-
scale input voltage, and -2048 (0x801) represents a negative full-scale input voltage. The
following table illustrates how signed 12-bit sample codes map to values in volts according
to the full-scale input range of the input channel.

Hex value Frac on of input range Volts for ±100 mV range Volts for ±1 V range
0x801 -100% -100 mV -1 V
0xC00 -50% -50 mV -.5 V
0x000 0% 0V 0V
0x400 +50% 50 mV +.5 V
0x7FF +100% +100 mV +1 V

The following code fragment shows how to convert a 2-byte sample word containing a

62 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

signed 12-bit sample code to in volts:

double SampleToVoltsS12(S16 sampleValue, double inputRange_volts)


{
// Right-shift 16-bit sample value by 4 to get 12-bit sample code
int bitShift = 4;
U16 sampleCode = sampleValue >> bitShift;
// AlazarTech digitizers are calibrated as follows
int bitsPerSample = 12;
double codeZero = 0;
double codeRange = (1 << (bitsPerSample - 1)) - 1;
// Convert sample code to volts
double sampleVolts = inputRange_volts *
((double) (sampleCode - codeZero) / codeRange);
return sampleVolts;
}

14-bits per sample

Ge ng 2-byte sample values from the buffer

The hexadecimal editor view below displays the first 128-bytes of data in a buffer from a
14-bit digitizer such as the ATS460 and ATS9440.

00000 4C 7F EC 7f 3c 80 98 80 D0 80 24 81 7C 81 B4 81
00010 3C 82 B4 82 A8 82 60 83 9C 83 14 84 40 84 88 84
00020 E0 84 50 85 D0 85 FC 85 2C 86 B0 86 10 87 56 87
00030 4C 7F EC 7f 3c 80 98 80 D0 80 24 81 7C 81 B4 81
00040 3C 82 B4 82 A8 82 60 83 9C 83 14 84 40 84 88 84
00050 E0 84 50 85 D0 85 FC 85 2C 86 B0 86 10 87 56 87
00060 4C 7F EC 7f 3c 80 98 80 D0 80 24 81 7C 81 B4 81
00070 E0 84 50 85 D0 85 FC 85 2C 86 B0 86 10 87 56 87

Each sample value occupies a 2-bytes in the buffer, so the figure displays 64 sample values
(128 bytes / 2 bytes per sample). The first 2 bytes in the buffer, shown highlighted, are 0x4C
and 0x7F. Two-byte sample values are stored in little-endian byte order in the buffer, so the
first sample value in the buffer is 0x7F4C. The following code fragment demonstrates how
to access each 16-bit sample value in a buffer:

U16 *pSamples = (U16*) buffer;


for (U32 sample = 0; sample < samplesPerBuffer; sample++) {
U16 sampleValue = *pSamples++;
printf("sample value = %04X\n", sampleValue);
}

©2008-2021 Alazar Technologies Inc. 63


ATS-SDK Documenta on, Release 7.5.0

Ge ng 14-bit sample codes from 16-bit sample values

A 14-bit sample code is stored in the most significant bits of each 16-bit sample value in
the buffer, so right-shift each 16-bit value by 2 (or divide by 4) to obtain the 14-bit sample
code. In the example above, the 16-bit value 0x7F4C right-shifted by two results in the 14-bit
sample code 0x1FD3, or 8147 decimal.

16-bit sample value in decimal 32588


16-bit sample value in hex 7F4C
16-bit sample value in binary 0111 1111 0100 1100
14-bit sample code from MSBs of 16-bit sample value 01 1111 1101 0011
14-bit sample code in hex 1FD3
14-bit sample code in decimal 8147

Conver ng unsigned 14-bit sample codes to volts

An unsigned code of 8192 (0x2000) represents ~0V input voltage, 16383 (0x3FFF) represents
a positive full-scale input voltage, and 0 represents a negative full-scale input voltage. The
following table illustrates how unsigned 14-bit sample codes map to values in volts accord-
ing to the full-scale input range of an input channel.

Hex value Frac on of input range Volts for ±100 mV range Volts for ±1 V range
0x0000 -100% -100 mV -1 V
0x1000 -50% -50 mV -.5 V
0x2000 0% 0V 0V
0x3000 +50% 50 mV +.5 V
0x3FFF +100% +100 mV +1 V

The following code fragment demonstrates how to convert a 2-byte sample value containing
an unsigned 14-bit sample code to in volts:

double SampleToVoltsU14(U16 sampleValue, double inputRange_volts)


{
// Right-shift 16-bit sample word by 2 to get 14-bit sample code
int bitShift = 2;
U16 sampleCode = sampleValue >> bitShift;
// AlazarTech digitizers are calibrated as follows
int bitsPerSample = 14;
double codeZero = (1 << (bitsPerSample - 1)) - 0.5;
double codeRange = (1 << (bitsPerSample - 1)) - 0.5;
// Convert sample code to volts
double sampleVolts = inputRange_volts *
((double) (sampleCode - codeZero) / codeRange);
return sampleVolts;
}

64 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Conver ng signed 14-bit sample codes to volts

A signed code of 0 represents ~0V input voltage, 8191 (0x1FFF) represents a positive full-
scale input voltage, and –8192 (0x2000) represents a negative full-scale input voltage. The
following table illustrates how signed 14-bit sample codes map to values in volts depending
on the full-scale input range of the input channel.

Hex value Frac on of input range Volts for ±100 mV range Volts for ±1 V range
0x2001 -100% -100 mV -1 V
0x3000 -50% -50 mV -.5 V
0x0000 0% 0V 0V
0x1000 +50% 50 mV +.5 V
0x1FFF +100% +100 mV +1 V

The following code fragment demonstrates how to convert a 2-byte sample value containing
a signed 14-bit sample code to in volts:

double SampleToVoltsS14(S16 sampleValue, double inputRange_volts)


{
// Right-shift 16-bit sample word by 2 to get 14-bit sample code
int bitShift = 2;
U16 sampleCode = sampleValue >> bitShift;
// AlazarTech digitizers are calibrated as follows
int bitsPerSample = 14;
double codeZero = 0;
double codeRange = (1 << (bitsPerSample - 1)) - 1;
// Convert sample code to volts
double sampleVolts = inputRange_volts *
((double) (sampleCode - codeZero) / codeRange);
return sampleVolts;
}

16-bit per sample

Ge ng 2-byte sample values from the buffer

The hexadecimal editor view below displays the first 128-bytes of data in a buffer from a
16-bit digitizer such as the ATS660, ATS9462, ATS9625, or ATS9626.

00000 14 80 FB 7F FB 7F 08 80 FB 7F 00 80 02 80 ED 7F
00010 0B 80 FF 7F F8 7F 0B 80 09 80 0E 80 F3 7F FE 7F
00020 14 80 FB 7F FB 7F 08 80 FB 7F 00 80 02 80 ED 7F
00030 0B 80 FF 7F F8 7F 0B 80 09 80 0E 80 F3 7F FE 7F
00040 14 80 FB 7F FB 7F 08 80 FB 7F 00 80 02 80 ED 7F
00050 0B 80 FF 7F F8 7F 0B 80 09 80 0E 80 F3 7F FE 7F
00060 14 80 FB 7F FB 7F 08 80 FB 7F 00 80 02 80 ED 7F
00070 14 80 FB 7F FB 7F 08 80 FB 7F 00 80 02 80 ED 7F

©2008-2021 Alazar Technologies Inc. 65


ATS-SDK Documenta on, Release 7.5.0

Each 16-bit sample value occupies 2 bytes in the buffer, so the figure displays 64 sample
values (128 bytes / 2 bytes per sample). The first 2 bytes in the buffer are 0x14 and 0x80.
Two-byte samples values are stored in little-endian byte order in the buffer, so the first
sample value is 0x8014. The following code fragment demonstrates how to access each
16-bit sample value in a buffer:

U16 *pSamples = (U16*)buffer;


for (U32 sample = 0; sample < samplesPerBuffer; sample++)
{
U16 sampleValue = * pSamples++;
printf("sample value = %04X\n", sampleValue);
}

Ge ng 16-bit sample codes from 16-bit sample values

A 16-bit sample code is stored in each 16-bit sample value in the buffer. In the example
above, the first sample code is 0x8014, or 32788 decimal.

Conver ng unsigned 16-bit sample codes to volts

An unsigned code of 32768 (0x8000) represents ~0V input voltage, 65535 (0xFFFF) repre-
sents a positive full-scale input voltage, and 0 represents a negative full-scale input voltage.
The following table illustrates how unsigned 16-bit sample codes map to values in volts
according to the full-scale input range of an input channel.

Hex value Frac on of input range Volts for ±100 mV range Volts for ±1 V range
0x0000 -100% -100 mV -1 V
0x4000 -50% -50 mV -.5 V
0x8000 0% 0V 0V
0xC000 +50% 50 mV +.5 V
0xFFFF +100% +100 mV +1 V

The following code fragment demonstrates how to convert a 2-byte sample value containing
an unsigned 16-bit sample code to in volts:

double SampleToVoltsU16(U16 sampleValue, double inputRange_volts)


{
// AlazarTech digitizers are calibrated as follows
double codeZero = (double) USHRT_MAX/2;
double codeRange = (double) USHRT_MAX/2;
// Convert sample code to volts
double sampleVolts = inputRange_volts *
((double) (sampleValue - codeZero) / codeRange);
return sampleVolts;
}

66 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Conver ng signed 16-bit sample codes to volts

A signed code of 32767 (0x7FFF) represents a positive full-scale input voltage, 0 represents
~0V input voltage, and –32768 (0x8000) represents a negative full-scale input voltage. The
following table illustrates how signed 16-bit sample codes map to values in volts according
to the full-scale input range of the input channel:

Hex value Frac on of input range Volts for ±100 mV range Volts for ±1 V range
0x8001 -100% -100 mV -1 V
0xC000 -50% -50 mV -.5 V
0x0000 0% 0V 0V
0x4000 +50% 50 mV +.5 V
0x7FFF +100% +100 mV +1 V

The following code fragment demonstrates how to convert a 2-byte sample word containing
a signed 16-bit sample code to in volts:

double SampleToVoltsS16(S16 sampleValue, double inputRange_volts)


{
// AlazarTech digitizers are calibrated as follows
double codeZero = 0;
double codeRange = SHRT_MAX;
// Convert sample code to volts
double sampleVolts = inputRange_volts *
((double) (sampleCode - codeZero) / codeRange);
return sampleVolts;
}

3.5.2 Saving binary files

If an application saves sample data to a binary data file for later processing, it may be pos-
sible to improve disk write speeds by considering the following recommendations.

C/C++ applica ons

If the application is written in C/C++ and is running under Windows, use the Win-
dows CreateFile API with the FILE_FLAG_NO_BUFFERING flag for file I/O, if possible. Se-
quential disk write speeds are often substantially higher when this option is selected.
See “%ATS_SDK_DIR%\Samples\DualPort\TS_DisableFileCache” for a sample program that
demonstrates how to use this API to stream data to disk.

©2008-2021 Alazar Technologies Inc. 67


ATS-SDK Documenta on, Release 7.5.0

LabVIEW applica ons

If the application is written in LabVIEW, or another high-level programming environment,


then consider using the AlazarCreateStreamFile() API function. This function creates a bi-
nary data file, and enables the API to save each buffer received during an AutoDMA acqui-
sition to this file. The API uses high-performance disk I/O functions that would be difficult
to implement in high-level environments like LabVIEW. As a result, it allows an application
in such an environment to perform high-performance disk streaming with a single addi-
tional function call. The following code fragment outlines how to write a disk streaming
application using AlazarCreateStreamFile():

// Allow the API to allocate and manage AutoDMA buffers


flags |= ADMA_ALLOC_BUFFERS;

// Configure the board to make an AutoDMA acquisition


AlazarBeforeAsyncRead(
handle, // HANDLE -- board handle
channelMask, // U32 -- enabled channel mask
-(long)preTriggerSamples, // long -- trigger offset
samplesPerRecord, // U32 -- samples per record
recordsPerBuffer, // U32 -- records per buffer
recordsPerAcquisition, // U32 -- records per acquisition
flags // U32 -- AutoDMA mode and options
);

// Create a binary data file, and enable the API save each
// AutoDMA buffer to this file.
AlazarCreateStreamFile(handle, "data.bin");

// Arm the board to begin the acquisition


AlazarStartCapture(handle);

// Wait for each buffer in the acquisition to be filled


RETURN_CODE retCode = ApiSuccess;
while (retCode == ApiSuccess) {
// Wait for the board to receive sufficient trigger
// events to fill an internal buffer.
// The API will save the buffer to a binary data file,
// but will not copy any data into our buffer.
retCode =
AlazarWaitNextAsyncBufferComplete(
handle, // HANDLE -- board handle
NULL, // void* -- buffer to receive data
0, // U32 -- bytes to copy into buffer
timeout_ms // U32 -- time to wait for buffer
);
}

// Abort the acquisition and release resources.


// This function must be called after an acquisition.
AlazarAbortAsyncRead(boardHandle);

68 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

See “%ATS_SDK_DIR%\Samples\DualPort\CS_CreateStreamFile” for a full sample program


that demonstrates how to stream sample data to disk using AlazarCreateStreamFile().

©2008-2021 Alazar Technologies Inc. 69


ATS-SDK Documenta on, Release 7.5.0

70 ©2008-2021 Alazar Technologies Inc.


CHAPTER

FOUR

ALAZARDSP API DOCUMENTATION

This document presents the AlazarDSP API that allows accessing the on-board digital signal
processing (DSP) features provided with some AlazarTech digitizers. Knowledge of the ATS-
SDK API is required to take full advantage of the information presented here.

4.1 Introduc on

4.1.1 On-FPGA FFT Overview

The first DSP module to make it into AlazarDSP is a Fast Fourier Transform (FFT) block im-
plemented in ATS9350, ATS9351, ATS9352, ATS9353, ATS9360, ATS9370, ATS9371 and ATS9373. This
is a very versatile module that allows its users to compute the Fourier Transform of the in-
put signal acquired on channel A, and to retrieve the processed data in a variety of output
formats. The acquired records can be padded then mutiplied with a complex window func-
tion before going in the FFT processing block. The resulting data can optionaly be scaled to
get its logarithm. The nature of the output data can be chosen (amplitude, real, imaginary),
and it is then possible to set the output format from a variety of combinations (floating
point, 32-bit unsigned integer, etc.). Lastly, it is possible to get at the output either FFT data,
raw (time domain) data or both. The following diagram is a high-level overview of the FFT
processing module.

71
ATS-SDK Documenta on, Release 7.5.0

4.1.2 General Programming Concepts

All the functions from the AlazarDSP module are defined in AlazarDSP.h, and are imple-
mented in the usual ATSApi library (ATSApi.dll under Windows, and libATSApi.so under
Linux).
Function are prefixed either with AlazarDSP if they apply to any DSP block, or by AlazarFFT
if they are specific to fast Fourier transform modules.
The AlazarDSP API introduces a new type called dsp_module_handle, which represents a DSP
module within a digitizer. Depending on their scope, function calls either require a board
or a DSP module handle to be passed.

Note: The AlazarDSP functions must be used in the context of AutoDMA NPT applications.

4.1.3 Transi on From Time-Domain Acquisi ons

This section details all the steps that are required to take a working AutoDMA NPT program
and turn it into a FFT program. These code samples can be found in AlazarTech’s ATS-SDK
Function calls to the AlazarTech API are usually split into two categories: board configura-
tion and data acquisition. This is best seen in the code samples provided with the ATS-SDK,
where this separation is shown by sub-routines. Most of the AlazarDSP function calls fall
into the second category. This means that the board configuration routine of the existing
code samples is left mostly untouched.
Programs that use the AlazarDSP API need to get the handle of the DSP module they want
to use. This is done by calling AlazarDSPGetModules(). Information about the DSP module
can be retrieved at any time using AlazarDSPGetInfo().
The board configuration section is left untouched when compared to a standard AutoDMA
NPT acquisition.
In the data acquisition section, the following changes must be made:
1. AlazarSetRecordSize() is not called. This function is called internally by AlazarFFT-
Setup().
2. AlazarFFTSetup() is called before AlazarBeforeAsyncRead() and before allocating the
DMA buffers. This is due to the fact that the number of bytes of data returned by
the FFT engine may vary from one mode to the next, e.g. U16 log of amplitude output,
U32 real part, etc. AlazarFFTSetup() returns the effective number of bytes per record
that need to be allocated and passed to AlazarBeforeAsyncRead()
3. AlazarBeforeAsyncRead() is called by passing:
a. The number of bytes per record to the fourth parameter (SamplesPerRecord)
b. 0x7FFFFFFF to RecordsPerAcquisition
4. AlazarWaitAsyncBufferComplete() is replaced with AlazarDSPGetBuffer().

72 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

5. AlazarAbortAsyncRead() is replaced with AlazarDSPAbortCapture().

4.2 Detailed Descrip on

4.2.1 DSP Module Varia ons

Features offered by DSP processing modules can vary from one board to another. An ex-
ample of such variation is the maximum record size, which is generally lower on ATS9350
than on other board models. In order to query these information at runtime, AlazarDSP
offers the AlazarDSPGetInfo() function. A generic interface to retrieve parameters has also
been added with AlazarDSPGetParameterU32(). Each call to this function allows to retrieve
one attribute of a DSP module. Available attributes to query are listed in DSP_PARAMETERS.
In addition, FFT module have specific parameters that are not indicated by AlazarDSPGet-
Info(). For these modules, another introspection method is AlazarFFTGetMaxTriggerRe-
peatRate(). The maximum FFT input length can be read from the maxLength output param-
eter of AlazarDSPGetInfo().

4.2.2 FFT Module Output Data

The output data format of the FFT module is determined by the outputFor-
mat parameter to AlazarFFTSetup(). This parameter can be any element of the
FFT_OUTPUT_FORMAT enumeration except FFT_OUTPUT_FORMAT_RAW_PLUS_FFT, optionnaly OR’ed
with FFT_OUTPUT_FORMAT_RAW_PLUS_FFT. The meaning of each element is described in
FFT_OUTPUT_FORMAT.
If the RAW + FFT mode is selected, a number of samples that correspond to the FFT length
is prepended to each record during the output. These samples contain the acquired time-
domain data in U16 format, followed with padding to bring the number of samples to the
FFT input length.
On the board, the Fourier Transform output is a 53-bit unsigned integer that gets converted
in various blocks to match the requested output format. Along the conversion, it is possible
to set a scaling a slicing parameter. These values are set to sane default in AlazarFFTSetup().
It is possible however for users to change these values manually, using the AlazarFFT-
SetScalingAndSlicing() function. The block diagram below shows where the conversions
happen.

©2008-2021 Alazar Technologies Inc. 73


ATS-SDK Documenta on, Release 7.5.0

4.2.3 Background Subtrac on

Starting with version 4.6, the on-FPGA FFT module offers a background subtraction feature.
A record to subtract is downloaded on the board with AlazarFFTBackgroundSubtractionSe-
tRecordS16(), and the feature is activated by AlazarFFTBackgroundSubtractionSetEnabled().
Once background subtraction is enabled, the background is subtracted to all acquired time-
domain records before they are sent in the FFT processing module.
It is not necessary to re-download the background record in between multiple acquisitions
in the same program. The dowloaded record remains on the board. On the other hand, the
default background record should not be assumed to be made of zeros. As the values can
remain in the board, even after a reboot of the computer.
For 12-bit digitizers, the record is downloaded at 16 bits per sample, but only the 12 most
significant bits are actually used. The 4 least significant bits are discarded. This behaviour
is consistent with the way the boards acquire and send data back to user applications.

74 ©2008-2021 Alazar Technologies Inc.


CHAPTER

FIVE

ADVANCED TOPICS

5.1 External clock issues for OCT applica ons

The external clocking feature of AlazarTech boards is commonly used in Optical Coherence
Tomography (OCT) applications, where swept laser sources generate a signal to be used for
clocking the acquisition. However, in some cases the external clock signal does not meet
the requirements of the digitizers, which can lead to various issues. This section discusses
the steps that need to be taken to diagnose and troubleshoot external clock problems.

5.1.1 Diagnose external clock issues

External clock issues can be of two natures; trigger jumps, or unexpected (glitchy) ac-
quired data. These issues can also arise as the result of a board misconfiguration (bad
record length, bad trigger configuration…). Before proceeding with the external clock trou-
bleshooting, you must ensure that the external clock is indeed the cause of your problems.
One way to do that is to make sure that your acquisition works fine when using the internal
clock. Another way is to reproduce your acquisition configuration in AlazarDSO, and make
sure that the problem also shows up there. Once having made sure that the external clock
is the issue, the next step is to identify the problematic regions of the signal. To do this,
please acquire a few record acquisition cycles (laser sweeps) with a high speed oscilloscope
(ideally 20GS/s, 4GHz), and to send the results to us.

75
ATS-SDK Documenta on, Release 7.5.0

Fig. 1: External Clock Measurement

Here is an example of an external clock analysis plot, annotated to show the problem:

76 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Fig. 2: Example of external clock analysis

5.1.2 Using AlazarOCTIgnoreBadClock() to solve external clock issues

Some AlazarTech digitizers support a feature called OCT Ignore Bad Clock, which can be
used to make the board ignore the external clock signal for a given period of time. This
can be used if the external clock signal is bad when the board is not acquiring data. Note
that the external clock signal must be good when trigger events are received, and when the
board needs to acquire data.
In order to activate OCT Ignore Bad Clock, customers must first measure how long the ex-
ternal clock signal is good1 after the trigger event, and how long it is bad. For example, the
data of the Example of external clock analysis figure shows that the clock signal stays good
1
The external clock signal is considered good when it meets the digitizer’s specified limits in terms of am-
plitude and frequency. The limits can be found on the digitizer’s datasheet.

©2008-2021 Alazar Technologies Inc. 77


ATS-SDK Documenta on, Release 7.5.0

for ~7.5µs, then goes bad for ~2µs.


The values of “good clock duration” and “bad clock duration” must add up to less than the
trigger period, to ensure that the board is back to accepting the external clock before each
trigger event. As an example, the data of the Example of external clock analysis shows that
the trigger period is 10µs. This is compatible with choosing values of 7.5µs and 2µs for good
and bad clock durations respectively.
Once these values are known, the only change that is required to add OCT Ignore Bad Clock
to an existing application is to call AlazarOCTIgnoreBadClock() in the board configuration
section of the application.

78 ©2008-2021 Alazar Technologies Inc.


CHAPTER

SIX

API REFERENCE

Board configuration functions:


• AlazarConfigureAuxIO()
• AlazarConfigureLSB()
• AlazarConfigureSampleSkipping()
• AlazarInputControl()
• AlazarInputControlEx()
• AlazarOCTIgnoreBadClock()
• AlazarSetADCBackgroundCompensation()
• AlazarSetBWLimit()
• AlazarSetCaptureClock()
• AlazarSetExternalClockLevel()
• AlazarSetExternalTrigger()
• AlazarSetParameter()
• AlazarSetParameterLL()
• AlazarSetParameterUL()
• AlazarSetTriggerDelay()
• AlazarSetTriggerOperation()
• AlazarSetTriggerOperationForScanning()
• AlazarSetTriggerTimeOut()
• AlazarSleepDevice()
Generic acquisition functions:
• AlazarResetTimeStamp()
• AlazarSetRecordSize()
• AlazarStartCapture()
Dual-port acquisition functions:
• AlazarAbortAsyncRead()
• AlazarAllocBufferU16()
• AlazarAllocBufferU16Ex()
• AlazarAllocBufferU8()
• AlazarAllocBufferU8Ex()
• AlazarAsyncRead()
• AlazarBeforeAsyncRead()
• AlazarCreateStreamFileA()

79
ATS-SDK Documenta on, Release 7.5.0

• AlazarCreateStreamFileW()
• AlazarFreeBufferU16()
• AlazarFreeBufferU16Ex()
• AlazarFreeBufferU8()
• AlazarFreeBufferU8Ex()
• AlazarPostAsyncBuffer()
• AlazarWaitAsyncBufferComplete()
• AlazarWaitNextAsyncBufferComplete()
Single-port acquisition functions:
• AlazarAbortCapture()
• AlazarBusy()
• AlazarConfigureRecordAverage()
• AlazarGetStatus()
• AlazarGetTriggerAddress()
• AlazarGetTriggerTimestamp()
• AlazarGetWhoTriggeredBySystemHandle()
• AlazarGetWhoTriggeredBySystemID()
• AlazarHyperDisp()
• AlazarRead()
• AlazarReadEx()
• AlazarSetRecordCount()
• AlazarTriggered()
DSP functions:
• AlazarDSPAbortCapture()
• AlazarDSPGenerateWindowFunction()
• AlazarDSPGetBuffer()
• AlazarDSPGetInfo()
• AlazarDSPGetModules()
• AlazarDSPGetNextBuffer()
• AlazarDSPGetParameterFloat()
• AlazarDSPGetParameterS32()
• AlazarDSPGetParameterU32()
• AlazarDSPSetParameterFloat()
• AlazarDSPSetParameterS32()
• AlazarDSPSetParameterU32()
on-FPGA FFT functions:
• AlazarFFTBackgroundSubtractionGetRecordS16()
• AlazarFFTBackgroundSubtractionSetEnabled()
• AlazarFFTBackgroundSubtractionSetRecordS16()
• AlazarFFTGetMaxTriggerRepeatRate()
• AlazarFFTSetScalingAndSlicing()
• AlazarFFTSetup()
• AlazarFFTSetWindowFunction()
Miscellaneous functions:

80 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• AlazarBoardsFound()
• AlazarBoardsInSystemByHandle()
• AlazarBoardsInSystemBySystemID()
• AlazarCoprocessorDownloadA()
• AlazarCoprocessorDownloadW()
• AlazarCoprocessorRegisterRead()
• AlazarCoprocessorRegisterWrite()
• AlazarErrorToText()
• AlazarExtractFFTNPTFooters()
• AlazarExtractTimeDomainNPTFooters()
• AlazarForceTrigger()
• AlazarForceTriggerEnable()
• AlazarGetBoardBySystemHandle()
• AlazarGetBoardBySystemID()
• AlazarGetBoardKind()
• AlazarGetBoardRevision()
• AlazarGetCPLDVersion()
• AlazarGetChannelInfo()
• AlazarGetChannelInfoEx()
• AlazarGetDriverVersion()
• AlazarGetFPGAVersion()
• AlazarGetMaxRecordsCapable()
• AlazarGetParameter()
• AlazarGetParameterLL()
• AlazarGetParameterUL()
• AlazarGetSDKVersion()
• AlazarGetSystemHandle()
• AlazarNumOfSystems()
• AlazarQueryCapability()
• AlazarQueryCapabilityLL()
• AlazarSetLED()
Deprecated functions:
• AlazarOpen
• AlazarClose
• AlazarExtractNPTFooters

6.1 AlazarAbortAsyncRead

6.1.1 Func on Syntax

RETURN_CODE AlazarAbortAsyncRead(HANDLE handle)


Aborts a dual-port acquisition, and any in-process DMA transfers.

Remark If you have started an acquisition and/or posted DMA buffers to a board,
you must call AlazarAbortAsyncRead() before your application exits. If you do

©2008-2021 Alazar Technologies Inc. 81


ATS-SDK Documenta on, Release 7.5.0

not, when your program exists, Microsoft Windows may stop with a blue screen
error number 0x000000CB (DRIVER_LEFT_LOCKED_PAGES_IN_PROCESS). Linux may leak
the memory used by the DMA buffers.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Note This function is part of the dual-port API. It should be used only in this context.
To abort single-port acquisitions using, see AlazarAbortCapture().
Parameters
• [in] handle: Handle to board

6.1.2 LabVIEW Block Diagram

6.2 AlazarAbortCapture

6.2.1 Func on Syntax

RETURN_CODE AlazarAbortCapture(HANDLE handle)


Abort an acquisition to on-board memory.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Note This function is part of the single-port API. It should be used only in this context.
To abort dual-port acquisitions, see AlazarAbortAsyncRead().
Parameters
• [in] handle: Board handle

6.2.2 LabVIEW Block Diagram

82 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.3 AlazarAllocBufferU16

6.3.1 Func on Syntax

U16 *AlazarAllocBufferU16(HANDLE handle, U32 sampleCount)


Allocates a buffer for DMA transfer for an 16-bit digitizer.

Return If the function is successful, it returns the base address of a page-aligned


buffer in the virtual address space of the calling process. If it fails, it returns
NULL.
Remark The buffer must be freed using AlazarFreeBufferU16()
Parameters
• [in] handle: Handle to board
• [in] sampleCount: Buffer size in samples

6.4 AlazarAllocBufferU16Ex

6.4.1 Func on Syntax

U16 *AlazarAllocBufferU16Ex(HANDLE handle, U64 sampleCount)


This function acts like AlazarAllocBufferU16() and additionally allows allocation of a
buffer over 4GS for DMA transfer for an 16-bit digitizer.

Return If the function is successful, it returns the base address of a page-aligned


buffer in the virtual address space of the calling process. If it fails, it returns
NULL.
Remark The buffer must be freed using AlazarFreeBufferU16Ex()
Parameters
• [in] handle: Handle to board
• [in] sampleCount: Buffer size in samples

6.5 AlazarAllocBufferU8

6.5.1 Func on Syntax

U8 *AlazarAllocBufferU8(HANDLE handle, U32 sampleCount)


Allocates a buffer for DMA transfer for an 8-bit digitizer.

©2008-2021 Alazar Technologies Inc. 83


ATS-SDK Documenta on, Release 7.5.0

Return If the function is successful, it returns the base address of a page-aligned


buffer in the virtual address space of the calling process. If it fails, it returns
NULL.
Remark The buffer must be freed using AlazarFreeBufferU8()
Parameters
• [in] handle: Handle to board
• [in] sampleCount: Buffer size in samples

6.6 AlazarAllocBufferU8Ex

6.6.1 Func on Syntax

U8 *AlazarAllocBufferU8Ex(HANDLE handle, U64 sampleCount)


This function acts like AlazarAllocBufferU8() and additionally allows allocation of a
buffer over 4GS for DMA transfer for an 8-bit digitizer.

Return If the function is successful, it returns the base address of a page-aligned


buffer in the virtual address space of the calling process. If it fails, it returns
NULL.
Remark The buffer must be freed using AlazarFreeBufferU8Ex()
Parameters
• [in] handle: Handle to board
• [in] sampleCount: Buffer size in samples

6.7 AlazarAsyncRead

6.7.1 Func on Syntax

RETURN_CODE AlazarAsyncRead(HANDLE handle, void *buffer, U32 bytesToRead,


OVERLAPPED *overlapped)
Adds a buffer to the end of a list of available buffers to be filled by the board. When
the board receives sufficient trigger events to fill the buffer, the event in the OVERLAPPED
will be set to the signaled state.
You must call AlazarBeforeAsyncRead() before calling AlazarAsyncRead().
The bytesToRead parameter must be equal to the product of the number of bytes per
record, the number of records per buffer and the number of enabled channels. If
record headers are enabled, the number of bytes per record must include the size of
the record header (16 bytes).

84 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Return If the function succeeds in adding the buffer to end of the list of buffers avail-
able to be filled by the board, it returns ApiDmaPending. When the board fills the
buffer, the event in the OVERLAPPED structure is set to the signaled state.
Return If the function fails because the board overflowed its on board memory, it re-
turns ApiBufferOverflow. The board may overflow its on board memory because
the rate at which it is acquiring data is faster than the rate at which it is transfer-
ring data from on-board memory to host memory. If this is the case, try reducing
the sample rate, number of enabled channels, or amount of time spent processing
each buffer.
Return If the function fails because the buffer is too large for the driver or operat-
ing system to prepare for scatter-gather DMA transfer, it returns ApiLockAnd-
ProbePagesFailed. Try reducing the size of each buffer, or reducing the number
of buffers queued by the application.
Return If the function fails for some other reason, it returns an error code that indi-
cates the reason that it failed. See RETURN_CODE for more information.
Remark AlazarAsyncRead() is only available under Windows
Warning You must call AlazarAbortAsyncRead() before your application exits if you
have called AlazarAsyncRead() and buffers are pending.
Parameters
• [in] handle: Handle to board
• [in] buffer: Pointer to a buffer to receive sample data from the digitizer
board
• [in] bytesToRead: Number of bytes to read from the board
• [in] overlapped: Pointer to an OVERLAPPED structure. The event in thestructure
is set to the signaled state when the read operation completes.

6.8 AlazarBeforeAsyncRead

6.8.1 Func on Syntax

RETURN_CODE AlazarBeforeAsyncRead(HANDLE handle, U32 channelSelect, long trans-


ferOffset, U32 transferLength, U32 recordsPer-
Buffer, U32 recordsPerAcquisition, U32 flags)
Configure a board to make an asynchronous AutoDMA acquisition.
In non-DSP mode, when record headers are not enabled, the total number of bytes per
AutoDMA buffer is given by:

bytesPerBuffer = bytesPerSample * samplesPerRecord * recordsPerBuffer;

When record headers are enabled, the formula changes to:

©2008-2021 Alazar Technologies Inc. 85


ATS-SDK Documenta on, Release 7.5.0

bytesPerBuffer = (16 + bytesPerSample * samplesPerRecord) *


recordsPerBuffer;

For best performance, AutoDMA parameters should be selected so that the total num-
ber of bytes per buffer is greater than about 1 MB. This allows for relatively long DMA
transfer times compared to the time required to prepare a buffer for DMA transfer
and re-arm the DMA engines.
ATS460, ATS660 and ATS860 digitizer boards require that AutoDMA parameters be
selected so that the total number of bytes per buffer is less than 4 MB. Other boards
require that the total number of bytes per buffer be less than 64 MB. It is however
recommended to keep the DMA buffer size below 16 MB for all boards.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark transferLength must meet certain alignment criteria which depend on the
board model and the acquisition type. Please refer to board-specific documenta-
tion for more information.
Remark recordsPerBuffer must be set to 1 in continuous streaming and triggered
streaming AutoDMA modes.
Remark recordsPerAcquisition must be 0x7FFFFFFF in Continuous Streaming and Trig-
gered Streaming modes. The acquisition runs continuously until AlazarAbortA-
syncRead() is called. In other modes, it must be either:
• A multiple of recordsPerBuffer
• 0x7FFFFFFF to indicate that the acquisition should continue indefinitely.
Parameters
• [in] handle: Handle to board
• [in] channelSelect: Select the channel(s) to control. This can be one or more
of the channels of ALAZAR_CHANNELS, assembled with the OR bitwise oper-
ator.
• [in] transferOffset: Specify the first sample from each on-board record to
transfer from on-board to host memory. This value is a sample relative to the
trigger position in an on-board record.
• [in] transferLength: Specify the number of samples from each record to
transfer from on-board to host memory. In DSP-mode, it takes the number
of bytes instead of samples. See remarks.
• [in] recordsPerBuffer: The number of records in each buffer. See remarks.
• [in] recordsPerAcquisition: The number of records to acquire during one
acquisition. Set this value to 0x7FFFFFFF to acquire indefinitely until the ac-
quisition is aborted. This parameter is ignored in Triggered Streaming and
Continuous Streaming modes. See remarks.

86 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• [in] flags: Specifies AutoDMA mode and option. Must be one ele-
ment of ALAZAR_ADMA_MODES combined with zero or more element(s) of
ALAZAR_ADMA_FLAGS using the bitwise OR operator.

6.8.2 LabVIEW Block Diagram

6.8.3 Related Enumera ons

enum ALAZAR_ADMA_MODES
AutoDMA acquisition modes. See AlazarBeforeAsyncRead().
Values:
ADMA_TRADITIONAL_MODE = 0x00000000
Acquire multiple records: one per trigger event. Each record may include pre-and
post-trigger samples, and a record header that includes its trigger timestamp. If
a board has on-board memory and sample interleave is not enabled, each buffer
will contain samples organized as follows: R1A, R1B, R2A, R2B ...
If a board does not have on-board memory, or sample interleave is enabled, the
buffer will contain samples organized as follows: R1[AB...], R2[AB...] ...
ADMA_CONTINUOUS_MODE = 0x00000100
Acquire a single, gapless record spanning multiple buffers. Do not wait for trigger
event before starting the acquisition.
If a board has on-board memory and sample interleave is not enabled, each buffer
will contain samples organized as follows: R1A, R1B.
If a board does not have on-board memory, or sample interleave is enabled, the
buffer will contain samples organized as follows: R1[AB...]
ADMA_NPT = 0x00000200
Acquire multiple records: one per trigger event. Each record contains only post-
trigger samples.
If a board has on-board memory and sample interleave is not enabled, each buffer
will contain samples organized as follows: R1A, R2A, ... R1B, R2B ...
If a board does not have on-board memory, or sample interleave is enabled, the
buffer will contain samples organized as follows: R1[AB...], R2[AB...] ...

©2008-2021 Alazar Technologies Inc. 87


ATS-SDK Documenta on, Release 7.5.0

ADMA_TRIGGERED_STREAMING = 0x00000400
Acquire a single, gapless record spanning multiple buffers. Wait for a trigger
event before starting the acquisition.
If a board has on-board memory and sample interleave is not enabled, each buffer
will contain samples organized as follows: R1A, R1B.
If a board does not have on-board memory, or sample interleave is enabled, the
buffer will contain samples organized as follows: R1[AB...]
enum ALAZAR_ADMA_FLAGS
AutoDMA acquisition options. See AlazarBeforeAsyncRead().
Values:
ADMA_EXTERNAL_STARTCAPTURE = 0x00000001
The acquisition only starts when AlazarStartCapture() is called if this flag is set.
Otherwise, it starts before the current function returns.
ADMA_ENABLE_RECORD_HEADERS = 0x00000008
If this flag is set, precede each record in each buffer with a 16-byte header that
includes the record’s trigger timestamp.
Note that this flag can only be used in “traditional” AutoDMA mode. Record head-
ers are not available in NPT, streaming, or triggered streaming modes.
ADMA_ALLOC_BUFFERS = 0x00000020
If this flag is set, the API will allocate and manage a list of DMA buffers. This flag
may be used by LabVIEW, and in other high-level development environments,
where it may be more convenient for the application to let the API manage a list
of DMA buffers, and to receive a copy of data in an application buffer. When this
flag is set, the application must call AlazarWaitNextAsyncBufferComplete() to wait
for a buffer to complete and receive a copy of the data. The application can spec-
ify the number of DMA buffers for the API to allocate by calling AlazarSetParame-
ter with the parameter SETGET_ASYNC_BUFFCOUNT before calling AlazarBefore-
AsyncRead.
ADMA_FIFO_ONLY_STREAMING = 0x00000800
Enable the board to data from its on-FPGA FIFO rather than from on-board mem-
ory. When the flag is set, each buffer contains data organized as follows: R0[ABAB.
..], R1[ABAB...], R2[ABAB] .... That is, each sample from CH A is followed by a
sample from CH B.
When this flag is not set, each record in a buffer contains a contiguous array of
samples for CH A followed by a contiguous array of samples for CH B, where the
record arrangement depends on the acquisition mode. Note that this flag must
be set if your board does not have on-board memory. For example, an ATS9462-
FIFO requires this flag. Also note that this flag must not be set if your board has
on-board memory.
ADMA_INTERLEAVE_SAMPLES = 0x00001000
Enable a board to interleave samples from both digitizer channels in dual-
channel acquisition mode. This results in higher data transfer rates on boards

88 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

that support this option.


Note that this flag has no effect in single channel mode, and is supported by only
PCIe digitizers (except the ATS9462).
When the flag is set, each buffer contains data organized as follows: R0[ABAB...
], R1[ABAB...], R2[ABAB] .... That is, each sample from CH A is followed by a
sample from CH B.
When this flag is not set, each record in a buffer contains a contiguous array of
samples for CH A followed by a contiguous array of samples for CH B, where the
record arrangement depends on the acquisition mode.
ADMA_GET_PROCESSED_DATA = 0x00002000
Enable the API to process each buffer So that the sample data in a buffer is Always
arranged as in NPT mode: R0A, R1A, R2A, ... RB0, R1B, R2B.
If this flag is not set, the data Arrangement in a buffer depends on The acquisition
mode.
LabVIEW and other higher-level Applications may use this flag to Simplify data
processing since all data Buffers will have the same Arrangement independent of
the Acquisition mode.
Note that the ADMA_ALLOC_BUFFERS flag Must also be set to use this option.
ADMA_DSP = 0x00004000
Activates the DSP mode that must be used for using the on-FPGA DSP modules
such as the on-FPGA FFT.
ADMA_ENABLE_RECORD_FOOTERS = 0x00010000
Activate record footers, that are appended to each acquired record. Please note
that this feature is not available on all boards, and can only be activated in NPT
mode.
struct _ALAZAR_HEADER
Traditional Record Header.

Public Members

struct _HEADER0 hdr0


Substructure 0.
struct _HEADER1 hdr1
Substructure 1.
struct _HEADER2 hdr2
Substructure 2.
struct _HEADER3 hdr3
Substructure 3.
struct _HEADER0
Traditional Record Header Substructure 1.

©2008-2021 Alazar Technologies Inc. 89


ATS-SDK Documenta on, Release 7.5.0

Public Members

unsigned int SerialNumber : 18


18-bit serial number of this board as a signed integer
unsigned int SystemNumber : 4
4-bit system identifier number for this board
unsigned int WhichChannel : 1
1-bit input channel of this header. 0 is channel A, 1 is channel B
unsigned int BoardNumber : 4
4-bit board identifier number of this board
unsigned int SampleResolution : 3
3-bit reserved field
unsigned int DataFormat : 2
2-bit reserved field
struct _HEADER1
Traditional Record Header Substructure 1.

Public Members

unsigned int RecordNumber : 24


24-bit index of record in the acquisition
unsigned int BoardType : 8
8-bit board type identifier. See BoardTypes for a list of existing board types.
struct _HEADER2
Traditional Record Header Substructure 2.

Public Members

unsigned int TimeStampLowPart


Lower 32 bits of 40-bit record timestamp.
struct _HEADER3
Traditional Record Header Substructure 3.

90 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Public Members

unsigned int TimeStampHighPart : 8


8-bit field containing the upper part of the 40-bit record timestamp
unsigned int ClockSource : 2
2-bit clock source identifier. See ALAZAR_CLOCK_SOURCES
unsigned int ClockEdge : 1
1-bit clock edge identifier. See ALAZAR_CLOCK_EDGES
unsigned int SampleRate : 7
7-bit sample rate identifier. See ALAZAR_SAMPLE_RATES
unsigned int InputRange : 5
5-bit input range identifier. See ALAZAR_INPUT_RANGES
unsigned int InputCoupling : 2
2-bit input coupling identifier. See ALAZAR_COUPLINGS
unsigned int InputImpedance : 2
2-bit input impedance identifier. See ALAZAR_IMPEDANCES
unsigned int ExternalTriggered : 1
1-bit field set if and only if TRIG IN on this board caused the board to
unsigned int ChannelBTriggered : 1
capture this record.
1-bit field set if and only if CH B on this board caused the board to
unsigned int ChannelATriggered : 1
capture this record.
1-bit field set if and only if CH A on this board caused the board to
unsigned int TimeOutOccurred : 1
capture this record.
1-bit field set if and only if a timeout on a trigger engine on this
unsigned int ThisChannelTriggered : 1
board caused it to capture this record.
1-bit field set if and only if the channel specified by _HEADER0::WhichChannel
caused the

©2008-2021 Alazar Technologies Inc. 91


ATS-SDK Documenta on, Release 7.5.0

6.9 AlazarBoardsFound

6.9.1 Func on Syntax

U32 AlazarBoardsFound(void)
Determine the number of digitizer boards that were detected in all board systems.

Return The total number of digitizer boards detected.


See AlazarNumOfSystems()

6.9.2 LabVIEW Block Diagram

6.10 AlazarBoardsInSystemByHandle

6.10.1 Func on Syntax

U32 AlazarBoardsInSystemByHandle(HANDLE systemHandle)


Return the number of digitizer boards in a board system specified by the handle of its
master board.
If this function is called with the handle of to the master board in a master-slave sys-
tem, it returns the total number of boards in the system.
If this function is called with the handle of an independent board, it returns 1.
If it is called with the handle to a slave in a master-slave system or with an invalid
handle, it returns 0.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.

6.10.2 LabVIEW Block Diagram

92 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.11 AlazarBoardsInSystemBySystemID

6.11.1 Func on Syntax

U32 AlazarBoardsInSystemBySystemID(U32 systemId)


Returns the number of digitizer boards in a board system specified by its system iden-
tifier.
If this function is called with the identifier of a master-slave system, it returns the total
number of boards in the system, including the master.
If this function is called with the identifier of an independent board system, it returns
one.
If this function is called with the identifier of an invalid board system, it returns zero.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] systemId: The system identification number

6.11.2 LabVIEW Block Diagram

6.12 AlazarBusy

6.12.1 Func on Syntax

U32 AlazarBusy(HANDLE handle)


Determines if an acquisition is in progress.

Return If the board is busy acquiring data to on-board memory, this function returns
1. Otherwise, it returns 0.
Note This function is part of the single-port data acquisition API. It cannot be used
with the dual-port AutoDMA APIs.
Parameters
• [in] handle: Board handle

©2008-2021 Alazar Technologies Inc. 93


ATS-SDK Documenta on, Release 7.5.0

6.12.2 LabVIEW Block Diagram

6.13 AlazarConfigureAuxIO

6.13.1 Func on Syntax

RETURN_CODE AlazarConfigureAuxIO(HANDLE handle, U32 mode, U32 parameter)


Configures the AUX I/O connector as an input or output signal.
The AUX I/O connector generates TTL level signals when configured as an output, and
expects TLL level signals when configured as an input.
AUX I/O output signals may be limited by the bandwidth of the AUX output drivers.

Remark The ATS9440 has two AUX I/O connectors: AUX 1 and AUX 2. AUX 1 is config-
ured by firmware as a trigger output signal, while AUX 2 is configured by software
using AlazarConfigureAuxIO(). A firmware update is required to change the op-
eration of AUX 1.
Remark ATS9625 and ATS9626 have two AUX I/O connectors; AUX 1 and AUX 2. AUX
1 is configured by software using AlazarConfigureAuxIO(), while AUX 2 is config-
ured by default as a trigger output signal. A custom user-programmable FGPA
can control the operation of AUX 2 as required by the FPGA designer.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] mode: The AUX I/O mode. Can be selected from ALAZAR_AUX_IO_MODES.
If an output mode is selected, the parameter may be OR’ed with
AUX_OUT_TRIGGER_ENABLE to enable the board to use software trigger
enable. When this flag is set, the board will wait for software to call
AlazarForceTriggerEnable() to generate a trigger enable event; then wait for
sufficient trigger events to capture the records in an AutoDMA buffer; then
wait for the next trigger enable event and repeat.
• [in] parameter: The meaning of this value varies depending on mode. See
ALAZAR_AUX_IO_MODES for more details.

94 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.13.2 LabVIEW Block Diagram

6.13.3 Related Enumera ons

enum ALAZAR_AUX_IO_MODES
Alazar AUX I/O identifiers.
Values:
AUX_OUT_TRIGGER = 0U
Outputs a signal that is high whenever data is being acquired to on-board mem-
ory, and low otherwise. The parameter argument of AlazarConfigureAuxIO() is
ignored in this mode.
AUX_IN_TRIGGER_ENABLE = 1U
Uses the edge of a pulse to the AUX I/O connector as an AutoDMA trigger enable
signal. Please note that this is different from a standard trigger signal. In this
mode, the parameter argument of AlazarConfigureAuxIO() can takes an element
of ALAZAR_TRIGGER_SLOPES, which defines on which edge of the input signal a
trigger enable event is generated.
AUX_OUT_PACER = 2U
Output the sample clock divided by the value passed to the parameter argument
of AlazarConfigureAuxIO(). Please note that the divider must be greater than 2.
AUX_OUT_SERIAL_DATA = 14U
Use the AUX I/O connector as a general purpose digital output. The paramter argu-
ment of AlazarConfigureAuxIO() specifies the TTL output level. 0 means TTL low
level, whereas 1 means TTL high level.
AUX_IN_AUXILIARY = 13U
Configure the AUX connector as a digital input. Call AlazarGetParameter() with
GET_AUX_INPUT_LEVEL to read the digital input level.

6.14 AlazarConfigureLSB

6.14.1 Func on Syntax

RETURN_CODE AlazarConfigureLSB(HANDLE handle, U32 valueLsb0, U32 valueLsb1)


Repurposes unused least significant bits in 12- and 14-bit boards.
12- and 14-bit digitizers return 16-bit sample values per sample by default, with the
actual sample codes stored in the most significant bits. By default, the least significant

©2008-2021 Alazar Technologies Inc. 95


ATS-SDK Documenta on, Release 7.5.0

bits of each sample value are zero-filled. Use this option to use these otherwise unused
bits as digital outputs.
This feature is not available on all boards. See board-specific documentation for more
information.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] valueLsb0: Specifies the signal to output to the least significant bit of each
sample value. Must be one of ALAZAR_LSB.
• [in] valueLsb1: Specifies the signal to output to the least significant bit of each
sample value. Must be one of ALAZAR_LSB.

6.14.2 LabVIEW Block Diagram

6.14.3 Related Enumera ons

enum ALAZAR_LSB
Least significant bit identifiers.
Values:
LSB_DEFAULT = 0
Default LSB setting.
LSB_EXT_TRIG = 1
Use external trigger state as LSB.
LSB_AUX_IN_2 = 2
Use AUX I/O 2 state as LSB.
LSB_AUX_IN_1 = 3
Use AUX I/O 1 state as LSB.

96 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.15 AlazarConfigureRecordAverage

6.15.1 Func on Syntax

RETURN_CODE AlazarConfigureRecordAverage(HANDLE handle, U32 mode, U32 sam-


plesPerRecord, U32 recordsPerAverage,
U32 options)
Configures a digitizer to co-add ADC samples from a specified number of records in
an accumulator record, and transfer accumulator records rather than the ADC sample
values.
When FPGA record averaging is enabled, the digitizer transfers one accumulator
record to host memory after recordsPerAverage trigger events have been captured.
Each accumulator record has interleaved samples from CH A and CH B. FPGA accu-
mulators are 32-bit wide, so each accumulator value occupies 4 bytes in a buffer. The
digitizer transfers multi-byte values in little-endian byte order.
CH A and CH B accumulator records are always transferred to host memory. As a
result, the number of bytes per accumulator record is given by:

samplesPerRecord * 2 (channels) * 4 (bytes per accumulator sample)

The maximum value of recordsPerAverage for 8-bit digitizers is 16777215


Note that recordsPerAverage does not have to be equal to the number of records per
buffer in AutoDMA mode.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark FPGA record averaging is currently supported on the following digitizers:
• ATS9870 with FPGA version 180.0 and above, and driver version 5.9.8 and
above
• AXI9870 with FPGA version 180.0 and above, and driver version 5.9.23 and
above
Note This function is part of the dual-port API. It should be used only in this context.
To abort single-port acquisitions using, see AlazarAbortCapture().
Parameters
• [in] handle: Handle to board
• [in] mode: Averaging mode. Should be one element of ALAZAR_CRA_MODES.
• [in] samplesPerRecord: The number of ADC samples per accumulator record.
• [in] recordsPerAverage: The number of records to accumulate per average.
• [in] options: The averaging options. Can be one of ALAZAR_CRA_OPTIONS.

©2008-2021 Alazar Technologies Inc. 97


ATS-SDK Documenta on, Release 7.5.0

6.15.2 LabVIEW Block Diagram

6.15.3 Related Enumera ons

enum ALAZAR_CRA_MODES
AlazarConfigureRecordAverage() modes.
Values:
CRA_MODE_DISABLE = 0
Disables record average.
CRA_MODE_ENABLE_FPGA_AVE = 1
Enables record average.
enum ALAZAR_CRA_OPTIONS
AlazarConfigureRecordAverage() options.
Values:
CRA_OPTION_UNSIGNED = (0U << 1)
Unsigned data.
CRA_OPTION_SIGNED = (1U << 1)
Signed data.

6.16 AlazarConfigureSampleSkipping

6.16.1 Func on Syntax

RETURN_CODE AlazarConfigureSampleSkipping(HANDLE handle, U32 mode, U32 sam-


pleClocksPerRecord, U16 *sampleSkip-
Bitmap)
Makes the digitizer sub-sample post trigger data in arbitrary, non-uniform intervals.
The application specifies which sample clock edges after a trigger event the digitizer
should use to generate sample points, and which sample clock edges the digitizer
should ignore.
To enable data skipping, first create a bitmap in memory that specifies which sample
clock edges should generate a sample point, and which sample clock edges should be
ignored.

98 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• 1’s in the bitmap specify the clock edges that should generate a sample point. The
total number of 1’s in the bitmap must be equal to the number of post-trigger
samples per record specified in the call to AlazarSetRecordSize().
• 0’s in the bitmap specify the clock edges that should not be used to generate a
sample point.
• The total total number of bits in the bitmap is equal to the number of sample
clocks in one record.

For example, to receive 16 samples from 32 sample clocks where every other sample
clock is ignored, create a bitmap of 32 bits with values { 1 0 1 0 1 0 ... 1 0 }, or {
0x5555, 0x5555 }. Note that 16 of the 32 bits are 1’s.
And to receive 24 samples from 96 sample clocks where data from every 3 of 4 samples
clocks is ignored, create a bitmap of 96 bits with values { 1 0 0 0 1 0 0 0 1 0 0 0 ...
1 0 0 0 }, or in { 0x1111, 0x1111, 0x1111, 0x1111, 0x1111, 0x1111 }. Note that 24 of
the 96 bits are 1’s.
After creating a bitmap, call AlazarConfigureSampleSkipping() with:
• Mode equal to SSM_ENABLE
• SampleClocksPerRecord equal to the total number of sample clocks per record.
• pSampleSkipBitmap with the address of the U16 array.
To disable data skipping, call AlazarConfigureSampleSkipping with Mode equal to
SSM_DISABLE. The SampleClocksPerRecord and pSampleSkipBitmap parameters are
ignored.
Note that data skipping currently is supported by the ATS9371, ATS9373, ATS9360 and
ATS9440. For ATS9440, data skipping only works with post-trigger data acquired at
125 MSPS or 100 MSPS.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] mode: The data skipping mode. 0 means disable sample skipping and 1
means enable sample skipping.
• [in] sampleClocksPerRecord: The number of sample clocks per record. This
value cannot exceed 65536.
• [in] sampleSkipBitmap: An array of bits that specify which sample clock edges
should be used to capture a sample point (value = 1) and which should be
ignored (value = 0).

©2008-2021 Alazar Technologies Inc. 99


ATS-SDK Documenta on, Release 7.5.0

6.16.2 LabVIEW Block Diagram

6.16.3 Related Enumera ons

enum ALAZAR_SAMPLE_SKIPPING_MODES
Data skipping modes. See AlazarConfigureSampleSkipping()
Values:
SSM_DISABLE = 0
Disable sample skipping.
SSM_ENABLE = 1
Enable sample skipping.

6.17 AlazarCoprocessorDownload

AlazarCoprocessorDownload() is a define that points to AlazarCoprocessorDownloadA() on


Linux and on Windows if UNICODE is not defined. If UNICODE is defined on Windows, AlazarCo-
processorDownload() points to AlazarCoprocessorDownloadW(). The two functions only vary by
the fact that they use narrow or wide string types.

6.17.1 Func on Syntax

RETURN_CODE AlazarCoprocessorDownloadA(HANDLE handle, char *fileName, U32 op-


tions)
Downloads a FPGA image in RBF (raw binary file) format to the coprocessor FPGA.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] fileName: Path to RBF file
• [in] options: Download options chosen from
ALAZAR_COPROCESSOR_DOWNLOAD_OPTIONS

RETURN_CODE AlazarCoprocessorDownloadW(HANDLE handle, wchar_t *fileName, U32


options)
Downloads a FPGA image in RBF (raw binary file) format to the coprocessor FPGA.

100 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] fileName: Path to RBF file
• [in] options: Download options chosen from
ALAZAR_COPROCESSOR_DOWNLOAD_OPTIONS

6.17.2 LabVIEW Block Diagram

6.17.3 Related Enumera ons

enum ALAZAR_COPROCESSOR_DOWNLOAD_OPTIONS
Coprocessor download options.
Values:
CPF_OPTION_DMA_DOWNLOAD = 1

6.18 AlazarCoprocessorRegisterRead

6.18.1 Func on Syntax

RETURN_CODE AlazarCoprocessorRegisterRead(HANDLE handle, U32 offset, U32


*value)
Reads the content of a user-programmable FPGA register.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] offset: Register offset
• [out] value: Address of a variable to receive the register’s value

©2008-2021 Alazar Technologies Inc. 101


ATS-SDK Documenta on, Release 7.5.0

6.18.2 LabVIEW Block Diagram

6.19 AlazarCoprocessorRegisterWrite

6.19.1 Func on Syntax

RETURN_CODE AlazarCoprocessorRegisterWrite(HANDLE handle, U32 offset, U32


value)
Writes a value to a user-programmable coprocessor FPGA register.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] offset: Register offset
• [in] value: Value to write

6.19.2 LabVIEW Block Diagram

6.20 AlazarCreateStreamFile

AlazarCreateStreamFile() is a define that points to AlazarCreateStreamFileA() on Linux and


on Windows if UNICODE is not defined. If UNICODE is defined on Windows, AlazarCreateStream-
File() points to AlazarCreateStreamFileW(). The two functions only vary by the fact that they
use narrow or wide string types.

102 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.20.1 Func on Syntax

RETURN_CODE AlazarCreateStreamFileA(HANDLE handle, const char *filePath)


Creates a binary data file for this board, and enables saving AutoDMA data from the
board to disk.
If possible, select AlazarBeforeAsyncRead() parameters that result in DMA buffers
whose length in bytes is evenly divisible into sectors of the volume selected by
filePath. If the DMA buffer length is evenly divisible into records, AlazarCreat-
eStreamFile() disables file caching to obtain the highest possible sequential write per-
formance.
An AutoDMA buffer is saved to disk when an application calls AlazarWaitNex-
tAsyncBufferComplete(). For best performance, set the bytesToCopy parameter in
AlazarWaitNextAsyncBufferComplete() to zero so that data is written to disk without
copying it to the user-supplied buffer.
This function must be called after AlazarBeforeAsyncRead() and before AlazarStart-
Capture(). File streaming is only active for the acquisition that is about to start when
this function is called. You should call this function again for each acquisition with
which you want file streaming.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] filePath: Pointer to a NULL-terminated string that specifies the name of
the file.

RETURN_CODE AlazarCreateStreamFileW(HANDLE handle, const wchar_t *filePath)


Creates a binary data file for this board, and enables saving AutoDMA data from the
board to disk.
If possible, select AlazarBeforeAsyncRead() parameters that result in DMA buffers
whose length in bytes is evenly divisible into sectors of the volume selected by
filePath. If the DMA buffer length is evenly divisible into records, AlazarCreat-
eStreamFile() disables file caching to obtain the highest possible sequential write per-
formance.
An AutoDMA buffer is saved to disk when an application calls AlazarWaitNex-
tAsyncBufferComplete(). For best performance, set the bytesToCopy parameter in
AlazarWaitNextAsyncBufferComplete() to zero so that data is written to disk without
copying it to the user-supplied buffer.
This function must be called after AlazarBeforeAsyncRead() and before AlazarStart-
Capture(). File streaming is only active for the acquisition that is about to start when
this function is called. You should call this function again for each acquisition with
which you want file streaming.

©2008-2021 Alazar Technologies Inc. 103


ATS-SDK Documenta on, Release 7.5.0

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] filePath: Pointer to a NULL-terminated string that specifies the name of
the file.

6.20.2 LabVIEW Block Diagram

6.21 AlazarDSPAbortCapture

6.21.1 Func on Syntax

RETURN_CODE AlazarDSPAbortCapture(HANDLE boardHandle)


Aborts any in-progress DMA transfer, cancels any pending transfers and does DSP-
related cleanup.
This function should be called instead of AlazarAbortAsyncRead() in a standard acqui-
sition configuration. In addition to handling pending and in-flight DMA transfers, it
takes care of some cleanup related to the DSP post-processing.

Warning Whereas it is not necessary to call AlazarAbortAsyncRead() to clean after a


standard acquisition, calling AlazarDSPAbortCapture() is strictly required.
Parameters
• boardHandle: The board to stop the acquisition for.

6.21.2 LabVIEW Block Diagram

104 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.22 AlazarDSPGenerateWindowFunc on

6.22.1 Func on Syntax

RETURN_CODE AlazarDSPGenerateWindowFunction(U32 windowType, float *window,


U32 windowLength_samples, U32
paddingLength_samples)
Fills an array with a generated window function and pads it with zeros.

Please note that the windows length can take any integer value. It does not need to
meet the alignment requirements that apply to the record length, nor the power-of-
two requirement of the FFT length. This can allow users a very high level of control
over the effective acquired record length.
For example, if a laser source guarantees 1396 good data points at a particular fre-
quency, the number of samples per record on ATS9360 should be set to 1408 (the next
multiple of 128) and the FFT length should be 2048 points. The window function will
be generated with a windowLength_samples of 1396, and a paddingLength_samples of 652
(2048 - 1396).

Remark Using Python, the window array is not allocated first then passed as an out-
put parameter. Instead, it is directly returned from the function as a newly allo-
cated NumPy array.
Return ApiSuccess upon sucess.
Parameters
• windowType: Type of window to generate. Pass an item from
DSP_WINDOW_ITEMS enum.
• window: Array to be filled with the window function. It must be at least win-
dowLength_samples + paddingLength_samples long.
• windowLength_samples: The size of the window to generate.
• paddingLength_samples: The number of samples after the window function to
pad with zeros.

©2008-2021 Alazar Technologies Inc. 105


ATS-SDK Documenta on, Release 7.5.0

6.22.2 Related Enumera ons

enum DSP_WINDOW_ITEMS
Various types of window functions.
Used by AlazarDSPGenerateWindowFunction().
Values:
DSP_WINDOW_NONE = 0
DSP_WINDOW_HANNING
DSP_WINDOW_HAMMING
DSP_WINDOW_BLACKMAN
DSP_WINDOW_BLACKMAN_HARRIS
DSP_WINDOW_BARTLETT

6.23 AlazarDSPGetBuffer

6.23.1 Func on Syntax

RETURN_CODE AlazarDSPGetBuffer(HANDLE boardHandle, void *buffer, U32 time-


out_ms)
Waits until a buffer becomes available or an error occurs.
This function should be called instead of AlazarWaitAsyncBufferComplete() in a stan-
dard acquisition configuration.

Parameters
• boardHandle: Board that filled the buffer we want to retrieve
• buffer: Pointer to the DMA buffer we want to retrieve. This must correspond
to the first DMA buffer posted to the board that has not yet been retrieved.
• timeout_ms: Time to wait for the buffer to be ready before returning with an
ApiWaitTimeout error.

6.23.2 LabVIEW Block Diagram

106 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.24 AlazarDSPGetInfo

6.24.1 Func on Syntax

RETURN_CODE AlazarDSPGetInfo(dsp_module_handle dspHandle, U32 *dspMod-


uleId, U16 *versionMajor, U16 *versionMinor,
U32 *maxLength, U32 *supportedChannels, U32
*reserved1)
Get information about a specific On-FPGA DSP implementation.
Use this function to query the type of a DSP module, as well as other information.

Return ApiSuccess upon success.


Parameters
• dspHandle: The handle to the DSP module to query.
• dspModuleId: The identifier of the DSP module. This describes what the type of
this module is, and can be compared against the DSP_MODULE_TYPE enum.
• versionMajor: The major version number of the DSP implementation.
• versionMinor: The minor version number of the DSP implementation.
• maxLength: The maximum length of the records that can be processed.
• supportedChannels: For DSP_MODULE_FFT modules, this is a bitmask of the
input channels that can be active together with the DSP module. This param-
eter is ignored for different DSP modules.
• reserved1: Reserved parameter. Ignored

6.24.2 LabVIEW Block Diagram

©2008-2021 Alazar Technologies Inc. 107


ATS-SDK Documenta on, Release 7.5.0

6.24.3 Related Enumera ons

enum DSP_MODULE_TYPE
DSP module type.
Used by AlazarDSPGetInfo().
Values:
DSP_MODULE_NONE = 0xFFFF
DSP_MODULE_FFT
FFT multisample.
DSP_MODULE_PCD
PC Decoder Averager.
DSP_MODULE_SSK
Sample SKipper.
DSP_MODULE_DIS
DeInterlacer re-Scaling.

6.25 AlazarDSPGetModules

6.25.1 Func on Syntax

RETURN_CODE AlazarDSPGetModules(HANDLE boardHandle, U32 numEntries,


dsp_module_handle *modules, U32 *num-
Modules)
Queries the list of DSP modules in a given board.
This function allows to query the list of DSP modules for a digitizer board. modules
is a pointer to an array of DSP modules to be filled by this function. The numEntries
parameter specifies how many modules can be added by the function to the modules
array. Lastly, the numModules array specifies how many modules are available on the
specified board.
modules can be NULL. In this case, the only interest of this function is to return the num-
ber of modules available. Please note that numEntries must be zero if modules is NULL.
numModules can be NULL. In this case, it is ignored.
This function is typically called twice. First without a modules array to query the num-
ber of available modules, and a second time after allocating an appropriate array.
U32 numModules;

U32 retCode = AlazarDSPGetModules(handle, 0, NULL, &numModules);

// Error handling

(continues on next page)

108 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

(continued from previous page)


dsp_module_handle modules[numModules];

retCode = AlazarDSPGetModules(handle, numModules, modules, NULL);

// Error handling

Return ApiSuccess upon success.


Parameters
• boardHandle: The handle of the board to query DSP modules for.
• numEntries: The maximum number of entries that the function can fill in the
modules array. Must be zero if modules is NULL.
• modules: The array where this function fills the dsp_module_handle elements.
Can be NULL.
• numModules: Returns the number of DSP modules available on this board. Ig-
nored if NULL.

6.25.2 LabVIEW Block Diagram

6.26 AlazarDSPGetNextBuffer

6.26.1 Func on Syntax

RETURN_CODE AlazarDSPGetNextBuffer(HANDLE boardHandle, void *buffer, U32


bytesToCopy, U32 timeout_ms)
Equivalent of AlazarDSPGetBuffer() to call with ADMA_ALLOC_BUFFERS.
This function should be called instead of AlazarWaitNextAsyncBufferComplete() in a
standard acquisition configuration. See the documentation of this function for more
information.

Parameters
• boardHandle: Board that filled the buffer we want to retrieve
• buffer: Pointer to a buffer to receive sample data from the digitizer board.
• bytesToCopy: The number of bytes to copy into the buffer.

©2008-2021 Alazar Technologies Inc. 109


ATS-SDK Documenta on, Release 7.5.0

• timeout_ms: Time to wait for the buffer to be ready before returning with an
ApiWaitTimeout error.

6.26.2 LabVIEW Block Diagram

6.27 AlazarDSPGetParameterFloat

6.27.1 Func on Syntax

RETURN_CODE AlazarDSPGetParameterFloat(dsp_module_handle dspHandle, U32 pa-


rameter, float *result)
Generic interface to retrieve Float-typed parameters.
This function is called with an element of DSP_PARAMETERS_FLOAT as parameter. De-
pending on which value is selected, the function will query a different parameter in-
ternally and pass the return value to result.
This function returns ApiSuccess upon success, and standard errors otherwise.

6.27.2 LabVIEW Block Diagram

6.27.3 Related Enumera ons

enum DSP_PARAMETERS_FLOAT
Parameters that can be queried with AlazarDSPGetParameter*() or set with AlazarD-
SPSetParameter*()
See AlazarDSPGetParameterFloat() and AlazarDSPGetParameterFloat() for informa-
tion about the way to use these parameters.
Values:
DSP_FFT_POSTPROC_REAL_B = 0
IEEE754 single precision value of “b” for real FFT output value calculation “(Re +

110 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

a) * b + c”. To set this parameter in your program, it is necessary to set it after


AlazarFFTSetup() call, because this is where its default value is set.
DSP_FFT_POSTPROC_REAL_C
IEEE754 single precision value of “c” for real FFT output value calculation “(Re +
a) * b + c”. To set this parameter in your program, it is necessary to set it after
AlazarFFTSetup() call, because this is where its default value is set.
DSP_FFT_POSTPROC_IMAG_B
IEEE754 single precision value of “b” for imaginary FFT output value calculation
“(Im + a) * b + c”. To set this parameter in your program, it is necessary to set it
after AlazarFFTSetup() call, because this is where its default value is set.
DSP_FFT_POSTPROC_IMAG_C
IEEE754 single precision value of “c” for imaginary FFT output value calculation
“(Im + a) * b + c”. To set this parameter in your program, it is necessary to set it
after AlazarFFTSetup() call, because this is where its default value is set.
DSP_FFT_POSTPROC_SCALE_OUT_MAIN
IEEE754 single precision value of the scaler multiplier for the main output. To set
this parameter in your program, it is necessary to set it after AlazarFFTSetup()
call, because this is where its default value is set.
DSP_FFT_POSTPROC_SCALE_OUT_SEC
IEEE754 single precision value of the scaler multiplier for the secondary output.
To set this parameter in your program, it is necessary to set it after AlazarFFT-
Setup() call, because this is where its default value is set.

6.28 AlazarDSPGetParameterS32

6.28.1 Func on Syntax

RETURN_CODE AlazarDSPGetParameterS32(dsp_module_handle dspHandle, U32 pa-


rameter, S32 *result)
Generic interface to retrieve S32-typed parameters.
This function is called with an element of DSP_PARAMETERS_S32 as parameter. De-
pending on which value is selected, the function will query a different parameter in-
ternally and pass the return value to result.
This function returns ApiSuccess upon success, and standard errors otherwise.

©2008-2021 Alazar Technologies Inc. 111


ATS-SDK Documenta on, Release 7.5.0

6.28.2 LabVIEW Block Diagram

6.28.3 Related Enumera ons

enum DSP_PARAMETERS_S32
Parameters that can be queried with AlazarDSPGetParameter*() or set with AlazarD-
SPSetParameter*()
See AlazarDSPGetParameterS32() and AlazarDSPGetParameterS32() for information
about the way to use these parameters.
Values:
DSP_FFT_POSTPROC_REAL_A = 0
25-bit signed integer value of “a” for real FFT output value calculation “(Re + a)
* b + c”. To set this parameter in your program, it is necessary to set it after
AlazarFFTSetup() call, because this is where its default value is set.
DSP_FFT_POSTPROC_IMAG_A
25-bit signed integer value of “a” for imaginary FFT output value calculation “(Im
+ a) * b + c”. To set this parameter in your program, it is necessary to set it after
AlazarFFTSetup() call, because this is where its default value is set.

6.29 AlazarDSPGetParameterU32

6.29.1 Func on Syntax

RETURN_CODE AlazarDSPGetParameterU32(dsp_module_handle dspHandle, U32 pa-


rameter, U32 *result)
Generic interface to retrieve U32-typed parameters.
This function is called with an element of DSP_PARAMETERS_U32 as parameter. De-
pending on which value is selected, the function will query a different parameter in-
ternally and pass the return value to result.
This function returns ApiSuccess upon success, and standard errors otherwise.

112 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.29.2 LabVIEW Block Diagram

6.29.3 Related Enumera ons

enum DSP_PARAMETERS_U32
Parameters that can be queried with AlazarDSPGetParameter*()
See AlazarDSPGetParameterU32() for information about the way to use these param-
eters.
Values:
DSP_RAW_PLUS_FFT_SUPPORTED = 0
Tells if an FFT module supports RAW+FFT mode. This parameter returns 0 if
RAW+FFT mode is not supported, and 1 if it is.
DSP_FFT_SUBTRACTOR_SUPPORTED
Tells if an FFT module supports the background subtraction feature. This param-
eter returns 0 if the feature is not supported, and 1 if it is.
DSP_FFT_DATAPATH
Tells which data path an FFT module uses.

6.30 AlazarDSPSetParameterFloat

6.30.1 Func on Syntax

RETURN_CODE AlazarDSPSetParameterFloat(dsp_module_handle dspHandle, U32 pa-


rameter, float value)
Generic interface to set Float-typed parameters.
This function is called with an element of DSP_PARAMETERS_FLOAT as parameter. De-
pending on which value is selected, the function will write value to different parame-
ter internally.
This function returns ApiSuccess upon success, and standard errors otherwise.

©2008-2021 Alazar Technologies Inc. 113


ATS-SDK Documenta on, Release 7.5.0

6.30.2 LabVIEW Block Diagram

6.31 AlazarDSPSetParameterS32

6.31.1 Func on Syntax

RETURN_CODE AlazarDSPSetParameterS32(dsp_module_handle dspHandle, U32 pa-


rameter, S32 value)
Generic interface to set S32-typed parameters.
This function is called with an element of DSP_PARAMETERS_S32 as parameter. De-
pending on which value is selected, the function will write value to different parame-
ter internally.
This function returns ApiSuccess upon success, and standard errors otherwise.

6.31.2 LabVIEW Block Diagram

6.32 AlazarDSPSetParameterU32

6.32.1 Func on Syntax

RETURN_CODE AlazarDSPSetParameterU32(dsp_module_handle dspHandle, U32 pa-


rameter, U32 value)
Generic interface to set U32-typed parameters.
This function is called with an element of DSP_PARAMETERS_U32 as parameter. De-
pending on which value is selected, the function will write value to different parame-
ter internally.
This function returns ApiSuccess upon success, and standard errors otherwise.

114 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.32.2 LabVIEW Block Diagram

6.33 AlazarErrorToText

6.33.1 Func on Syntax

const char *AlazarErrorToText(RETURN_CODE retCode)


Converts a numerical return code to a NULL terminated string.

Return A string containing the identifier name of the error code


Remark It is often easier to work with a descriptive error name than an error num-
ber.
Parameters
• [in] retCode: Return code from an AlazarTech API function

6.33.2 LabVIEW Block Diagram

6.33.3 Related Enumera ons

enum RETURN_CODE
API functions return codes. Failure is ApiSuccess.
Values:
ApiSuccess = API_RETURN_CODE_STARTS
512 - The operation completed without error
ApiFailed = 513
The operation failed.
ApiAccessDenied = 514
Access denied.
ApiDmaChannelUnavailable = 515
Channel selection is unavailable.

©2008-2021 Alazar Technologies Inc. 115


ATS-SDK Documenta on, Release 7.5.0

ApiDmaChannelInvalid = 516
Channel selection in invalid.
ApiDmaChannelTypeError = 517
Channel selection is invalid.
ApiDmaInProgress = 518
A data transfer is in progress. This error code indicates that the current action
cannot be performed while an acquisition is in progress. It also returned by
AlazarPostAsyncBuffer() if this function is called with an invalid DMA buffer.
ApiDmaDone = 519
DMA transfer is finished.
ApiDmaPaused = 520
DMA transfer was paused.
ApiDmaNotPaused = 521
DMA transfer is not paused.
ApiDmaCommandInvalid = 522
A DMA command is invalid.
ApiNullParam = 531
One of the parameters of the function is NULL and should not be.
ApiUnsupportedFunction = 533
This function is not supported by the API. Consult the manual for more informa-
tion.
ApiInvalidPciSpace = 534
Invalid PCI space.
ApiInvalidIopSpace = 535
Invalid IOP space.
ApiInvalidSize = 536
Invalid size passed as argument to the function.
ApiInvalidAddress = 537
Invalid address.
ApiInvalidAccessType = 538
Invalid access type requested.
ApiInvalidIndex = 539
Invalid index.
ApiInvalidRegister = 543
Invalid register.
ApiConfigAccessFailed = 550
Access for configuration failed.
ApiInvalidDeviceInfo = 551
Invalid device information.

116 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

ApiNoActiveDriver = 552
No active driver for the board. Please ensure that a driver is installed.
ApiInsufficientResources = 553
There were not enough system resources to complete this operation. The most
common reason of this return code is using too many DMA buffers, or using DMA
buffers that are too big. Please try reducing the number of buffers posted to the
board at any time, and/or try reducing the DMA buffer sizes.
ApiNotInitialized = 556
The API has not been properly initialized for this function call. Please review one
of the code samples from the ATS-SDK to confirm that API calls are made in the
right order.
ApiInvalidPowerState = 558
Power state requested is not valid.
ApiPowerDown = 559
The operation cannot be completed because the device is powered down. For
example, this error code is output if the computer enters hiberanation while an
acquisition is running.
ApiNotSupportThisChannel = 561
The API call is not valid with this channel selection.
ApiNoAction = 562
The function has requested no action to be taken.
ApiHSNotSupported = 563
HotSwap is not supported.
ApiVpdNotEnabled = 565
Vital product data not enabled.
ApiInvalidOffset = 567
Offset argument is not valid.
ApiPciTimeout = 569
Timeout on the PCI bus.
ApiInvalidHandle = 572
Invalid handle passed as argument.
ApiBufferNotReady = 573
The buffer passed as argument is not ready to be called with this API. This error
code is most often seen is the order of buffers posted to the board is not respected
when querying them.
ApiInvalidData = 574
Generic invalid parameter error. Check the function’s documentation for more
information about valid argument values.
ApiDoNothing = 575

©2008-2021 Alazar Technologies Inc. 117


ATS-SDK Documenta on, Release 7.5.0

ApiDmaSglBuildFailed = 576
Unable to lock buffer and build SGL list.
ApiPMNotSupported = 577
Power management is not supported.
ApiInvalidDriverVersion = 578
Invalid driver version.
ApiWaitTimeout = 579
The operation did not finish during the timeout interval. try the operation again,
or abort the acquisition.
ApiWaitCanceled = 580
The operation was cancelled.
ApiBufferTooSmall = 581
The buffer used is too small. Try increasing the buffer size.
ApiBufferOverflow = 582
The board overflowed its internal (on-board) memory. Try reducing the sample
rate, reducing the number of enabled channels. Also ensure that DMA buffer size
is between 1 MB and 8 MB.
ApiInvalidBuffer = 583
The buffer passed as argument is not valid.
ApiInvalidRecordsPerBuffer = 584
The number of reocrds per buffer passed as argument is invalid.
ApiDmaPending
585 - An asynchronous I/O operation was successfully started on the board. It will
be completed when sufficient trigger events are supplied to the board to fill the
buffer.
ApiLockAndProbePagesFailed = 586
The buffer is too large for the driver or operating system to prepare for scatter-
gather DMA transfer. Try reducing the size of each buffer, or reducing the num-
ber of buffers queued by the application.
ApiTransferComplete = 589
This buffer is the last in the current acquisition.
ApiPllNotLocked = 590
The on-board PLL circuit could not lock. If the acquisition used an internal sample
clock, this might be a symptom of a hardware problem; contact AlazarTech. If the
acquisition used an external 10 MHz PLL signal, please make sure that the signal
is fed in properly.
ApiNotSupportedInDualChannelMode = 591
The requested acquisition is not possible with two channels. This can be due to the
sample rate being too fast for DES boards, or to the number of samples per record
being too large. Try reducing the number of samples per channel, or switching
to single channel mode.

118 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

ApiNotSupportedInQuadChannelMode = 592
The requested acquisition is not possible with four channels. This can be due
to the sample rate being too fast for DES boards, or to the number of samples
per record being too large. Try reducing the number of samples per channel, or
switching to single channel mode.
ApiFileIoError = 593
A file read or write error occured.
ApiInvalidClockFrequency = 594
The requested ADC clock frequency is not supported.
ApiInvalidSkipTable = 595
Invalid skip table passed as argument.
ApiInvalidDspModule = 596
This DSP module is not valid for the current operation.
ApiDESOnlySupportedInSingleChannelMode = 597
Dual-edge sampling mode is only supported in signel-channel mode. Try dis-
abling dual-edge sampling (lowering the sample rate if using internal clock), or
selecting only one channel.
ApiInconsistentChannel = 598
Successive API calls of the same acuqiisiton have received inconsistent acquisi-
tion channel masks.
ApiDspFiniteRecordsPerAcquisition = 599
DSP acquisition was run with a finite number of records per acqusiition. Set this
value to inifinite.
ApiNotEnoughNptFooters = 600
Not enough NPT footers in the buffer for extraction.
ApiInvalidNptFooter = 601
Invalid NPT footer found.
ApiOCTIgnoreBadClockNotSupported = 602
OCT ignore bad clock is not supported.
ApiError1 = 603
The requested number of records in a single-port acquisition exceeds the max-
imum supported by the digitizer. Use dual-ported AutoDMA to acquire more
records per acquisition.
ApiError2 = 604
The requested number of records in a single-port acquisition exceeds the maxi-
mum supported by the digitizer.
ApiOCTNoTriggerDetected = 605
No trigger is detected as part of the OCT ignore bad clock feature.
ApiOCTTriggerTooFast = 606
Trigger detected is too fast for the OCT ignore bad clock feature.

©2008-2021 Alazar Technologies Inc. 119


ATS-SDK Documenta on, Release 7.5.0

ApiNetworkError = 607
There was a network-related issue. Make sure that the network connection and
settings are correct.
ApiFftSizeTooLarge = 608
On-FPGA FFT cannot support FFT that large. Try reducing the FFT size, or query-
ing the maximum FFT size with AlazarDSPGetInfo()
ApiGPUError = 609
GPU returned an error. See log for more information.
ApiAcquisitionModeOnlySupportedInFifoStreaming = 610
This board only supports this acquisition mode in FIFO only streaming mode.
Please set the ADMA_FIFO_ONLY_STREAMING flag in AlazarBeforeAsyncRead().
ApiInterleaveNotSupportedInTraditionalMode = 611
This board does not support sample interleaving in traditional acquisition mode.
Please refer to the SDK guide for more information.
ApiRecordHeadersNotSupported = 612
This board does not support record headers. Please refer to the SDK guide for
more information.
ApiRecordFootersNotSupported = 613
This board does not support record footers. Please refer to the SDK guide for more
information.
ApiFastBufferLockCountExceeded = 614
The number of different DMA buffers posted exceeds the limit set with AlazarCon-
figureFastBufferLock(). Either disable fast buffer locking, or confirm that the
value passed to AlazarConfigureFastBufferLock() is respected.
ApiInvalidStateDoRetry = 615
The operation could not complete because the system is in an invalid state. You
may safely retry the call that returned this error.
ApiInvalidInputRange = 616
The operation could not complete because the system is in an invalid state. You
may safely retry the call that returned this error.

6.34 AlazarExtractFFTNPTFooters

6.34.1 Func on Syntax

RETURN_CODE AlazarExtractFFTNPTFooters(void *buffer, U32 recordSize_bytes, U32


bufferSize_bytes, NPTFooter *footersAr-
ray, U32 numFootersToExtract)
Extracts NPT footers from a buffer acquired during an FFT acquisition.
Before calling this function, it is important to make sure that the buffers have been
acquired in NPT mode with the NPT footers active. In addition, the acquisition must

120 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

have used on-FPGA FFT computation.

Warning footersArray must contain at least numFootersToExtract elements.


Parameters
• [in] buffer: Base address of the DMA buffer to process
• [in] recordSize_bytes: Bytes per record in the DMA buffer passed as argu-
ment as returned by AlazarFFTSetup().
• [in] bufferSize_bytes: Bytes per buffer in the DMA buffer passed as argu-
ment
• [out] footersArray: Base address of an array of NPTFooter structures which
will be filled by this function
• [in] numFootersToExtract: Maximum numbers of footers to extract. This can
be a number from zero to the number of records in the DMA buffer passed as
argument.

6.35 AlazarExtractNPTFooters

6.35.1 Func on Syntax

RETURN_CODE AlazarExtractNPTFooters(void *buffer, U32 recordSize_bytes, U32


bufferSize_bytes, NPTFooter *footersArray,
U32 numFootersToExtract)
Extracts NPT footers from a buffer that contains them.
Before calling this function, it is important to make sure that the buffers have been
acquired in NPT mode with the NPT footers active.
Warning This function has been deprecated in favor of AlazarExtractTimeDomain-
NPTFooters() and AlazarExtractFFTNPTFooters(). It is still usable, but only works
on NPT footers acquired as part of an FFT acquisition.

Warning footersArray must contain at least numFootersToExtract elements.


Parameters
• [in] buffer: Base address of the DMA buffer to process
• [in] recordSize_bytes: Bytes per record in the DMA buffer passed as argu-
ment
• [in] bufferSize_bytes: Bytes per buffer in the DMA buffer passed as argu-
ment
• [out] footersArray: Base address of an array of NPTFooter structures which
will be filled by this function

©2008-2021 Alazar Technologies Inc. 121


ATS-SDK Documenta on, Release 7.5.0

• [in] numFootersToExtract: Maximum numbers of footers to extract. This can


be a number from zero to the number of records in the DMA buffer passed as
argument.

6.35.2 Related Enumera ons

struct _NPTFooter
NPT Footer structure that can be retrieved using AlazarExtractNPTFooters().

Public Members

U64 triggerTimestamp
Timestamp of the trigger event in this
U32 recordNumber
acquisition.
Record number
U32 frameCount
Frame count.
BOOL aux_in_state
AUX I/O state received during the record’s acquisition

6.36 AlazarExtractTimeDomainNPTFooters

6.36.1 Func on Syntax

RETURN_CODE AlazarExtractTimeDomainNPTFooters(void *buffer, U32 record-


Size_bytes, U32 bufferSize_bytes,
NPTFooter *footersArray, U32
numFootersToExtract)
Extracts NPT footers from a buffer acquired during a time-domain acquisition.
Before calling this function, it is important to make sure that the buffers have been
acquired in NPT mode with the NPT footers active. In addition, the acquisition must
not have used on-FPGA FFT computation.

Warning footersArray must contain at least numFootersToExtract elements.


Parameters
• [in] buffer: Base address of the DMA buffer to process
• [in] recordSize_bytes: Bytes per record in the DMA buffer passed as argu-
ment

122 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• [in] bufferSize_bytes: Bytes per buffer in the DMA buffer passed as argu-
ment
• [out] footersArray: Base address of an array of NPTFooter structures which
will be filled by this function
• [in] numFootersToExtract: Maximum numbers of footers to extract. This can
be a number from zero to the number of records in the DMA buffer passed as
argument.

6.37 AlazarFFTBackgroundSubtrac onGetRecordS16

6.37.1 Func on Syntax

RETURN_CODE AlazarFFTBackgroundSubtractionGetRecordS16(dsp_module_handle
dspHandle, S16 *back-
groundRecord, U32
size_samples)
Reads the background subtraction record from a board.
This function can be called to read which record the board uses for the background
subtraction feature. It is used by allocating an array of the right size, then passing it
to backgroundRecord along with it’s size in samples to size_samples.
This function should be called before or between acquisitions, not during one.

6.37.2 LabVIEW Block Diagram

6.38 AlazarFFTBackgroundSubtrac onSetEnabled

6.38.1 Func on Syntax

RETURN_CODE AlazarFFTBackgroundSubtractionSetEnabled(dsp_module_handle
dspHandle, BOOL en-
abled)
Controls the activation of the background subtraction feature.
Passing true to enabled activates background subtraction. Passing false deactivates it.
This function should be called before or between acquisitions, not during one.

©2008-2021 Alazar Technologies Inc. 123


ATS-SDK Documenta on, Release 7.5.0

6.38.2 LabVIEW Block Diagram

6.39 AlazarFFTBackgroundSubtrac onSetRecordS16

6.39.1 Func on Syntax

RETURN_CODE AlazarFFTBackgroundSubtractionSetRecordS16(dsp_module_handle
dspHandle, const
S16 *record, U32
size_samples)
Download the record for the background subtraction feature to a board.
Pass this function a pointer to an 16-bit integer array containing the record you want
to download, and the size of this record in samples.
This function should be called before or between acquisitions, not during one.

6.39.2 LabVIEW Block Diagram

6.40 AlazarFFTGetMaxTriggerRepeatRate

6.40.1 Func on Syntax

RETURN_CODE AlazarFFTGetMaxTriggerRepeatRate(dsp_module_handle dspHandle,


U32 fftSize, double *maxTriggerRe-
peatRate)
Queries the maximum trigger repeat rate that the FFT engine can support without
overflow.
This utility function is useful to calculate the theoretical maximum speed at which
FFTs can be computed on a specific digitizer. The value returned only takes into ac-
count the FFT processing speed of the on-board module. Other parameters such as bus
transfer speed must still be taken into account to ensure that an acquisition is possible
on a given board.

Warning This function is available for FFT modules versions 4.5 and up.

124 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Return ApiSucces upon success


Return ApiInvalidDspModule if the FFT module is invalid (wrong type or version)
Parameters
• [in] dspHandle: The board for which to calculate the maximum trigger rate.
• [in] fftSize: The number of points acquired by the board per FFT operation.
• [out] maxTriggerRepeatRate: Output parameter that gets assigned the maxi-
mum trigger rate supported by this board’s FFT processing module in Hertz.

6.40.2 LabVIEW Block Diagram

6.41 AlazarFFTSetScalingAndSlicing

6.41.1 Func on Syntax

RETURN_CODE AlazarFFTSetScalingAndSlicing(dsp_module_handle dspHandle, U8


slice_pos, float loge_ampl_mult)
Sets internal scaling and slicing parameters in the FFT module.
This function modifies internal parameters used by the on-FPGA FFT module to con-
vert the output of the FFT engine to the desired format. Please refer to the figure below
for details as to where conversions happen.
Remark This function is only valid for on-FPGA FFT modules with version less than
5.
Warning This function is intended for advanced users only. Calling it with the wrong
parameters can prevent any meaningful data from being output by the FFT mod-
ule.
To use this function in your program, it is necessary to call it after AlazarFFTSetup(),
because this is where default scaling and slicing values are set.

©2008-2021 Alazar Technologies Inc. 125


ATS-SDK Documenta on, Release 7.5.0

Parameters
• dspHandle: Handle to DSP module
• slice_pos: This parameter indicates the position of the most significant bit
of the output of slicing operations with respect to the input. Lowering this
value by one has the effect of multiplying the output of the FFT module by
2. Default value is 7 for log outputs and 38 otherwise. On the block diagram,
this parameter applies to all blocks marked ‘Slice’.
• loge_ampl_mult: This controls a multiplicative factor used after the log con-
version in the FFT module. Hence, it does not apply to ‘amplitude squared’
outputs. Default value is 4.3429446 for U8 log and float log outputs, and
1111.7938176 for U16 log output.

6.41.2 LabVIEW Block Diagram

6.42 AlazarFFTSetWindowFunc on

6.42.1 Func on Syntax

RETURN_CODE AlazarFFTSetWindowFunction(dsp_module_handle dspHandle, U32 sam-


plesPerRecord, float *realWindowArray,
float *imagWindowArray)
Sets the window function to use with an on-FPGA FFT module.
Downloads a window function to an AlazarTech digitizer’s memory. This window
function will be used during all subsequent acquisitions that use the on-FPGA DSP
module.
This function should be called before AlazarFFTSetup(). It does not have to be called
every time an acquisition is done. It can be located in the board configuration section.

Warning Please note that the window function is not compatible with the FFT verifi-
cation mode.
Parameters
• dspHandle: The handle of the FFT DSP module to set the window function for.
• samplesPerRecord: The number of samples in the window function array.

126 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• realWindowArray: The real window function array. Passing NULL is equivalent


to passing an array filled with ones. The values of the window function must
be in the interval .
• imagWindowArray: The imaginary window function array. Passing NULL is
equivalent to passing an array filled with zeros. The values of the window
function must be in the interval .

6.42.2 LabVIEW Block Diagram

6.43 AlazarFFTSetup

6.43.1 Func on Syntax

RETURN_CODE AlazarFFTSetup(dsp_module_handle dspHandle, U16 inputChan-


nelMask, U32 recordLength_samples, U32
fftLength_samples, U32 outputFormat, U32 footer,
U32 reserved, U32 *bytesPerOutputRecord)
Configure the board for an FFT acquisition.
This function needs to be called in the board configuration procedure, therefore before
AlazarBeforeAsyncRead().
The output format of the fft is controlled by the outputFormat parameter, with the
FFT_OUTPUT_FORMAT enumeration. All elements of FFT_OUTPUT_FORMAT except
FFT_OUTPUT_FORMAT_RAW_PLUS_FFT describe a data type (unsigned 8-bit integer,
floating point number, etc.) as well as a scale (logarithmic or amplitude squared). It
is mandatory to select one (and only one) of these.
On the other hand, when FFT_OUTPUT_FORMAT_RAW_PLUS_FFT is OR’ed (using the
C | operator) to another symbol, it has the meaning of asking the board to output both
the time-domain (raw) and FFT data.

Parameters
• dspHandle: The FFT module to configure.
• inputChannelMask: The channels to acquire data from. This must be CHAN-
NEL_A.
• recordLength_samples: The number of points per record to acquire. This needs
to meet the usual requirements for the number of samples per record. Please
see the documentation of AlazarBeforeAsyncRead() for more information.

©2008-2021 Alazar Technologies Inc. 127


ATS-SDK Documenta on, Release 7.5.0

• fftLength_samples: The number of points per FFT. This value must be:
– A power of two;
– Greater than or equal to recordLength_samples;
– Less than or equal to the maximum FFT size, as returned by the AlazarD-
SPGetInfo() function.
• outputFormat: Describes what data is output from the FFT post-processing
module. This can be any element of the FFT_OUTPUT_FORMAT enum
except FFT_OUTPUT_FORMAT_RAW_PLUS_FFT, optionally OR’ed with
FFT_OUTPUT_FORMAT_RAW_PLUS_FFT.
• footer: Describes if a footer is attached to the returned records. Must be an
element of the FFT_FOOTER enum.
• reserved: Reserved for future use. Pass 0.
• bytesPerOutputRecord: Returns the number of bytes in each record coming out
of the FFT module. This value can be used to know how long the allocated
DMA buffers must be.

6.43.2 LabVIEW Block Diagram

6.43.3 Related Enumera ons

enum FFT_OUTPUT_FORMAT
FFT output format enumeration.
Values:
FFT_OUTPUT_FORMAT_U32_AMP2 = 0x0
32-bit unsigned integer amplitude squared output.
FFT_OUTPUT_FORMAT_U16_LOG = 0x1
16-bit unsigned integer logarithmic amplitude output.
FFT_OUTPUT_FORMAT_U16_AMP2 = 0x101
16-bit unsigned integer amplitude squared output.
FFT_OUTPUT_FORMAT_U8_LOG = 0x2
8-bit unsigned integer logarithmic amplitude output.

128 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

FFT_OUTPUT_FORMAT_U8_AMP2 = 0x102
8-bit unsigned integer amplitude squared output.
FFT_OUTPUT_FORMAT_S32_REAL = 0x3
32-bit signed integer real part of FFT output.
FFT_OUTPUT_FORMAT_S32_IMAG = 0x4
32-bit signed integer imaginary part of FFT output.
FFT_OUTPUT_FORMAT_FLOAT_AMP2 = 0xA
32-bit floating point amplitude squared output.
FFT_OUTPUT_FORMAT_FLOAT_LOG = 0xB
32-bit floating point logarithmic output.
FFT_OUTPUT_FORMAT_RAW_PLUS_FFT = 0x1000
Prepend each FFT output record with a signed 16-bit version of the time-domain
data.
enum FFT_FOOTER
FFT footer enumeration.
Values:
FFT_FOOTER_NONE = 0x0
FFT_FOOTER_NPT = 0x1

6.44 AlazarForceTrigger

6.44.1 Func on Syntax

RETURN_CODE AlazarForceTrigger(HANDLE handle)


Generate a software trigger event.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle

6.44.2 LabVIEW Block Diagram

©2008-2021 Alazar Technologies Inc. 129


ATS-SDK Documenta on, Release 7.5.0

6.45 AlazarForceTriggerEnable

6.45.1 Func on Syntax

RETURN_CODE AlazarForceTriggerEnable(HANDLE handle)


Generate a software trigger enable event.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle

6.45.2 LabVIEW Block Diagram

6.46 AlazarFreeBufferU16

6.46.1 Func on Syntax

RETURN_CODE AlazarFreeBufferU16(HANDLE handle, U16 *buffer)


Frees a buffer allocated with AlazarAllocBufferU16()

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] buffer: Base address of the buffer to free

6.47 AlazarFreeBufferU16Ex

6.47.1 Func on Syntax

RETURN_CODE AlazarFreeBufferU16Ex(HANDLE handle, U16 *buffer)


Frees a buffer allocated with AlazarAllocBufferU16Ex()

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.

130 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Parameters
• [in] handle: Handle to board
• [in] buffer: Base address of the buffer to free

6.48 AlazarFreeBufferU8

6.48.1 Func on Syntax

RETURN_CODE AlazarFreeBufferU8(HANDLE handle, U8 *buffer)


Frees a buffer allocated with AlazarAllocBufferU8()

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] buffer: Base address of the buffer to free

6.49 AlazarFreeBufferU8Ex

6.49.1 Func on Syntax

RETURN_CODE AlazarFreeBufferU8Ex(HANDLE handle, U8 *buffer)


Frees a buffer allocated with AlazarAllocBufferU8Ex()

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Handle to board
• [in] buffer: Base address of the buffer to free

6.50 AlazarGetBoardBySystemHandle

6.50.1 Func on Syntax

HANDLE AlazarGetBoardBySystemHandle(HANDLE systemHandle, U32 boardId)


Get a handle to a board in a board system where the board system is specified by a
handle to its master board and the board by its identifier within the system.

Return A handle to the specified board if it was found

©2008-2021 Alazar Technologies Inc. 131


ATS-SDK Documenta on, Release 7.5.0

Return NULL if the master board handle is invalid, or a board with the specified
board identifier was not found in the specified board system.
Parameters
• [in] systemHandle: Handle to master board
• [in] boardId: Board identifier in the board system

6.50.2 LabVIEW Block Diagram

6.51 AlazarGetBoardBySystemID

6.51.1 Func on Syntax

HANDLE AlazarGetBoardBySystemID(U32 systemId, U32 boardId)


Get a handle to a board in a board system where the board and system are identified
by their ID.
Detailed description

Return A handle to the specified board if it was found.


Return NULL if the board with the specified systemId and boardId was not found.
Parameters
• [in] systemId: The system identifier
• [in] boardId: The board identifier

6.51.2 LabVIEW Block Diagram

132 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.52 AlazarGetBoardKind

6.52.1 Func on Syntax

ALAZAR_BOARDTYPES AlazarGetBoardKind(HANDLE handle)


Get a board model identifier of the board associated with a board handle.

Return A non-zero board model identifier upon success. See BoardTypes for convert-
ing the identifier into a board model.
Return Zero upon error.
Parameters
• [in] handle: Board handle

6.52.2 LabVIEW Block Diagram

6.52.3 Related Enumera ons

enum BoardTypes
Existing board models.
Values:
ATS_NONE = 0
ATS850 = 1
ATS310 = 2
ATS330 = 3
ATS855 = 4
ATS315 = 5
ATS335 = 6
ATS460 = 7
ATS860 = 8
ATS660 = 9
ATS665 = 10
ATS9462 = 11

©2008-2021 Alazar Technologies Inc. 133


ATS-SDK Documenta on, Release 7.5.0

ATS9434 = 12
ATS9870 = 13
ATS9350 = 14
ATS9325 = 15
ATS9440 = 16
ATS9410 = 17
ATS9351 = 18
ATS9310 = 19
ATS9461 = 20
ATS9850 = 21
ATS9625 = 22
ATG6500 = 23
ATS9626 = 24
ATS9360 = 25
AXI9870 = 26
ATS9370 = 27
ATU7825 = 28
ATS9373 = 29
ATS9416 = 30
ATS9637 = 31
ATS9120 = 32
ATS9371 = 33
ATS9130 = 34
ATS9352 = 35
ATS9453 = 36
ATS9146 = 37
ATS9000 = 38
ATST371 = 39
ATS9437 = 40
ATS9618 = 41
ATS9358 = 42
ATS9353 = 44

134 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

ATS9872 = 45
ATS9470 = 46
ATS9628 = 47

6.53 AlazarGetBoardRevision

6.53.1 Func on Syntax

RETURN_CODE AlazarGetBoardRevision(HANDLE handle, U8 *major, U8 *minor)


Get the PCB hadware revision level of a digitizer board.
AlazarTech periodically updates the PCB hadware of its digitizers to improve function-
ality. Many PCIE digitizers can report the PCB hadware revision to software. Note that
this function is not supported on PCI digitizer boards.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: The board handle
• [out] major: PCB major version number
• [out] minor: PCB minor version number

6.53.2 LabVIEW Block Diagram

6.54 AlazarGetCPLDVersion

6.54.1 Func on Syntax

RETURN_CODE AlazarGetCPLDVersion(HANDLE handle, U8 *major, U8 *minor)


Get the CPLD version number of the specified board.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters

©2008-2021 Alazar Technologies Inc. 135


ATS-SDK Documenta on, Release 7.5.0

• [in] handle: Board handle


• [out] major: CPLD version number
• [out] minor: CPLD version number

6.54.2 LabVIEW Block Diagram

6.55 AlazarGetChannelInfo

6.55.1 Func on Syntax

RETURN_CODE AlazarGetChannelInfo(HANDLE handle, U32 *memorySize, U8 *bitsPer-


Sample)
Get the total on-board memory in samples, and sample size in bits per sample.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark The memory size information is independent of how many channels the
board can acquire on simultaneously. When multiple channels acquire data, they
share this amount.
Remark The memory size indication is given for the default packing mode. See doc-
umentation about data packing for more information.
Parameters
• [in] handle: Board handle.
• [out] memorySize: Total size of the on-board memory in samples.
• [out] bitsPerSample: Bits per sample.

6.55.2 LabVIEW Block Diagram

136 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.56 AlazarGetChannelInfoEx

6.56.1 Func on Syntax

RETURN_CODE AlazarGetChannelInfoEx(HANDLE handle, S64 *memorySize, U8


*bitsPerSample)
Get the total on-board memory in samples, and sample size in bits per sample.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark The memory size information is independent of how many channels the
board can acquire on simultaneously. When multiple channels acquire data, they
share this amount.
Remark The memory size indication is given for the default packing mode. See doc-
umentation about data packing for more information.
Parameters
• [in] handle: Board handle.
• [out] memorySize: Total size of the on-board memory in samples.
• [out] bitsPerSample: Bits per sample.

6.57 AlazarGetDriverVersion

6.57.1 Func on Syntax

RETURN_CODE AlazarGetDriverVersion(U8 *major, U8 *minor, U8 *revision)


Get the device driver version of the most recently opened device.
Driver releases are given a version number with the format X.Y.Z where: X is the major
release number, Y is the minor release number, and Z is the minor revision number.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark To check the driver version of a specific board, instead of the most recently
opened one, see AlazarGetDriverVersionEx
See AlazarGetSDKVersion() AlazarGetCPLDVersion()
Parameters
• [out] major: The driver major version number
• [out] minor: The driver minor version number
• [out] revision: The driver revision number

©2008-2021 Alazar Technologies Inc. 137


ATS-SDK Documenta on, Release 7.5.0

6.57.2 LabVIEW Block Diagram

6.58 AlazarGetMaxRecordsCapable

6.58.1 Func on Syntax

RETURN_CODE AlazarGetMaxRecordsCapable(HANDLE handle, U32 samplesPerRecord,


U32 *maxRecordsPerCapture)
Calculate the maximum number of records that can be captured to on-board memory
given the requested number of samples per record.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Note This function is part of the single-port API. It should not be used with AutoDMA
API functions.
Parameters
• [in] handle: Board handle
• [in] samplesPerRecord: The desired number of samples per record
• [out] maxRecordsPerCapture: The maximum number of records per capture
possible with the requested value of samples per record.

6.58.2 LabVIEW Block Diagram

138 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.59 AlazarGetParameter

6.59.1 Func on Syntax

RETURN_CODE AlazarGetParameter(HANDLE handle, U8 channel, U32 parameter, long


*retValue)
Get a device parameter as a signed long value.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] channel: The channel to control. See ALAZAR_CHANNELS for a list of
possible values. This parameter only takes unsigned 8-bit values.
• [in] parameter: The Parameter to modify. This can be one of
ALAZAR_PARAMETERS.
• [in] retValue: Parameter’s value

6.59.2 LabVIEW Block Diagram

6.59.3 Related Enumera ons

enum ALAZAR_PARAMETERS
Parameters suitable to be used with AlazarSetParameter() and/or AlazarGetParame-
ter()
Values:
DATA_WIDTH = 0x10000009UL
The number of bits per sample.
SETGET_ASYNC_BUFFSIZE_BYTES = 0x10000039UL
The size of API-allocated DMA buffers in bytes.
SETGET_ASYNC_BUFFCOUNT = 0x10000040UL
The number of API-allocated DMA buffers.
GET_ASYNC_BUFFERS_PENDING = 0x10000050UL
DMA buffers currently posted to the board.

©2008-2021 Alazar Technologies Inc. 139


ATS-SDK Documenta on, Release 7.5.0

GET_ASYNC_BUFFERS_PENDING_FULL = 0x10000051UL
DMA buffers waiting to be processed by the application.
GET_ASYNC_BUFFERS_PENDING_EMPTY = 0x10000052UL
DMA buffers waiting to be filled by the board.
SET_DATA_FORMAT = 0x10000041UL
0 if the data format is unsigned, and 1 otherwise
GET_DATA_FORMAT = 0x10000042UL
0 if the data format is unsigned, and 1 otherwise
GET_SAMPLES_PER_TIMESTAMP_CLOCK = 0x10000044UL
Number of samples per timestamp clock.
GET_RECORDS_CAPTURED = 0x10000045UL
Records captured since the start of the acquisition (single-port) or buffer (dual-
port)
ECC_MODE = 0x10000048UL
ECC mode. Member of ALAZAR_ECC_MODES.
GET_AUX_INPUT_LEVEL = 0x10000049UL
Read the TTL level of the AUX connector. Member of
ALAZAR_AUX_INPUT_LEVELS
GET_CHANNELS_PER_BOARD = 0x10000070UL
Number of analog channels supported by this digitizer.
GET_FPGA_TEMPERATURE = 0x10000080UL
Current FPGA temperature in degrees Celcius. Only supported by PCIe digitizers.
PACK_MODE = 0x10000072UL
Get/Set the pack mode as a member of ALAZAR_PACK_MODES.
SET_SINGLE_CHANNEL_MODE = 0x10000043UL
Reserve all the on-board memory to the channel passed as argument. Single-port
only.
API_FLAGS = 0x10000090UL
Get/Set the state of the API logging as a member of ALAZAR_API_TRACE_STATES
SET_SOFTWARE_CAL_MECHANISM = 0x10000100UL
Use software calibration mechanism if set to 1, else use standard hardware cali-
bration.
API_LOG_CLEAR = 0x10000102UL
Clear the log file of the API logging mechanism.
SETGET_TRIGGER_SKIPPING = 0x10000103UL
Sets of gets the current value of trigger skipping. Please refer to the trigger skip-
ping section of the documentation for more information.
enum ALAZAR_ECC_MODES
ECC Modes.

140 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Values:
ECC_DISABLE = 0
Disable.
ECC_ENABLE = 1
Enable.
enum ALAZAR_AUX_INPUT_LEVELS
Auxiliary input levels.
Values:
AUX_INPUT_LOW = 0
Low level.
AUX_INPUT_HIGH = 1
High level.
enum ALAZAR_PACK_MODES
Data pack modes.
Values:
PACK_DEFAULT = 0
Default pack mode of the board.
PACK_8_BITS_PER_SAMPLE = 1
8 bits per sample
PACK_12_BITS_PER_SAMPLE = 2
12 bits per sample
enum ALAZAR_API_TRACE_STATES
API trace states.
Values:
API_DISABLE_TRACE = 0
Trace disabled.
API_ENABLE_TRACE = 1
Trace enabled.

6.60 AlazarGetParameterLL

6.60.1 Func on Syntax

RETURN_CODE AlazarGetParameterLL(HANDLE handle, U8 channel, U32 parameter,


S64 *retValue)
Get a device parameter as a long long value.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.

©2008-2021 Alazar Technologies Inc. 141


ATS-SDK Documenta on, Release 7.5.0

Parameters
• [in] handle: Board handle
• [in] channel: The channel to control. See ALAZAR_CHANNELS for a list of
possible values. This parameter only takes unsigned 8-bit values.
• [in] parameter: The Parameter to modify. This can be one of
ALAZAR_PARAMETERS.
• [in] retValue: Parameter’s value

6.61 AlazarGetParameterUL

6.61.1 Func on Syntax

RETURN_CODE AlazarGetParameterUL(HANDLE handle, U8 channel, U32 parameter,


U32 *retValue)
Get a device parameter as an unsigned long value.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] channel: The channel to control. See ALAZAR_CHANNELS for a list of
possible values. This parameter only takes unsigned 8-bit values.
• [in] parameter: The Parameter to modify. This can be one of
ALAZAR_PARAMETERS_UL.
• [in] retValue: Parameter’s value

6.61.2 LabVIEW Block Diagram

142 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.61.3 Related Enumera ons

enum ALAZAR_PARAMETERS_UL
Parameters suitable to be used with AlazarSetParameterUL() and/or AlazarGetParam-
eterUL()
Values:
SET_ADC_MODE = 0x10000047UL
Sets the ADC mode. The value must be a member of ALAZAR_ADC_MODES. When
this parameter is used, channels must be one or more channels OR’ed together.
CHANNEL_ALL is not allowed.
SET_BUFFERS_PER_TRIGGER_ENABLE = 0x10000097UL
Configures the number of DMA buffers acquired after each trigger enable event.
The default value is 1.
It is possible to make the number of buffers per trigger enable infinite by passing
a value of 0xFFFFFFFF to this parameter. In this case, trigger enable essentially
becomes a “start of acquisition” signal.

Remark To set the number of buffers per trigger enable, this must
be called after AlazarBeforeAsyncRead() but before AlazarStartCap-
ture(), which means that AlazarBeforeAsyncRead() must be called with
ADMA_EXTERNAL_STARTCAPTURE
Remark This parameter is reset in between acquisitions.

GET_POWER_MONITOR_STATUS = 0x10000098UL
Queries the status of the power monitor on the board. The value returned is
zero if there is no problem. If it is not zero, please send the value returned to
AlazarTech’s technical support.
SET_EXT_TRIGGER_RANGE = 0x1000001CUL
Configure external trigger range. Parameter is as a member of
ALAZAR_EXTERNAL_TRIGGER_RANGES
enum ALAZAR_ADC_MODES
Analog to digital converter modes.
Values:
ADC_MODE_DEFAULT = 0
Default ADC mode.
ADC_MODE_DES = 1
Dual-edge sampling mode.

©2008-2021 Alazar Technologies Inc. 143


ATS-SDK Documenta on, Release 7.5.0

6.62 AlazarGetSDKVersion

6.62.1 Func on Syntax

RETURN_CODE AlazarGetSDKVersion(U8 *major, U8 *minor, U8 *revision)


Get the driver library version. This is the version of ATSApi.dll under Windows, or
ATSApi.so under Linux.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark Note that the version number returned is that of the driver library file, not
the ATS-SDK version number. SDK releases are given a version number with the
format X.Y.Z where: X is the major release number, Y is the minor release number,
and Z is the minor revision number.
See AlazarGetCPLDVersion()
See AlazarGetDriverVersion()
Parameters
• [out] major: The SDK major version number
• [out] minor: The SDK minor version number
• [out] revision: The SDK revision number

6.62.2 LabVIEW Block Diagram

6.63 AlazarGetStatus

6.63.1 Func on Syntax

U32 AlazarGetStatus(HANDLE handle)


Return a bitmask with board status information.

Return If the function fails, the return value is 0xFFFFFFFF. Upon success, the return
value is a bit mask of the following values:
• 1 : At least one trigger timeout occured.
• 2 : At least one channel A sample was out of range during the last acquisition.

144 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• 4 : At least one channel B sample was out of range during the last acquisition.
• 8 : PLL is locked (ATS660 only)
Note This function is part of the single-port data acquisition API. It cannot be used
with the dual-port AutoDMA APIs.
Parameters
• [in] handle: Board handle

6.63.2 LabVIEW Block Diagram

6.64 AlazarGetSystemHandle

6.64.1 Func on Syntax

HANDLE AlazarGetSystemHandle(U32 systemId)


Return the handle of the master board in the specified board system.

Remark If the board system specified contains a single, independent board, this func-
tion returns a handle to that board.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] systemId: System identification number

6.64.2 LabVIEW Block Diagram

©2008-2021 Alazar Technologies Inc. 145


ATS-SDK Documenta on, Release 7.5.0

6.65 AlazarGetTriggerAddress

6.65.1 Func on Syntax

RETURN_CODE AlazarGetTriggerAddress(HANDLE handle, U32 Record, U32 *Trig-


gerAddress, U32 *TimeStampHighPart, U32
*TimeStampLowPart)
Get the timestamp and trigger address of the trigger event in a record acquired to
on-board memory.
The following code fragment demonstrates how to convert the trigger timestamp re-
turned by AlazarGetTriggerAddress() from counts to seconds.

__int64 timeStamp_cnt;
timeStamp_cnt = ((__int64) timestampHighPart) << 8;
timeStamp_cnt |= timestampLowPart & 0x0ff;
double samplesPerTimestampCount = 2; // board specific constant
double samplesPerSec = 50.e6; // sample rate
double timeStamp_sec = (double) samplesPerTimestampCount *
timeStamp_cnt / samplesPerSec;

The sample per timestamp count value depends on the board model. See board-
specific information to know which value applies to which board.

Return ApiError2 (604) if it is called after a dual-port acquisition. This function


should be called after a single-port acquisition only.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark This function can be used in single-port acquisitions only.
Parameters
• [in] handle: Board handle
• [in] Record: Record in acquisition (1-indexed)
• [out] TriggerAddress: The trigger address
• [out] TimeStampHighPart: The most significant 32-bits of a record timestamp
• [out] TimeStampLowPart: The least significant 8-bits of a record timestamp

146 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.65.2 LabVIEW Block Diagram

6.66 AlazarGetTriggerTimestamp

6.66.1 Func on Syntax

RETURN_CODE AlazarGetTriggerTimestamp(HANDLE handle, U32 Record, U64 *Times-


tamp_samples)
Retrieve the timestamp, in sample clock periods, of a record acquired to on-board
memory.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark This function is part of the single-port data acquisition API. It cannot be used
to retrieve the timestamp of records acquired using dual-port AutoDMA APIs.
Parameters
• [in] handle: Board handle
• [in] Record: 1-indexed record in acquisition
• [in] Timestamp_samples: Record timestamp, in sample clock periods

6.67 AlazarGetWhoTriggeredBySystemHandle

6.67.1 Func on Syntax

U32 AlazarGetWhoTriggeredBySystemHandle(HANDLE systemHandle, U32 boardId, U32


recordNumber)
Return which event caused a board system to trigger and capture a record to on-board
memory.

Return One of the following values:


• 0 : This board did not cause the system to trigger
• 1 : CH A on this board caused the system to trigger
• 2 : CH B on this board caused the system to trigger
• 3 : EXT TRIG IN on this board caused the system to trigger

©2008-2021 Alazar Technologies Inc. 147


ATS-SDK Documenta on, Release 7.5.0

• 4 : Both CH A and CH B on this board caused the system to trigger


• 5 : Both CH A and EXT TRIG IN on this board caused the system to trigger
• 6 : Both CH B and EXT TRIG IN on this board caused the system to trigger
• 7 : A trigger timeout on this board caused the system to trigger
Note This function is part of the single-port API. It cannot be used with the dual-port
AutoDMA APIs.
Warning This API routine will not work with ATS850 version 1.2 hardware. Version
1.3 and higher version number of ATS850 are fully supported, as are all versions
of ATS330 and ATS310.
Parameters
• [in] systemHandle: Handle to a master board in a board system.
• [in] boardId: Board identifier of a board in the specified system.
• [in] recordNumber: Record in acquisition (1-indexed)

6.67.2 LabVIEW Block Diagram

6.68 AlazarGetWhoTriggeredBySystemID

6.68.1 Func on Syntax

U32 AlazarGetWhoTriggeredBySystemID(U32 systemId, U32 boardId, U32 recordNumber)


Return which event caused a board system to trigger and capture a record to on-board
memory.

Return One of the following values:


• 0 : This board did not cause the system to trigger
• 1 : CH A on this board caused the system to trigger
• 2 : CH B on this board caused the system to trigger
• 3 : EXT TRIG IN on this board caused the system to trigger
• 4 : Both CH A and CH B on this board caused the system to trigger
• 5 : Both CH A and EXT TRIG IN on this board caused the system to trigger
• 6 : Both CH B and EXT TRIG IN on this board caused the system to trigger

148 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• 7 : A trigger timeout on this board caused the system to trigger


Note This function is part of the single-port API. It cannot be used with the dual-port
AutoDMA APIs.
Warning This API routine will not work with ATS850 version 1.2 hardware. Version
1.3 and higher version number of ATS850 are fully supported, as are all versions
of ATS330 and ATS310.
Parameters
• [in] systemId: System indentifier
• [in] boardId: Board identifier of a board in the specified system.
• [in] recordNumber: Record in acquisition (1-indexed)

6.68.2 LabVIEW Block Diagram

6.69 AlazarHyperDisp

6.69.1 Func on Syntax

RETURN_CODE AlazarHyperDisp(HANDLE handle, void *buffer, U32 bufferSize, U8


*viewBuffer, U32 viewBufferSize, U32 numOfPixels,
U32 option, U32 channelSelect, U32 record, long trans-
ferOffset, U32 *error)
Enable the on-board FPGA to process records acquired to on-board memory, and
transfer the processed data to host memory.
HyperDisp processing enables the on-board FPGA to divide a record acquired to on-
board memory into intervals, find the minimum and maximum sample values during
each interval, and transfer an array of minimum and maximum sample values to a
buffer in host memory. This allows the acquisition of relatively long records to on-
board memory, but the transfer of relatively short, processed records to a buffer in
host memory.
For example, it would take an ATS860-256M about ~2.5 seconds to transfer a
250,000,000 sample record from on-board memory, across the PCI bus, to a buffer in
host memory. With HyperDisp enabled, it would take the on-board FPGA a fraction
of a second to process the record and transfer a few hundred samples from on-board
memory, across the PCI bus, to a buffer in host memory.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.

©2008-2021 Alazar Technologies Inc. 149


ATS-SDK Documenta on, Release 7.5.0

Note This function is part of the single-port data acquisition API. It cannot be used
with the dual-port AutoDMA APIs.
Parameters
• [in] handle: Board handle
• [in] buffer: Reserved (Set to NULL)
• [in] bufferSize: Number of samples to process
• [out] viewBuffer: Buffer to receive processed data
• [in] viewBufferSize: Size of processed data buffer in bytes
• [in] numOfPixels: Number of HyperDisp points
• [in] option: Processing mode. Pass 1 to enable HyperDisp processing.
• [in] channelSelect: Channel to process
• [in] record: Record to process (1-indexed)
• [in] transferOffset: The offset, in samples, of first sample to process relative
to the trigger position in record.
• [out] error: Pointer to value to receive a result code.

6.70 AlazarInputControl

6.70.1 Func on Syntax

RETURN_CODE AlazarInputControl(HANDLE handle, U8 channel, U32 coupling, U32 in-


putRange, U32 impedance)
Select the input coupling, range, and impedance of a digitizer channel.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle.
• [in] channel: The channel to control. See ALAZAR_CHANNELS for a list of
possible values. This parameter only takes unsigned 8-bit values. To config-
ure channel I and above, see AlazarInputControlEx().
• [in] inputRange: Specify the input range of the selected channel. See
ALAZAR_INPUT_RANGES for a list of all existing input ranges. Consult board-
specific information to see which input ranges are supported by each board.
• [in] coupling: Specifies the coupling of the selected channel. Must be an
element of ALAZAR_COUPLINGS

150 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• [in] impedance: Specify the input impedance to set for the selected channel.
See ALAZAR_IMPEDANCES for a list of all existing values. See the board-
specific documentation to see impedances supported by various boards.

6.70.2 LabVIEW Block Diagram

6.70.3 Related Enumera ons

enum ALAZAR_CHANNELS
Channel identifiers.
Values:
CHANNEL_ALL = 0x00000000
All channels.
CHANNEL_A = 0x00000001
Channel A.
CHANNEL_B = 0x00000002
Channel B.
CHANNEL_C = 0x00000004
Channel C.
CHANNEL_D = 0x00000008
Channel D.
CHANNEL_E = 0x00000010
Channel E.
CHANNEL_F = 0x00000020
Channel F.
CHANNEL_G = 0x00000040
Channel G.
CHANNEL_H = 0x00000080
Channel H.
CHANNEL_I = 0x00000100
Channel I.
CHANNEL_J = 0x00000200
Channel J.

©2008-2021 Alazar Technologies Inc. 151


ATS-SDK Documenta on, Release 7.5.0

CHANNEL_K = 0x00000400
Channel K.
CHANNEL_L = 0x00000800
Channel L.
CHANNEL_M = 0x00001000
Channel M.
CHANNEL_N = 0x00002000
Channel N.
CHANNEL_O = 0x00004000
Channel O.
CHANNEL_P = 0x00008000
Channel P.
enum ALAZAR_INPUT_RANGES
Input range identifiers.
Values:
INPUT_RANGE_PM_20_MV = 0x00000001UL
+/- 20mV
INPUT_RANGE_PM_40_MV = 0x00000002UL
+/- 40mV
INPUT_RANGE_PM_50_MV = 0x00000003UL
+/- 50mV
INPUT_RANGE_PM_80_MV = 0x00000004UL
+/- 80mV
INPUT_RANGE_PM_100_MV = 0x00000005UL
+/- 100mV
INPUT_RANGE_PM_200_MV = 0x00000006UL
+/- 200mV
INPUT_RANGE_PM_400_MV = 0x00000007UL
+/- 400mV
INPUT_RANGE_PM_500_MV = 0x00000008UL
+/- 500mV
INPUT_RANGE_PM_800_MV = 0x00000009UL
+/- 800mV
INPUT_RANGE_PM_1_V = 0x0000000AUL
+/- 1V
INPUT_RANGE_PM_2_V = 0x0000000BUL
+/- 2V

152 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

INPUT_RANGE_PM_4_V = 0x0000000CUL
+/- 4V
INPUT_RANGE_PM_5_V = 0x0000000DUL
+/- 5V
INPUT_RANGE_PM_8_V = 0x0000000EUL
+/- 8V
INPUT_RANGE_PM_10_V = 0x0000000FUL
+/- 10V
INPUT_RANGE_PM_20_V = 0x00000010UL
+/- 20V
INPUT_RANGE_PM_40_V = 0x00000011UL
+/- 40V
INPUT_RANGE_PM_16_V = 0x00000012UL
+/- 16V
INPUT_RANGE_UNCALIBRATED = 0x00000020UL
no gain
INPUT_RANGE_PM_1_V_25 = 0x00000021UL
+/- 1.25V
INPUT_RANGE_PM_2_V_5 = 0x00000025UL
+/- 2.5V
INPUT_RANGE_PM_125_MV = 0x00000028UL
+/- 125mV
INPUT_RANGE_PM_250_MV = 0x00000030UL
+/- 250mV
INPUT_RANGE_0_TO_40_MV = 0x00000031UL
0 to 40mV
INPUT_RANGE_0_TO_80_MV = 0x00000032UL
0 to 80mV
INPUT_RANGE_0_TO_100_MV = 0x00000033UL
0 to 100mV
INPUT_RANGE_0_TO_160_MV = 0x00000034UL
0 to 160mV
INPUT_RANGE_0_TO_200_MV = 0x00000035UL
0 to 200mV
INPUT_RANGE_0_TO_250_MV = 0x00000036UL
0 to 250mV
INPUT_RANGE_0_TO_400_MV = 0x00000037UL
0 to 400mV

©2008-2021 Alazar Technologies Inc. 153


ATS-SDK Documenta on, Release 7.5.0

INPUT_RANGE_0_TO_500_MV = 0x00000038UL
0 to 500mV
INPUT_RANGE_0_TO_800_MV = 0x00000039UL
0 to 800mV
INPUT_RANGE_0_TO_1_V = 0x0000003AUL
0 to 1V
INPUT_RANGE_0_TO_1600_MV = 0x0000003BUL
0 to 1.6V
INPUT_RANGE_0_TO_2_V = 0x0000003CUL
0 to 2V
INPUT_RANGE_0_TO_2_V_5 = 0x0000003DUL
0 to 2.5V
INPUT_RANGE_0_TO_4_V = 0x0000003EUL
0 to 4V
INPUT_RANGE_0_TO_5_V = 0x0000003FUL
0 to 5V
INPUT_RANGE_0_TO_8_V = 0x00000040UL
0 to 8V
INPUT_RANGE_0_TO_10_V = 0x00000041UL
0 to 10V
INPUT_RANGE_0_TO_16_V = 0x00000042UL
0 to 16V
INPUT_RANGE_0_TO_20_V = 0x00000043UL
0 to 20V
INPUT_RANGE_0_TO_80_V = 0x00000044UL
0 to 80V
INPUT_RANGE_0_TO_32_V = 0x00000045UL
0 to 32V
INPUT_RANGE_0_TO_MINUS_40_MV = 0x00000046UL
0 to -40mV
INPUT_RANGE_0_TO_MINUS_80_MV = 0x00000047UL
0 to -80mV
INPUT_RANGE_0_TO_MINUS_100_MV = 0x00000048UL
0 to -100mV
INPUT_RANGE_0_TO_MINUS_160_MV = 0x00000049UL
0 to -160mV
INPUT_RANGE_0_TO_MINUS_200_MV = 0x0000004AUL
0 to -200mV

154 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

INPUT_RANGE_0_TO_MINUS_250_MV = 0x0000004BUL
0 to -250mV
INPUT_RANGE_0_TO_MINUS_400_MV = 0x0000004CUL
0 to -400mV
INPUT_RANGE_0_TO_MINUS_500_MV = 0x0000004DUL
0 to -500mV
INPUT_RANGE_0_TO_MINUS_800_MV = 0x0000004EUL
0 to -800mV
INPUT_RANGE_0_TO_MINUS_1_V = 0x0000004FUL
0 to -1V
INPUT_RANGE_0_TO_MINUS_1600_MV = 0x00000050UL
0 to -1.6V
INPUT_RANGE_0_TO_MINUS_2_V = 0x00000051UL
0 to -2V
INPUT_RANGE_0_TO_MINUS_2_V_5 = 0x00000052UL
0 to -2.5V
INPUT_RANGE_0_TO_MINUS_4_V = 0x00000053UL
0 to -4V
INPUT_RANGE_0_TO_MINUS_5_V = 0x00000054UL
0 to -5V
INPUT_RANGE_0_TO_MINUS_8_V = 0x00000055UL
0 to -8V
INPUT_RANGE_0_TO_MINUS_10_V = 0x00000056UL
0 to -10V
INPUT_RANGE_0_TO_MINUS_16_V = 0x00000057UL
0 to -16V
INPUT_RANGE_0_TO_MINUS_20_V = 0x00000058UL
0 to 20V
INPUT_RANGE_0_TO_MINUS_80_V = 0x00000059UL
0 to 80V
INPUT_RANGE_0_TO_MINUS_32_V = 0x00000060UL
0 to 32V
INPUT_RANGE_UNCALIBRATED_PM_750_MV = 0x00000061UL
no gain +/- 750mV
enum ALAZAR_COUPLINGS
Coupling identifiers.
Values:

©2008-2021 Alazar Technologies Inc. 155


ATS-SDK Documenta on, Release 7.5.0

AC_COUPLING = 0x00000001UL
AC coupling.
DC_COUPLING = 0x00000002UL
DC coupling.
GND_COUPLING = 0x00000004UL
Ground coupling.
enum ALAZAR_IMPEDANCES
Impedance indentifiers.
Values:
IMPEDANCE_1M_OHM = 0x00000001UL
IMPEDANCE_50_OHM = 0x00000002UL
IMPEDANCE_75_OHM = 0x00000004UL
IMPEDANCE_300_OHM = 0x00000008UL

6.71 AlazarInputControlEx

6.71.1 Func on Syntax

RETURN_CODE AlazarInputControlEx(HANDLE handle, U32 channel, U32 couplingId,


U32 rangeId, U32 impedanceId)
Select the input coupling, range and impedance of a digitizer channel.
This function is the equivalent of AlazarInputControl() with a U32-typed parameter to
pass the channel. This allows for boards with more than 8 channels to be configured.

6.71.2 LabVIEW Block Diagram

156 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.72 AlazarNumOfSystems

6.72.1 Func on Syntax

U32 AlazarNumOfSystems(void)
Get the total number of board systems detected.
A board system is a group of one or more digitizer boards that share clock and trigger
signals. A board system may be composed of a single independent board, or a group
of two or more digitizer boards connected together with a SyncBoard.

Return The total number of board systems detected

6.73 AlazarOCTIgnoreBadClock

6.73.1 Func on Syntax

RETURN_CODE AlazarOCTIgnoreBadClock(HANDLE handle, U32 enable, double


goodClockDuration_seconds, double bad-
ClockDuration_seconds, double *trig-
gerCycleTime_seconds, double *trigger-
PulseWidth_seconds)
Enables or disables the OCT ignore bad clock mechanism.
This function must be called before an acquisition starts. It informs the digitizer about
portions of time during which the external clock signal is valid, and others during
which it is invalid and should be ignored.
“good” clock portions are durations of time during which the external clock signal is
valid, i.e. within the board’s specifications. “bad” clock portions are durations of time
during which the clock signal is invalid.
When OCT Ignore Bad Clock is active, the digitizer must be set in external TTL trigger
mode, and in external clock mode.
The external clock signal must be good when trigger events are received on the exter-
nal trigger connector. The duration of time after the trigger event during which the
clock signal is good is specified in goodClockDuration_seconds. After this good duration,
the portion of time during which the clock may be bad is specified in badClockDura-
tion_seconds.
The sum of goodClockDuration_seconds and badClockDuration_seconds must be less than
the trigger cycle time. This means that the clock signal must be back to being good
before the next trigger event.

Return If the function succeeds, it returns ApiSuccess.


Return If an invalid board handle is passed to the function, it returns ApiNullParam.

©2008-2021 Alazar Technologies Inc. 157


ATS-SDK Documenta on, Release 7.5.0

Return If an invalid value is passed for any of enable, goodClockDuration_seconds or


badClockDuration_seconds, it returns ApiInvalidData.
Return If OCT ignore bad clock is not supported by the board and/or firmware, it
returns ApiOCTIgnoreBadClockNotSupported.
Return If no trigger signal is detected by the board, it returns ApiOCTNoTriggerDe-
tected.
Return If the trigger rate is too fast for the provided good and bad clock durations, it
returns ApiOCTTriggerTooFast.
Remark This function must be called prior to calling AlazarBeforeAsyncRead().
Remark Trigger source must be set to TRIG_EXTERNAL
Remark Trigger input range must be ETR_TTL.
Remark Clock source must be set to FAST_EXTERNAL_CLOCK.
Parameters
• [in] handle: Handle to board
• [in] enable: Enables (1) or disables (0) the feature
• [in] goodClockDuration_seconds: Good clock duration in seconds
• [in] badClockDuration_seconds: Bad clock duration in seconds
• [out] triggerCycleTime_seconds: Trigger cycle time measured by the board
• [out] triggerPulseWidth_seconds: Trigger pulse width measured by the board

6.73.2 LabVIEW Block Diagram

6.74 AlazarPostAsyncBuffer

6.74.1 Func on Syntax

RETURN_CODE AlazarPostAsyncBuffer(HANDLE handle, void *buffer, U32 buffer-


Length_bytes)
Posts a DMA buffer to a board.

158 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

This function adds a DMA buffer to the end of a list of buffers available to be filled
by the board. Use AlazarWaitAsyncBufferComplete() to determine if the board has re-
ceived sufficient trigger events to fill this buffer.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark You must call AlazarBeforeAsyncRead() before calling AlazarPostA-
syncBuffer().
Warning You must call AlazarAbortAsyncRead() before your application exits if you
have called AlazarPostAsyncBuffer() and buffers are pending when your applica-
tion exits.
Remark The bufferLength_bytes parameter must be equal to the product of the num-
ber of bytes per record, the number of records per buffer and the number of
enabled channels. If record headers are enabled, the number of bytes per record
must include the size of the record header (16 bytes).
Parameters
• [in] handle: Handle to board
• [in] buffer: Pointer to buffer that will eventually receive data from the digi-
tizer board.
• [in] bufferLength_bytes: The length of the buffer in bytes.

6.75 AlazarQueryCapability

6.75.1 Func on Syntax

RETURN_CODE AlazarQueryCapability(HANDLE handle, U32 capability, U32 reserved,


U32 *retValue)
Get a device attribute as an unsigned 32-bit integer.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] capability: The board capability to query. Must be a member of
ALAZAR_CAPABILITIES.
• [in] reserved: Pass 0
• [out] retValue: Capability value

©2008-2021 Alazar Technologies Inc. 159


ATS-SDK Documenta on, Release 7.5.0

6.75.2 LabVIEW Block Diagram

6.75.3 Related Enumera ons

enum ALAZAR_CAPABILITIES
Capabilities that can be queried through AlazarQueryCapability()
Values:
GET_SERIAL_NUMBER = 0x10000024UL
Board’s serial number.
GET_FIRST_CAL_DATE = 0x10000025UL
First calibration date.
GET_LATEST_CAL_DATE = 0x10000026UL
Latest calibration date.
GET_LATEST_TEST_DATE = 0x10000027UL
Latest test date.
GET_LATEST_CAL_DATE_MONTH = 0x1000002DUL
Month of latest calibration.
GET_LATEST_CAL_DATE_DAY = 0x1000002EUL
Day of latest calibration.
GET_LATEST_CAL_DATE_YEAR = 0x1000002FUL
Year of latest calibration.
GET_BOARD_OPTIONS_LOW = 0x10000037UL
Low part of the board options.
GET_BOARD_OPTIONS_HIGH = 0x10000038UL
High part of the board options.
MEMORY_SIZE = 0x1000002AUL
The memory size in samples.
ASOPC_TYPE = 0x1000002CUL
The FPGA signature.
BOARD_TYPE = 0x1000002BUL
The board type as a member of ALAZAR_BOARDTYPES.
GET_PCIE_LINK_SPEED = 0x10000030UL
PCIe link speed in Gb/s.
GET_PCIE_LINK_WIDTH = 0x10000031UL
PCIe link width in lanes.

160 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

GET_MAX_PRETRIGGER_SAMPLES = 0x10000046UL
Maximum number of pre-trigger samples.
GET_CPF_DEVICE = 0x10000071UL
User-programmable FPGA device. 1 = SL50, 2 = SE260.
HAS_RECORD_FOOTERS_SUPPORT = 0x10000073UL
Queries if the board supports NPT record footers. Returns 1 if the feature is sup-
ported and 0 otherwise
CAP_SUPPORTS_TRADITIONAL_AUTODMA = 0x10000074UL
Queries if the board supports the AutoDMA Traditional acquisition mode. Re-
turns 1 if the feature is supported and 0 otherwise.
CAP_SUPPORTS_NPT_AUTODMA = 0x10000075UL
Queries if the board supports the AutoDMA NPT accquisition mode. Returns 1 if
the feature is supported and 0 otherwise.
CAP_MAX_NPT_PRETRIGGER_SAMPLES = 0x10000076UL
Queries the maximum number of pre-trigger samples that can be requested in the
AutoDMA NPT acquisition mode. This amount is shared between all the channels
of the board.
CAP_IS_VFIFO_BOARD = 0x10000077UL
Tests if this board of the virtual-FIFO type.
CAP_SUPPORTS_NATIVE_SINGLE_PORT = 0x10000078UL
Tests if this board features native support for single-port acquisitions. Returns 1
if native support is present, and 0 otherwise.
CAP_SUPPORT_8_BIT_PACKING = 0x10000079UL
Tests if this board supports 8-bit data packing. Returns 1 if this board has a native
resolution of more than 8 bits and supports 8-bit packing.
CAP_SUPPORT_12_BIT_PACKING = 0x10000080UL
Tests if this board supports 12-bit data packing. Returns 1 if support is present,
and 0 otherwise.
HAS_RECORD_HEADERS_SUPPORT = 0x10000081UL
Tests if this board supports record headers. Returns 1 if support is present, and 0
otherwise.
CAP_SUPPORT_TRADITIONAL_SAMPLES_INTERLEAVED = 0x10000082UL
Tests if this board supports samples interleaved in traditional mode. Returns 1 if
support is present, and 0 otherwise.
CAP_SUPPORT_SOFTWARE_CAL = 0x10000083UL
Tests if this board supports software calibration. Returns 1 if support is present,
and 0 otherwise.
CAP_SUPPORTS_API_LOG_CLEAR = 0x10000084UL
Tests if this board supports API log clear. Returns 1 if support is present, and 0
otherwise.

©2008-2021 Alazar Technologies Inc. 161


ATS-SDK Documenta on, Release 7.5.0

CAP_SUPPORTS_TRIGGER_SKIPPING = 0x10000085UL
Tests if this board supports trigger skipping. Returns 1 if support is present, and
0 otherwise.
enum ALAZAR_BOARD_OPTIONS_LOW
AlazarTech board options. Lower 32-bits.
Values:
OPTION_STREAMING_DMA = (1UL << 0)
OPTION_EXTERNAL_CLOCK = (1UL << 1)
OPTION_DUAL_PORT_MEMORY = (1UL << 2)
OPTION_180MHZ_OSCILLATOR = (1UL << 3)
OPTION_LVTTL_EXT_CLOCK = (1UL << 4)
OPTION_SW_SPI = (1UL << 5)
OPTION_ALT_INPUT_RANGES = (1UL << 6)
OPTION_VARIABLE_RATE_10MHZ_PLL = (1UL << 7)
OPTION_MULTI_FREQ_VCO = (1UL << 7)
OPTION_2GHZ_ADC = (1UL << 8)
OPTION_DUAL_EDGE_SAMPLING = (1UL << 9)
OPTION_DCLK_PHASE = (1UL << 10)
OPTION_WIDEBAND = (1UL << 11)
OPTION_USER_CALIBRATION = (1UL << 15)
enum ALAZAR_BOARD_OPTIONS_HIGH
AlazarTech board options. Higher 32-bits.
Values:
OPTION_OEM_FPGA = (1UL << 15)

6.76 AlazarQueryCapabilityLL

6.76.1 Func on Syntax

RETURN_CODE AlazarQueryCapabilityLL(HANDLE handle, U32 capability, U32 re-


served, S64 *retValue)
Get a device attribute as a 64-bit integer.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters

162 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• [in] handle: Board handle


• [in] capability: The board capability to query. Must be a member of
ALAZAR_CAPABILITIES.
• [in] reserved: Pass 0
• [out] retValue: Capability value

6.77 AlazarRead

6.77.1 Func on Syntax

U32 AlazarRead(HANDLE handle, U32 channelId, void *buffer, int elementSize, long
record, long transferOffset, U32 transferLength)
Read all of part of a record from on-board memory to host memory (RAM).
The record must be less than 2,147,483,648 samples long.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Note AlazarRead() is part of the single-port API, it cannot be used in a dual-port con-
text.
Remark AlazarRead() can transfer segments of a record. This may be useful if a full
record is too large to transfer as a single clock, or if only part of a record is of
interest.
Remark Use AlazarReadEx() To transfer records with more than 2 billion samples.
Parameters
• [in] handle: Board handle
• [in] channelId: The channel identifier of the record to read.
• [out] buffer: Buffer to receive sample data
• [in] elementSize: Number of bytes per sample
• [in] record: Index of the record to transfer (1-indexed)
• [in] transferOffset: The offset, in samples, from the trigger position in the
record, of the first sample to transfer.
• [in] transferLength: The number of samples to transfer.

©2008-2021 Alazar Technologies Inc. 163


ATS-SDK Documenta on, Release 7.5.0

6.77.2 LabVIEW Block Diagram

6.78 AlazarReadEx

6.78.1 Func on Syntax

U32 AlazarReadEx(HANDLE handle, U32 channelId, void *buffer, int elementSize, long
record, INT64 transferOffset, U32 transferLength)
Read all or part of a record from an acquisition to on-board memory from on-board
memory to a buffer in hsot memory. The record may be longer than 2 billion samples.
Use AlazarRead() or AlazarReadEx() to transfer records with less than 2 billion sam-
ples. Use AlazarReadEx() to transfer records with more than 2 billion samples.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Note AlazarReadEx() is part of the single-port data acquisition API. It cannot be used
with the dual-port AutoDMA APIs.
Remark AlazarReadEx() can transfer segments of a record to on-board memory. This
may be useful if a full record is too large to transfer as a single block, or if only
part of a record is of interest.
Parameters
• [in] handle: Handle to board
• [in] channelId: channel identifier of record to read
• [out] buffer: Buffer to receive sample data
• [in] elementSize: number of bytes per sample
• [in] record: record in on-board memory to transfer to buffer (1-indexed).
• [in] transferOffset: The offset in samples from the trigger position in the
record of the first sample in the record in on-board memory to transfer to the
buffer
• [in] transferLength: The number of samples to transfer from the record in
on-board memory to the buffer.

164 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.79 AlazarResetTimeStamp

6.79.1 Func on Syntax

RETURN_CODE AlazarResetTimeStamp(HANDLE handle, U32 option)


Resets the record timestamp counter.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark This function is not supported by ATS310, ATS330 and ATS850
Parameters
• [in] handle: Handle to board
• [in] option: Record timestamp reset option. Can be one of
ALAZAR_TIMESTAMP_RESET_OPTIONS.

6.79.2 LabVIEW Block Diagram

6.79.3 Related Enumera ons

enum ALAZAR_TIMESTAMP_RESET_OPTIONS
Timestamp reset options. See AlazarResetTimeStamp()
Values:
TIMESTAMP_RESET_FIRSTTIME_ONLY = 0x00000000UL
TIMESTAMP_RESET_ALWAYS = 0x00000001UL

6.80 AlazarSetADCBackgroundCompensa on

6.80.1 Func on Syntax

RETURN_CODE AlazarSetADCBackgroundCompensation(HANDLE handle, BOOL active)


Activates or deactivates the ADC background compensation.

Remark This feature does not exist on all boards. Please check board-specific infor-
mation for more details.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.

©2008-2021 Alazar Technologies Inc. 165


ATS-SDK Documenta on, Release 7.5.0

Parameters
• [in] handle: Handle to board
• [in] active: Determines whether this function activates or deactivates the
ADC background compensation.

6.81 AlazarSetBWLimit

6.81.1 Func on Syntax

RETURN_CODE AlazarSetBWLimit(HANDLE handle, U32 channel, U32 enable)


Activates the bandwith limiter of an input channel. Not all boards support a band-
width limiter. See board-specific documentation for more information.

Remark The bandwidth limiter is disabled by default. When enabled, the bandwith
is limited to approximatively 20 MHz.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] channel: The channel identifier. Must be a channel from
ALAZAR_CHANNELS.
• [in] enable: Pass 1 to enable the bandwith limit, or zero otherwise.

6.81.2 LabVIEW Block Diagram

6.82 AlazarSetCaptureClock

6.82.1 Func on Syntax

RETURN_CODE AlazarSetCaptureClock(HANDLE handle, U32 source, U32 sampleRateI-


dOrValue, U32 edgeId, U32 decimation)
Configure the sample clock source, edge and decimation.

• If a board is configured to use a SLOW_EXTERNAL_CLOCK clock source, the max-


imum decimation value is 1.

166 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

• If an ATS9350 is configured to use an EXTERNAL_CLOCK_10MHZ_REF clock


source, the decimation value must be 1, 2, 4 or any multiple of 5. Note that the
sample rate identifier value must be 500000000, and the sample rate will be 500
MHz divided by the decimation value.
• If an ATS9360 / ATS9371 / ATS9373 is configured to use an EXTER-
NAL_CLOCK_10MHZ_REF clock source, the maximum decimation value is
1.
• If an ATS9850 is configured to use an EXTERNAL_CLOCK_10MHZ_REF clock
source, the decimation value must be 1, 2, 4 or any multiple of 10. Note that the
sample rate identifier value must be 500000000, and the sample rate will be 500
MHz divided by the decimation value.
• If an ATS9870 is configured to use an EXTERNAL_CLOCK_10MHZ_REF clock
source, the decimation value must be 1, 2, 4 or any multiple of 10. Note that the
sample rate identifier value must be 1000000000, and the sample rate will be 1
GHz divided by the decimation value.

Parameters
• [in] handle: Board handle
• [in] source: Clock source identifiers. Must be a member of
ALAZAR_CLOCK_SOURCES. See board-specific information for a list of
valid values for each board. For external clock types, the identifier to choose
may depend on the clock’s frequency. See board-specific information for a
list of frequency ranges for all clock types.
• [in] sampleRateIdOrValue: If the clock source chosen is INTERNAL_CLOCK,
this value is a member of ALAZAR_SAMPLE_RATES that defines the internal
sample rate to choose. Valid values for each board vary. If the clock source
chosen is EXTERNAL_CLOCK_10MHZ_REF, pass the value of the sample clock
to generate from the reference in hertz. The values that can be generated
depend on the board model. Otherwise, the clock source is external, pass
SAMPLE_RATE_USER_DEF to this parameter.
• [in] edgeId: The external clock edge on which to latch sample rate. Must be
a member of ALAZAR_CLOCK_EDGES.
• [in] decimation: Decimation value. May be an integer between 0 and 100000
with the following exceptions. Note that a decimation value of 0 means dis-
able decimation.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.

©2008-2021 Alazar Technologies Inc. 167


ATS-SDK Documenta on, Release 7.5.0

6.82.2 LabVIEW Block Diagram

6.82.3 Related Enumera ons

enum ALAZAR_CLOCK_SOURCES
Clock source identifiers.
Values:
INTERNAL_CLOCK = 0x00000001UL
Internal clock.
EXTERNAL_CLOCK = 0x00000002UL
External clock.
FAST_EXTERNAL_CLOCK = 0x00000002UL
Fast external clock.
MEDIUM_EXTERNAL_CLOCK = 0x00000003UL
Medium external clock.
SLOW_EXTERNAL_CLOCK = 0x00000004UL
Slow external clock.
EXTERNAL_CLOCK_AC = 0x00000005UL
AC external clock.
EXTERNAL_CLOCK_DC = 0x00000006UL
DC external clock.
EXTERNAL_CLOCK_10MHZ_REF = 0x00000007UL
10MHz external reference
INTERNAL_CLOCK_10MHZ_REF = 0x00000008
Internal 10MHz reference.
EXTERNAL_CLOCK_10MHZ_PXI = 0x0000000A
External 10MHz PXI.
enum ALAZAR_SAMPLE_RATES
Sample rate identifiers.
Values:
SAMPLE_RATE_1KSPS = 0X00000001UL
SAMPLE_RATE_2KSPS = 0X00000002UL

168 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

SAMPLE_RATE_5KSPS = 0X00000004UL
SAMPLE_RATE_10KSPS = 0X00000008UL
SAMPLE_RATE_20KSPS = 0X0000000AUL
SAMPLE_RATE_50KSPS = 0X0000000CUL
SAMPLE_RATE_100KSPS = 0X0000000EUL
SAMPLE_RATE_200KSPS = 0X00000010UL
SAMPLE_RATE_500KSPS = 0X00000012UL
SAMPLE_RATE_1MSPS = 0X00000014UL
SAMPLE_RATE_2MSPS = 0X00000018UL
SAMPLE_RATE_5MSPS = 0X0000001AUL
SAMPLE_RATE_10MSPS = 0X0000001CUL
SAMPLE_RATE_20MSPS = 0X0000001EUL
SAMPLE_RATE_25MSPS = 0X00000021UL
SAMPLE_RATE_50MSPS = 0X00000022UL
SAMPLE_RATE_100MSPS = 0X00000024UL
SAMPLE_RATE_125MSPS = 0x00000025UL
SAMPLE_RATE_160MSPS = 0x00000026UL
SAMPLE_RATE_180MSPS = 0x00000027UL
SAMPLE_RATE_200MSPS = 0X00000028UL
SAMPLE_RATE_250MSPS = 0X0000002BUL
SAMPLE_RATE_400MSPS = 0X0000002DUL
SAMPLE_RATE_500MSPS = 0X00000030UL
SAMPLE_RATE_800MSPS = 0X00000032UL
SAMPLE_RATE_1000MSPS = 0x00000035UL
SAMPLE_RATE_1GSPS = SAMPLE_RATE_1000MSPS
SAMPLE_RATE_1200MSPS = 0x00000037UL
SAMPLE_RATE_1500MSPS = 0x0000003AUL
SAMPLE_RATE_1600MSPS = 0x0000003BUL
SAMPLE_RATE_1800MSPS = 0x0000003DUL
SAMPLE_RATE_2000MSPS = 0x0000003FUL
SAMPLE_RATE_2GSPS = SAMPLE_RATE_2000MSPS
SAMPLE_RATE_2400MSPS = 0x0000006AUL

©2008-2021 Alazar Technologies Inc. 169


ATS-SDK Documenta on, Release 7.5.0

SAMPLE_RATE_3000MSPS = 0x00000075UL
SAMPLE_RATE_3GSPS = SAMPLE_RATE_3000MSPS
SAMPLE_RATE_3600MSPS = 0x0000007BUL
SAMPLE_RATE_4000MSPS = 0x00000080UL
SAMPLE_RATE_4GSPS = SAMPLE_RATE_4000MSPS
SAMPLE_RATE_300MSPS = 0x00000090UL
SAMPLE_RATE_350MSPS = 0x00000094UL
SAMPLE_RATE_370MSPS = 0x00000096UL
SAMPLE_RATE_5000MSPS = 0x000000A0UL
SAMPLE_RATE_5GSPS = SAMPLE_RATE_5000MSPS
SAMPLE_RATE_10000MSPS = 0x000000B0UL
SAMPLE_RATE_10GSPS = SAMPLE_RATE_10000MSPS
SAMPLE_RATE_1333MSPS_RECUR_DECIMAL = 0x000000C0UL
SAMPLE_RATE_2666MSPS_RECUR_DECIMAL = 0x000000C1UL
SAMPLE_RATE_USER_DEF = 0x00000040UL
User-defined sample rate. Used with external clock.
enum ALAZAR_CLOCK_EDGES
Clock edge identifiers.
Values:
CLOCK_EDGE_RISING = 0x00000000UL
Rising clock edge.
CLOCK_EDGE_FALLING = 0x00000001UL
Falling clock edge.

6.83 AlazarSetExternalClockLevel

6.83.1 Func on Syntax

RETURN_CODE AlazarSetExternalClockLevel(HANDLE handle, float level_percent)


Set the external clock comparator level.

Remark Only the following boards support this feature: ATS460, ATS660, ATS860,
ATS9350, ATS9351, ATS9352, ATS9353 ATS9440, ATS9462, ATS9625, ATS9626,
ATS9870, ATS9872.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.

170 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Parameters
• [in] handle: Board handle
• [in] level_percent: The external clock comparator level, in percent.

6.83.2 LabVIEW Block Diagram

6.84 AlazarSetExternalTrigger

6.84.1 Func on Syntax

RETURN_CODE AlazarSetExternalTrigger(HANDLE handle, U32 couplingId, U32


rangeId)
Set the external trigger range and coupling.

Parameters
• [in] handle: Board handle
• [in] couplingId: Specifies the external trigger coupling. See
ALAZAR_COUPLINGS for existing values. Consult board-specific infor-
mation to see which values are supported by each board.
• [in] rangeId: Specifies the external trigger range. See
ALAZAR_EXTERNAL_TRIGGER_RANGES for a list of all existing values.
Consult board-specific information to see which values are supported by
each board.

6.84.2 LabVIEW Block Diagram

©2008-2021 Alazar Technologies Inc. 171


ATS-SDK Documenta on, Release 7.5.0

6.84.3 Related Enumera ons

enum ALAZAR_EXTERNAL_TRIGGER_RANGES
External trigger range identifiers.
Values:
ETR_5V_50OHM = 0x00000000UL
5V-50OHM range
ETR_1V_50OHM = 0x00000001UL
1V-50OHM range
ETR_TTL = 0x00000002UL
TTL range.
ETR_2V5_50OHM = 0x00000003UL
2V5-50OHM range
ETR_5V_300OHM = 0x00000004UL
5V-300OHM range

6.85 AlazarSetLED

6.85.1 Func on Syntax

RETURN_CODE AlazarSetLED(HANDLE handle, U32 state)


Control the LED on a board’s mounting bracket.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] state: to put the LED in. Must be a member of ALAZAR_LED

6.85.2 LabVIEW Block Diagram

172 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.85.3 Related Enumera ons

enum ALAZAR_LED
LED state identifiers.
Values:
LED_OFF = 0x00000000UL
OFF LED.
LED_ON = 0x00000001UL
ON LED.

6.86 AlazarSetParameter

6.86.1 Func on Syntax

RETURN_CODE AlazarSetParameter(HANDLE handle, U8 channel, U32 parameter, long


value)
Set a device parameter as a signed long value.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] channel: The channel to control. See ALAZAR_CHANNELS for a list of
possible values. This parameter only takes unsigned 8-bit values.
• [in] parameter: The Parameter to modify. This can be one of
ALAZAR_PARAMETERS.
• [in] value: Parameter value

6.87 AlazarSetParameterLL

6.87.1 Func on Syntax

RETURN_CODE AlazarSetParameterLL(HANDLE handle, U8 channel, U32 parameter,


S64 value)
Set a device parameter as a long long value.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle

©2008-2021 Alazar Technologies Inc. 173


ATS-SDK Documenta on, Release 7.5.0

• [in] channel: The channel to control. See ALAZAR_CHANNELS for a list of


possible values. This parameter only takes unsigned 8-bit values.
• [in] parameter: The Parameter to modify. This can be one of
ALAZAR_PARAMETERS.
• [in] value: Parameter value

6.88 AlazarSetParameterUL

6.88.1 Func on Syntax

RETURN_CODE AlazarSetParameterUL(HANDLE handle, U8 channel, U32 parameter,


U32 value)
Set a device parameter as an unsigned long value.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] channel: The channel to control. See ALAZAR_CHANNELS for a list of
possible values. This parameter only takes unsigned 8-bit values.
• [in] parameter: The Parameter to modify. This can be one of
ALAZAR_PARAMETERS_UL.
• [in] value: Parameter value. See ALAZAR_PARAMETERS_UL for details
about valid values

6.88.2 LabVIEW Block Diagram

6.89 AlazarSetRecordCount

6.89.1 Func on Syntax

RETURN_CODE AlazarSetRecordCount(HANDLE handle, U32 Count)


Select the number of records to capture to on-board memory.

174 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark The maximum number of records per capture is a function of the board type,
the maximum number of samples per channel (SPC), and the current number of
samples per record (SPR) :
• ATS850, ATS310, ATS330 : min(SPC / (SPR + 16), 10000)
• ATS460, ATS660, ATS9462 : min(SPC / (SPR + 16), 256000)
• ATS860, ATS9325, ATS935X : min(SPC / (SPR + 32), 256000)
• ATS9850, ATS9870 : min(SPC / (SPR + 64), 256000)
Note This function is part of the single-port API, and cannot be used in a dual-port
context.
Parameters
• [in] handle: Board handle
• [in] Count: The number of records to acquire to on-board memory during
the acquisition.

6.89.2 LabVIEW Block Diagram

6.90 AlazarSetRecordSize

6.90.1 Func on Syntax

RETURN_CODE AlazarSetRecordSize(HANDLE handle, U32 preTriggerSamples, U32


postTriggerSamples)
Set the number of pre-trigger and post-trigger samples per record.

Remark The number of pre-trigger samples must not exceed the number of samples
per record minus 64.
Remark The number of samples per record is the sum of the pre- and post-trigger
samples. It must follow requirements specific to each board listed in the board-
specific documentation.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle

©2008-2021 Alazar Technologies Inc. 175


ATS-SDK Documenta on, Release 7.5.0

• [in] preTriggerSamples: Number of samples before the trigger position in


each record.
• [in] postTriggerSamples: Number of samples after the trigger position in each
record.

6.90.2 LabVIEW Block Diagram

6.91 AlazarSetTriggerDelay

6.91.1 Func on Syntax

RETURN_CODE AlazarSetTriggerDelay(HANDLE handle, U32 Delay)


Set the time, in sample clocks, to wait after receiving a trigger event before capturing
a record for the trigger.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] Delay: Trigger delay in sample clocks. Must be a value between 0 and
9 999 999. It must also be a multiple of a certain value that varies from one
board to another. See board-specific information to know which multiplier
must be respected.

6.91.2 LabVIEW Block Diagram

176 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.92 AlazarSetTriggerOpera on

6.92.1 Func on Syntax

RETURN_CODE AlazarSetTriggerOperation(HANDLE handle, U32 TriggerOperation,


U32 TriggerEngine1, U32 Source1, U32
Slope1, U32 Level1, U32 TriggerEngine2,
U32 Source2, U32 Slope2, U32 Level2)
Configures the trigger system.

Remark The trigger level is specified as an unsigned 8-bit code that represents a frac-
tion of the full scale input voltage of the trigger source: 0 represents the negative
limit, 128 represents the 0 level, and 255 represents the positive limit. For ex-
ample, if the trigger source is CH A, and the CH A input range is ± 800 mV, then
0 represents a –800 mV trigger level, 128 represents a 0 V trigger level, and 255
represents +800 mV trigger level.
Remark If the trigger source is external, the full scale input voltage for the external
trigger connector is dictated by the AlazarSetExternalTrigger() function.
Remark All PCI Express boards except ATS9462 support only one external trig-
ger level. If both Source1 and Source2 are set to TRIG_EXTERNAL of
ALAZAR_TRIGGER_SOURCES, Level1 is ignored and only Level2 is used. All other
boards support using different values for the two levels.
Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] TriggerOperation: Specify how the two independent trigger engines gen-
erate a trigger. This can be one of ALAZAR_TRIGGER_OPERATIONS
• [in] TriggerEngine1: First trigger engine to configure. Can be one of
ALAZAR_TRIGGER_ENGINES.
• [in] Source1: Signal source for the first trigger engine. Can be one of
ALAZAR_TRIGGER_SOURCES.
• [in] Slope1: Sign Direction of the trigger voltage slope that will generate a
trigger event for the first engine. Can be one of ALAZAR_TRIGGER_SLOPES.
• [in] Level1: Select the voltage level that the trigger signal must cross to gen-
erate a trigger event.
• [in] TriggerEngine2: Second trigger engine to configure. Can be one of
ALAZAR_TRIGGER_ENGINES.
• [in] Source2: Signal source for the second trigger engine. Can be one of
ALAZAR_TRIGGER_SOURCES.

©2008-2021 Alazar Technologies Inc. 177


ATS-SDK Documenta on, Release 7.5.0

• [in] Slope2: Sign Direction of the trigger voltage slope that will
generate a trigger event for the second engine. Can be one of
ALAZAR_TRIGGER_SLOPES.
• [in] Level2: Select the voltage level that the trigger signal must cross to gen-
erate a trigger event.

6.92.2 LabVIEW Block Diagram

6.92.3 Related Enumera ons

enum ALAZAR_TRIGGER_OPERATIONS
Trigger operation identifiers.
Values:
TRIG_ENGINE_OP_J = 0x00000000UL
The board triggers when a trigger event is detected by trigger engine J. Events
detected by engine K are ignored.
TRIG_ENGINE_OP_K = 0x00000001UL
The board triggers when a trigger event is detected by trigger engine K. Events
detected by engine J are ignored.
TRIG_ENGINE_OP_J_OR_K = 0x00000002UL
The board triggers when a trigger event is detected by any of the J and K trigger
engines.
TRIG_ENGINE_OP_J_AND_K = 0x00000003UL
This value is deprecated. It cannot be used.
TRIG_ENGINE_OP_J_XOR_K = 0x00000004UL
This value is deprecated. It cannot be used.
TRIG_ENGINE_OP_J_AND_NOT_K = 0x00000005UL
This value is deprecated. It cannot be used.
TRIG_ENGINE_OP_NOT_J_AND_K = 0x00000006UL
This value is deprecated. It cannot be used.

178 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

enum ALAZAR_TRIGGER_ENGINES
Trigger engine identifiers.
Values:
TRIG_ENGINE_J = 0x00000000UL
The J trigger engine.
TRIG_ENGINE_K = 0x00000001UL
The K trigger engine.
enum ALAZAR_TRIGGER_SOURCES
Trigger sources.
Values:
TRIG_CHAN_A = 0x00000000UL
Channel A.
TRIG_CHAN_B = 0x00000001UL
Channel B.
TRIG_EXTERNAL = 0x00000002UL
External trigger source.
TRIG_DISABLE = 0x00000003UL
Disabled trigger.
TRIG_CHAN_C = 0x00000004UL
Channel C.
TRIG_CHAN_D = 0x00000005UL
Channel D.
TRIG_CHAN_E = 0x00000006UL
Channel E.
TRIG_CHAN_F = 0x00000007UL
Channel F.
TRIG_CHAN_G = 0x00000008UL
Channel G.
TRIG_CHAN_H = 0x00000009UL
Channel H.
TRIG_CHAN_I = 0x0000000AUL
Channel I.
TRIG_CHAN_J = 0x0000000BUL
Channel J.
TRIG_CHAN_K = 0x0000000CUL
Channel K.
TRIG_CHAN_L = 0x0000000DUL
Channel L.

©2008-2021 Alazar Technologies Inc. 179


ATS-SDK Documenta on, Release 7.5.0

TRIG_CHAN_M = 0x0000000EUL
Channel M.
TRIG_CHAN_N = 0x0000000FUL
Channel N.
TRIG_CHAN_O = 0x00000010UL
Channel O.
TRIG_CHAN_P = 0x00000011UL
Channel P.
enum ALAZAR_TRIGGER_SLOPES
Trigger slope identifiers.
These identifiers select whether rising or falling edges of the trigger source signal are
detected as trigger events.
Values:
TRIGGER_SLOPE_POSITIVE = 0x00000001UL
The trigger engine detects a trigger event when sample values from the trigger
source rise above a specified level.
TRIGGER_SLOPE_NEGATIVE = 0x00000002UL
The trigger engine detects a trigger event when sample values from the trigger
source fall below a specified level.

6.93 AlazarSetTriggerOpera onForScanning

6.93.1 Func on Syntax

RETURN_CODE AlazarSetTriggerOperationForScanning(HANDLE handle, U32 slopeId,


U32 level, U32 options)
Configure the trigger engines of a board to use an external trigger input and, option-
ally, synchronize the start of an acquisition with the next external trigger event after
AlazarStartCapture() is called.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark AlazarSetTriggerOperationForScanning() is intended for scanning applica-
tions that supply both external clock and external trigger signals to the digitizer,
where the external clock is not suitable to drive the digitizer in between trigger
events.
Remark This function configures a board to use trigger operation
TRIG_ENGINE_OP_J, and the source of TRIG_ENGINE_J to be TRIG_EXTERNAL.
The application must call AlazarSetExternalTrigger() to set the full-scale external
input range and coupling of the external trigger signal connected to the TRIG IN

180 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

connector. An application should call AlazarSetTriggerOperationForScanning()


or AlazarSetTriggerOperation(), but not both.
Remark The trigger level is specified as an unsigned 8-bit code that represents a frac-
tion of the full scale input voltage of the external trigger range: 0 represents the
negative limit, 128 represents the 0 level, and 255 represents the positive limit.
Remark AlazarSetTriggerOperationForScanning() in currently only supported on
ATS9462 with FPGA 35.0 or later.
Parameters
• [in] handle: Board handle
• [in] slopeId: Select the direction of the rate of change of the external trigger
signal when it crosses the trigger voltage level that is required to generate a
trigger event. Must be an element of ALAZAR_TRIGGER_SLOPES.
• [in] level: Specify a trigger level code representing the trigger level in volts
that an external trigger signal connected must pass through to generate a trig-
ger event. See the Remarks section below.
• [in] options: The options parameter may be one of ALAZAR_STOS_OPTIONS

6.93.2 Related Enumera ons

enum ALAZAR_STOS_OPTIONS
Options for AlazarSetExternalTriggerOperationForScanning()
Values:
STOS_OPTION_DEFER_START_CAPTURE = 1

6.94 AlazarSetTriggerTimeOut

6.94.1 Func on Syntax

RETURN_CODE AlazarSetTriggerTimeOut(HANDLE handle, U32 timeout_ticks)


Set the time to wait for a trigger event before automatically generating a trigger event.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Parameters
• [in] handle: Board handle
• [in] timeout_ticks: The trigger timeout value in ticks. Tick are 10μs for all
boards, except for ATS9416 where they are 5µs. Pass 0 to make the board wait
forever for a trigger event.

©2008-2021 Alazar Technologies Inc. 181


ATS-SDK Documenta on, Release 7.5.0

6.94.2 LabVIEW Block Diagram

6.95 AlazarSleepDevice

6.95.1 Func on Syntax

RETURN_CODE AlazarSleepDevice(HANDLE handle, U32 sleepState)


Control power to ADC devices.

Parameters
• [in] handle: Handle to board
• [in] sleepState: Specifies the power state of the ADC converters. This
paramter can be one of ALAZAR_POWER_STATES.

6.95.2 Related Enumera ons

enum ALAZAR_POWER_STATES
Power states.
Values:
POWER_OFF = 0x00000000UL
OFF.
POWER_ON = 0x00000001UL
ON.

6.96 AlazarStartCapture

6.96.1 Func on Syntax

RETURN_CODE AlazarStartCapture(HANDLE handle)


Arm a board to start an acquisition.

Return ApiSuccess upon success, or an error code. See RETURN_CODE for more de-
tailed information.
Remark Only call on the master board in a master-slave system.

182 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

6.96.2 LabVIEW Block Diagram

6.97 AlazarTriggered

6.97.1 Func on Syntax

U32 AlazarTriggered(HANDLE handle)


Determine if a board has triggered during the current acquisition.

Return If the board has received at least one trigger event since the last call to
AlazarStartCapture(), this function returns 1. Otherwise, it returns 0.
Note This function is part of the single-port data acquisition API. It cannot be used
with the dual-port AutoDMA APIs.
Parameters
• [in] handle: Board handle

6.97.2 LabVIEW Block Diagram

6.98 AlazarWaitAsyncBufferComplete

6.98.1 Func on Syntax

RETURN_CODE AlazarWaitAsyncBufferComplete(HANDLE handle, void *buffer, U32


timeout_ms)
This function returns when a board has received sufficient triggers to fill the specified
buffer, or when the timeout internal elapses.
Each call to AlazarPostAsyncBuffer() adds a buffer to the end of a list of buffers to be
filled by the board. AlazarWaitAsyncBufferComplete() expects to wait on the buffer at
the head of this list. As a result, you must wait for buffers in the same order than they
were posted.
Return If the board receives sufficient trigger events to fill this buffer before the time-
out interval elapses, the function returns ApiSuccess.

©2008-2021 Alazar Technologies Inc. 183


ATS-SDK Documenta on, Release 7.5.0

Return If the timeout interval elapses before the board receives sufficient trigger
events to fill the buffer, the function returns ApiWaitTimeout.
Return If the board overflows its on-board memory, the function returns ApiBuffer-
Overflow. This happens if the rate at which data is acquired is faster than the rate
at which data is being transferred from on-board memory to host memory across
the host bus interface.
Return If this buffer was not found in the list of buffers available to be filled by the
board, the function returns ApiBufferNotReady.
Return If this buffer is not the buffer at the head of the list of buffers to be filled by
the board, this returns ApiDmaInProgress.
Return If the function fails for some other reason, it returns an error code that indi-
cates the reason that it failed. See RETURN_CODE for more information.
Remark You must call AlazarBeforeAsyncRead() and AlazarPostAsyncBuffer() before
calling AlazarWaitAsyncBufferComplete().
Warning You must call AlazarAbortAsyncRead() before your application exits if your
have called AlazarPostAsyncBuffer() and buffers are pending.
Parameters
• [in] handle: Handle to board
• [out] buffer: Pointer to a buffer to receive sample data form the digitizer
board
• [in] timeout_ms: The time to wait for the buffer to be filled, in milliseconds.
When AlazarWaitAsyncBufferComplete() returns ApiSuccess, the buffer is removed
from the list of buffers to be filled by the board.
The arrangement of sample data in each buffer depends on the AutoDMA mode spec-
ified in the call to AlazarBeforeAsyncRead().

6.99 AlazarWaitNextAsyncBufferComplete

6.99.1 Func on Syntax

RETURN_CODE AlazarWaitNextAsyncBufferComplete(HANDLE handle, void *buffer, U32


bytesToCopy, U32 timeout_ms)
This function returns when the board has received sufficient trigger events to fill the
buffer, or the timeout interval has elapsed.
To use this function, AlazarBeforeAsyncRead() must be called with
ADMA_ALLOC_BUFFERS.
You must call AlazarBeforeAsyncRead() with the ADMA_GET_PROCESSED_DATA flag
before calling AlazarWaitNextAsyncBufferComplete().

184 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Return If the board receives sufficient trigger events to fill the next available buffer
before the timeout interval elapses, and the buffer is not the last buffer in the
acquisition, the function returns ApiSuccess.
Return If the board receives sufficient trigger events to fill the next available buffer
before the timeout interval elapses, and the buffer is the last buffer in the acqui-
sition, the function returns ApiTransferComplete.
Return If the timeout interval elapses before the board receives sufficient trigger
events to fill the next available buffer, the function returns ApiWaitTimeout.
Return If the board overflows its on-board memory, the function returns ApiBuffer-
Overflow. The board may overflow its on-board memory because the rate at
which it is acquiring data is faster than the rate at which the data is being trans-
ferred from on-board memory to host memory across the host bus interface (PCI
or PCIe). If this is the case, try reducing the sample rate, number of enabled chan-
nels, or amount of time spent processing each buffer.
Return If the function fails for some other reason, it returns an error code that indi-
cates the reason that it failed.
Parameters
• [in] handle: Handle to board
• [out] buffer: Pointer to a buffer to receive sample data from the digitizer
board.
• [in] bytesToCopy: The number of bytes to copy into the buffer
• [in] timeout_ms: The time to wait for the buffer to buffer to be filled, in mil-
liseconds.
To discard buffers, set the bytesToCopy parameter to zero. This will cause AlazarWait-
NextAsyncBufferComplete() to wait for a buffer to complete, but not copy any data into
the application buffer.
To enable disk streaming using high-performance disk I/O functions, call AlazarCre-
ateStreamFile() before calling AlazarWaitNextAsyncBufferComplete(). For best perfor-
mance, set the bytesToCopy parameter to zero so that data is streamed to disk without
making any intermediate copies in memory.
AlazarBeforeAsyncRead() can be called with the ADMA_GET_PROCESSED_DATA flag.
In this case, AlazarWaitNextAsyncBuferComplete() will process buffers so that the
data layout is always not interleaved (i.e. R1A, R2A, … RnA, R1B, R2B, … RnB with
RXY record X of channel Y). This may simplify application development, but it comes
at the expense of added processing time for each buffer.

©2008-2021 Alazar Technologies Inc. 185


ATS-SDK Documenta on, Release 7.5.0

6.99.2 LabVIEW Block Diagram

186 ©2008-2021 Alazar Technologies Inc.


CHAPTER

SEVEN

BOARD-SPECIFIC INFORMATION

7.1 Supported impedances and input ranges

ATS310/50Ω, ATS330/50Ω, ATS9120/50Ω, ATS9130/50Ω ±40mV, ±50mV, ±80mV, ±100mV,


±200mV, ±400mV, ±500mV, ±800mV, ±1V, ±2V, ±4V
ATS310/1MΩ, ATS330/1MΩ, ATS9120/1MΩ, ATS9130/1MΩ ±40mV, ±50mV, ±80mV,
±100mV, ±200mV, ±400mV, ±500mV, ±800mV, ±1V, ±2V, ±4V, ±5V, ±8V, ±10V, ±20V
ATS460/50Ω, ATS9146/50Ω ±20mV, ±40mV, ±50mV, ±80mV, ±100mV, ±200mV, ±400mV,
±500mV, ±800mV, ±1V, ±2V, ±4V
ATS460/1MΩ, ATS9146/1MΩ ±20mV, ±40mV, ±50mV, ±80mV, ±100mV, ±200mV, ±400mV,
±500mV, ±800mV, ±1V, ±2V, ±4V, ±5V, ±8V, ±10V
ATS660/50Ω, ATS9462/50Ω ±200mV, ±400mV, ±800mV, ±2V, ±4V
ATS660/1MΩ, ATS9462/1MΩ ±200mV, ±400mV, ±800mV, ±2V, ±4V, ±8V, ±16V
ATS850/50Ω ±40mV, ±50mV, ±80mV, ±100mV, ±200mV, ±400mV, ±500mV, ±800mV, ±1V, ±2V,
±4V
ATS850/1MΩ ±20mV, ±40mV, ±50mV, ±80mV, ±100mV, ±200mV, ±400mV, ±500mV, ±800mV,
±1V, ±2V, ±4V, ±5V, ±8V, ±10V
ATS860/50Ω ±20mV, ±40mV, ±50mV, ±80mV, ±100mV, ±200mV, ±400mV, ±500mV, ±800mV,
±1V, ±2V, ±4V
ATS860/1MΩ ±20mV, ±40mV, ±50mV, ±80mV, ±100mV, ±200mV, ±400mV, ±500mV, ±800mV,
±1V, ±2V, ±4V, ±5V, ±8V, ±10V
ATS9325/50Ω, ATS9350/50Ω, ATS9850/50Ω, ATS9870/50Ω, ATS9872/50Ω, AXI9870/50Ω, ATS9352/50Ω
±40mV, ±100mV, ±200mV, ±400mV, ±1V, ±2V, ±4V
ATS9352/50Ω ±100mV, ±200mV, ±400mV, ±1V, ±2V, ±4V
ATS9351/50Ω, ATS9353/50Ω, ATS9360/50Ω, ATS9370/50Ω, ATS9371/50Ω, ATS9373/50Ω
±400mV
ATS9625/50Ω, ATS9626/50Ω, ATS9628/50Ω ±1.25V
ATS9440/50Ω ±100mV, ±200mV, ±400mV, ±1V, ±2V, ±4V

187
ATS-SDK Documenta on, Release 7.5.0

ATS9416/50Ω ±1V

7.2 Samples per record requirements

It is required for the value of samples per record to be above or equal to a given minimum
and to be a multiple of a certain value. These two requirements differ from board to board.
The following table lists the limits for all boards.
In addition, the number of pre-trigger samples for each board must be a multiple of a given
value.

Board type Min. record size Pretrig. alignment Resolu on


ATS310, ATS330 256 4 16
ATS460, ATS660 128 16 16
ATS850 256 4 16
ATS860 256 32 32
ATS9350, ATS9351 256 32 32
ATS9120, ATS9130 256 32 32
ATS9146 256 32 32
ATS9360, ATS9370 256 128 128
ATS9371, ATS9373 256 128 128
ATS9416 256 128 128
ATS9440, ATS9462 256 32 32
ATS9625, ATS9626 256 32 32
ATS9870, AXI9870 256 64 64
ATS9352, ATS9353 256 32 32
ATS9872 256 32 32
ATS9628 256 32 32

7.3 Samples per mestamp and trigger delay alignment

Numbers in this table correspond to:


• The ratio between timestamp units and sample clocks in traditional record headers.
• The trigger delay value alignment requirement

188 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

Ac ve Channels
Board 1 ch. 2 ch. 4 ch. 8 ch. 16 ch.
ATS310 2 1
ATS330 2 1
ATS460 2 1
ATS660 2 1
ATS850 2 1
ATS860 4 2 1
ATS9120 8 4
ATS9130 8 4
ATS9146 8 4
ATS9350 8 4
ATS9351 8 4
ATS9360 16 8
ATS9370 16 8
ATS9371 16 8
ATS9373 16 8
ATS9416 16 8 4 2 1
ATS9440 4 2 1
ATS9462 2 1
ATS9625 2 1
ATS9626 2 1
ATS9870 16 8
AXI9870 16 8
ATS9352 8 4
ATS9353 8 4
ATS9872 4 4
ATS9628 4 4

7.4 Aux I/O output Synchroniza on

When used as an output, the AUX I/O works on a clock that is generally slower than the sam-
ple clock. The ratio between the AUX I/O clock and the sample clock depends on the board
and on the number of active channels. For all boards except ATS9360, ATS9371, ATS9373
and ATS9416, the ratio is the same as that specified in Samples per timestamp and trigger
delay alignment. For ATS9360, ATS9371, ATS9373 and ATS9416, the AUX I/O is driven by a
free running clock of a frequency of 260 MHz. Please note that the frequency of this clock
may change from one board to another and from one firmware version to another.

©2008-2021 Alazar Technologies Inc. 189


ATS-SDK Documenta on, Release 7.5.0

7.5 Possible input channel configura ons

Channels per board


Channels 2 4 16
A ✓ ✓ ✓
B ✓ ✓ ✓
A+B ✓ ✓ ✓
C ✓ ✓
A+C ✓
B+C ✓
D ✓ ✓
A+D ✓
B+D ✓
C+D ✓
A +..+ D ✓ ✓
E ✓
F ✓
G ✓
H ✓
A +..+ H ✓
I ✓
J ✓
K ✓
L ✓
M ✓
N ✓
O ✓
P ✓
A +..+ P ✓

7.6 Supported sample rates

ATS310, ATS9120 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s, 5MS/s,
10MS/s, 20MS/s
ATS330, ATS9130 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s, 5MS/s,
10MS/s, 25MS/s, 50MS/s
ATS460, ATS660, ATS9146 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s,
500kS/s, 1MS/s, 2MS/s, 5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 125MS/s
ATS850 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s, 5MS/s, 10MS/s,
25MS/s, 50MS/s
ATS860 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s,
5MS/s, 10MS/s, 25MS/s, 50MS/s, 100MS/s, 125MS/s, 250MS/s

190 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

ATS9350, ATS9351 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s,
1MS/s, 2MS/s, 5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 125MS/s, 250MS/s, 500MS/s
ATS9360 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s,
5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 200MS/s, 500MS/s, 800MS/s, 1000MS/s,
1200MS/s, 1500MS/s, 1800MS/s
ATS9373 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s,
5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 200MS/s, 500MS/s, 800MS/s, 1000MS/s
ATS9373 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s,
5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 200MS/s, 500MS/s, 800MS/s, 1000MS/s,
1200MS/s, 1500MS/s, 2000MS/s, 2400MS/s, 3000MS/s, 3600MS/s, 4000MS/s
ATS9416 1MS/s, 2MS/s, 5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s
ATS9440 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s,
5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 125MS/s
ATS9462 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s, 1MS/s, 2MS/s,
5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 125MS/s, 160MS/s, 180MS/s
ATS9625, ATS9626, ATS9628 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s,
500kS/s, 1MS/s, 2MS/s, 5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 125MS/s, 250MS/s
ATS9870, AXI9870, ATS9872 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s,
500kS/s, 1MS/s, 2MS/s, 5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 250MS/s, 500MS/s,
1000MS/s
ATS9352, ATS9353 1kS/s, 2kS/s, 5kS/s, 10kS/s, 20kS/s, 50kS/s, 100kS/s, 200kS/s, 500kS/s,
1MS/s, 2MS/s, 5MS/s, 10MS/s, 20MS/s, 50MS/s, 100MS/s, 125MS/s, 250MS/s, 500MS/s

7.7 Miscellaneous features support

Bandwidth limit ATS460, ATS660, ATS860, ATS9462


AC input coupling
ATS310, ATS330, ATS460, ATS660, ATS850, ATS860, ATS9146, ATS9350, ATs9440, ATS9462,
ATS9870, AXI9870, ATS9120, ATS9130, ATS9352, ATS9872
DC input coupling All boards except ATS9625
Groung input coupling ATS9352, ATS9146
8-bit data packing ATS9360, ATS9371, ATS9373, ATS9440
12-bit data packing ATS9360, ATS9371, ATS9373
Configure LSB ATS9440, ATS9416

©2008-2021 Alazar Technologies Inc. 191


ATS-SDK Documenta on, Release 7.5.0

7.8 External trigger level support

Board 1V 2.5 V 5V TTL


ATS310 ✓ ✓
ATS330 ✓ ✓
ATS460 ✓ ✓
ATS660 ✓ ✓
ATS850 ✓ ✓
ATS860 ✓ ✓
ATS9350 ✓ ✓
ATS9351 ✓ ✓
ATS9360 ✓ ✓
ATS9371 ✓ ✓
ATS9373 ✓ ✓
ATS9416 ✓
ATS9440 ✓ ✓
ATS9462 ✓ ✓
ATS9625 ✓
ATS9626 ✓
ATS9870 ✓
AXI9870 ✓
ATS9120 ✓ ✓
ATS9130 ✓ ✓
ATS9352 ✓ ✓
ATS9353 ✓ ✓
ATS9146 ✓ ✓
ATS9872 ✓ ✓
ATS9628 ✓

7.9 Supported clock types

INTERNAL_CLOCK
ATS310, ATS330, ATS460, ATS660, ATS850, ATS860, ATS9350, ATS9351, ATS9360,
ATS9371, ATS9373, ATS9416, ATS9440, ATS9462, ATS9625, ATS9626, ATS9870,
AXI9870, ATS9120, ATS9130, ATS9352, ATS9353, ATS9146, ATS9872, ATS9628
FAST_EXTERNAL_CLOCK ATS310, ATS330, ATS460, ATS850, ATS860, ATS9146, ATS9352, ATS9353,
ATS9360, ATS9371, ATS9373, ATS9416, ATS9440
MEDIUM_EXTERNAL_CLOCK ATS460
SLOW_EXTERNAL_CLOCK ATS460, ATS660, ATS860, ATS9350, ATS9351, ATS9440, ATS9462,
ATS9870, AXI9870, ATS9352, ATS9353, ATS9146
EXTERNAL_CLOCK_AC ATS660, ATS9350, ATS9351, ATS9462, ATS9625, ATS9626, ATS9870,

192 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

AXI9870, ATS9628
EXTERNAL_CLOCK_DC ATS660, ATS9462
EXTERNAL_CLOCK_10_MHZ_REF
ATS660, ATS9350, ATS9351, ATS9360, ATS9371, ATS9373, ATS9416, ATS9440,
ATS9462, ATS9625, ATS9626, ATS9870, AXI9870, ATS9352, ATS9353, ATS9146,
ATS9872, ATS9628

7.10 Frequency limits for external clock types

Values are in MHz unles noted otherwise

Fast Medium Slow AC DC


low high low high low high low high low high
ATS310 0 20
ATS330 0 50
ATS460 80 125 10 80 0 10
ATS660 0 10 1k 125 1k 125
ATS850
ATS860 20 250 0 250
ATS9350 0 20 1 500
ATS9351 0 20 1 500
ATS9360 300 1800
ATS9371 300 1000
ATS9373 300 2000
ATS9416 5 100
ATS9440 1 125 0 20
ATS9462 0 10 1 180 1 180
ATS9625 50 250
ATS9626 50 250
ATS9870 0 60 200 1000
AXI9870 0 60 200 1000
ATS9120 1 20
ATS9130 1 50
ATS9352 0 20 1 500
ATS9353 0 20 1 500
ATS9146 10 125 0.001 10 0
ATS9628 50 250

©2008-2021 Alazar Technologies Inc. 193


ATS-SDK Documenta on, Release 7.5.0

7.11 Valid frequencies in PLL mode

ATS660 100-130 MHz in 1 MHZ steps


ATS9350 / ATS9351 500 MHz
ATS9360 300-1800 MHz in 1 MHz steps
ATS9371 300-1000 MHz in 1 MHz steps
ATS9373 in non-DES mode 300-2000 MHz in 1 MHz steps
ATS9373 in DES mode 500-2000 MHz in 1 MHz steps
ATS9416 5-100 MHz in 1 MHz steps
ATS9440 125 MHz or 100 MHz
ATS9462 150-180 MHz in 1 MHz steps
ATS9625 / ATS9626 250 MHz
ATS9870 / AXI9870 1 GHz
ATS9352 500 MHz
ATS9353 500 MHz

194 ©2008-2021 Alazar Technologies Inc.


INDEX

Non-alphabe cal A
_ALAZAR_HEADER (C struct), 89 AC_COUPLING (C enumerator), 155
_ALAZAR_HEADER.hdr0 (C var), 89 ADC_MODE_DEFAULT (C enumerator), 143
_ALAZAR_HEADER.hdr1 (C var), 89 ADC_MODE_DES (C enumerator), 143
_ALAZAR_HEADER.hdr2 (C var), 89 ADMA_ALLOC_BUFFERS (C enumerator), 88
_ALAZAR_HEADER.hdr3 (C var), 89 ADMA_CONTINUOUS_MODE (C enumerator), 87
_HEADER0 (C struct), 89 ADMA_DSP (C enumerator), 89
_HEADER0.BoardNumber (C var), 90 ADMA_ENABLE_RECORD_FOOTERS (C enumerator),
_HEADER0.DataFormat (C var), 90 89
_HEADER0.SampleResolution (C var), 90 ADMA_ENABLE_RECORD_HEADERS (C enumerator),
_HEADER0.SerialNumber (C var), 90 88
_HEADER0.SystemNumber (C var), 90 ADMA_EXTERNAL_STARTCAPTURE (C enumerator),
_HEADER0.WhichChannel (C var), 90 88
_HEADER1 (C struct), 90 ADMA_FIFO_ONLY_STREAMING (C enumerator), 88
_HEADER1.BoardType (C var), 90 ADMA_GET_PROCESSED_DATA (C enumerator), 89
_HEADER1.RecordNumber (C var), 90 ADMA_INTERLEAVE_SAMPLES (C enumerator), 88
_HEADER2 (C struct), 90 ADMA_NPT (C enumerator), 87
_HEADER2.TimeStampLowPart (C var), 90 ADMA_TRADITIONAL_MODE (C enumerator), 87
_HEADER3 (C struct), 90 ADMA_TRIGGERED_STREAMING (C enumerator), 87
_HEADER3.ChannelATriggered (C var), 91 ALAZAR_ADC_MODES (C enum), 143
_HEADER3.ChannelBTriggered (C var), 91 ALAZAR_ADMA_FLAGS (C enum), 88
_HEADER3.ClockEdge (C var), 91 ALAZAR_ADMA_MODES (C enum), 87
_HEADER3.ClockSource (C var), 91 ALAZAR_API_TRACE_STATES (C enum), 141
_HEADER3.ExternalTriggered (C var), 91 ALAZAR_AUX_INPUT_LEVELS (C enum), 141
_HEADER3.InputCoupling (C var), 91 ALAZAR_AUX_IO_MODES (C enum), 95
_HEADER3.InputImpedance (C var), 91 ALAZAR_BOARD_OPTIONS_HIGH (C enum), 162
_HEADER3.InputRange (C var), 91 ALAZAR_BOARD_OPTIONS_LOW (C enum), 162
_HEADER3.SampleRate (C var), 91 ALAZAR_CAPABILITIES (C enum), 160
_HEADER3.ThisChannelTriggered (C var), 91 ALAZAR_CHANNELS (C enum), 151
_HEADER3.TimeOutOccurred (C var), 91 ALAZAR_CLOCK_EDGES (C enum), 170
_HEADER3.TimeStampHighPart (C var), 91 ALAZAR_CLOCK_SOURCES (C enum), 168
_NPTFooter (C struct), 122 ALAZAR_COPROCESSOR_DOWNLOAD_OPTIONS (C
_NPTFooter.aux_in_state (C var), 122 enum), 101
_NPTFooter.frameCount (C var), 122 ALAZAR_COUPLINGS (C enum), 155
_NPTFooter.recordNumber (C var), 122 ALAZAR_CRA_MODES (C enum), 98
_NPTFooter.triggerTimestamp (C var), 122 ALAZAR_CRA_OPTIONS (C enum), 98
ALAZAR_ECC_MODES (C enum), 140

195
ATS-SDK Documenta on, Release 7.5.0

ALAZAR_EXTERNAL_TRIGGER_RANGES (C enum), AlazarDSPGenerateWindowFunction (C func-


172 tion), 105
ALAZAR_IMPEDANCES (C enum), 156 AlazarDSPGetBuffer (C function), 106
ALAZAR_INPUT_RANGES (C enum), 152 AlazarDSPGetInfo (C function), 107
ALAZAR_LED (C enum), 173 AlazarDSPGetModules (C function), 108
ALAZAR_LSB (C enum), 96 AlazarDSPGetNextBuffer (C function), 109
ALAZAR_PACK_MODES (C enum), 141 AlazarDSPGetParameterFloat (C function), 110
ALAZAR_PARAMETERS (C enum), 139 AlazarDSPGetParameterS32 (C function), 111
ALAZAR_PARAMETERS_UL (C enum), 143 AlazarDSPGetParameterU32 (C function), 112
ALAZAR_POWER_STATES (C enum), 182 AlazarDSPSetParameterFloat (C function), 113
ALAZAR_SAMPLE_RATES (C enum), 168 AlazarDSPSetParameterS32 (C function), 114
ALAZAR_SAMPLE_SKIPPING_MODES (C enum), 100 AlazarDSPSetParameterU32 (C function), 114
ALAZAR_STOS_OPTIONS (C enum), 181 AlazarErrorToText (C function), 115
ALAZAR_TIMESTAMP_RESET_OPTIONS (C enum), AlazarExtractFFTNPTFooters (C function), 120
165 AlazarExtractNPTFooters (C function), 121
ALAZAR_TRIGGER_ENGINES (C enum), 178 AlazarExtractTimeDomainNPTFooters (C func-
ALAZAR_TRIGGER_OPERATIONS (C enum), 178 tion), 122
ALAZAR_TRIGGER_SLOPES (C enum), 180 AlazarFFTBackgroundSubtractionGetRecordS16
ALAZAR_TRIGGER_SOURCES (C enum), 179 (C function), 123
AlazarAbortAsyncRead (C function), 81 AlazarFFTBackgroundSubtractionSetEnabled
AlazarAbortCapture (C function), 82 (C function), 123
AlazarAllocBufferU8 (C function), 83 AlazarFFTBackgroundSubtractionSetRecordS16
AlazarAllocBufferU8Ex (C function), 84 (C function), 124
AlazarAllocBufferU16 (C function), 83 AlazarFFTGetMaxTriggerRepeatRate (C func-
AlazarAllocBufferU16Ex (C function), 83 tion), 124
AlazarAsyncRead (C function), 84 AlazarFFTSetScalingAndSlicing (C function),
AlazarBeforeAsyncRead (C function), 85 125
AlazarBoardsFound (C function), 92 AlazarFFTSetup (C function), 127
AlazarBoardsInSystemByHandle (C function), AlazarFFTSetWindowFunction (C function), 126
92 AlazarForceTrigger (C function), 129
AlazarBoardsInSystemBySystemID (C function), AlazarForceTriggerEnable (C function), 130
93 AlazarFreeBufferU8 (C function), 131
AlazarBusy (C function), 93 AlazarFreeBufferU8Ex (C function), 131
AlazarConfigureAuxIO (C function), 94 AlazarFreeBufferU16 (C function), 130
AlazarConfigureLSB (C function), 95 AlazarFreeBufferU16Ex (C function), 130
AlazarConfigureRecordAverage (C function), AlazarGetBoardBySystemHandle (C function),
97 131
AlazarConfigureSampleSkipping (C function), AlazarGetBoardBySystemID (C function), 132
98 AlazarGetBoardKind (C function), 133
AlazarCoprocessorDownloadA (C function), 100 AlazarGetBoardRevision (C function), 135
AlazarCoprocessorDownloadW (C function), 100 AlazarGetChannelInfo (C function), 136
AlazarCoprocessorRegisterRead (C function), AlazarGetChannelInfoEx (C function), 137
101 AlazarGetCPLDVersion (C function), 135
AlazarCoprocessorRegisterWrite (C function), AlazarGetDriverVersion (C function), 137
102 AlazarGetMaxRecordsCapable (C function), 138
AlazarCreateStreamFileA (C function), 103 AlazarGetParameter (C function), 139
AlazarCreateStreamFileW (C function), 103 AlazarGetParameterLL (C function), 141
AlazarDSPAbortCapture (C function), 104 AlazarGetParameterUL (C function), 142

196 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

AlazarGetSDKVersion (C function), 144 API_LOG_CLEAR (C enumerator), 140


AlazarGetStatus (C function), 144 ApiAccessDenied (C enumerator), 115
AlazarGetSystemHandle (C function), 145 ApiAcquisitionModeOnlySupportedInFifoStreaming
AlazarGetTriggerAddress (C function), 146 (C enumerator), 120
AlazarGetTriggerTimestamp (C function), 147 ApiBufferNotReady (C enumerator), 117
AlazarGetWhoTriggeredBySystemHandle (C ApiBufferOverflow (C enumerator), 118
function), 147 ApiBufferTooSmall (C enumerator), 118
AlazarGetWhoTriggeredBySystemID (C func- ApiConfigAccessFailed (C enumerator), 116
tion), 148 ApiDESOnlySupportedInSingleChannelMode (C
AlazarHyperDisp (C function), 149 enumerator), 119
AlazarInputControl (C function), 150 ApiDmaChannelInvalid (C enumerator), 115
AlazarInputControlEx (C function), 156 ApiDmaChannelTypeError (C enumerator), 116
AlazarNumOfSystems (C function), 157 ApiDmaChannelUnavailable (C enumerator),
AlazarOCTIgnoreBadClock (C function), 157 115
AlazarPostAsyncBuffer (C function), 158 ApiDmaCommandInvalid (C enumerator), 116
AlazarQueryCapability (C function), 159 ApiDmaDone (C enumerator), 116
AlazarQueryCapabilityLL (C function), 162 ApiDmaInProgress (C enumerator), 116
AlazarRead (C function), 163 ApiDmaNotPaused (C enumerator), 116
AlazarReadEx (C function), 164 ApiDmaPaused (C enumerator), 116
AlazarResetTimeStamp (C function), 165 ApiDmaPending (C enumerator), 118
AlazarSetADCBackgroundCompensation (C func- ApiDmaSglBuildFailed (C enumerator), 117
tion), 165 ApiDoNothing (C enumerator), 117
AlazarSetBWLimit (C function), 166 ApiDspFiniteRecordsPerAcquisition (C enu-
AlazarSetCaptureClock (C function), 166 merator), 119
AlazarSetExternalClockLevel (C function), ApiError1 (C enumerator), 119
170 ApiError2 (C enumerator), 119
AlazarSetExternalTrigger (C function), 171 ApiFailed (C enumerator), 115
AlazarSetLED (C function), 172 ApiFastBufferLockCountExceeded (C enumera-
AlazarSetParameter (C function), 173 tor), 120
AlazarSetParameterLL (C function), 173 ApiFftSizeTooLarge (C enumerator), 120
AlazarSetParameterUL (C function), 174 ApiFileIoError (C enumerator), 119
AlazarSetRecordCount (C function), 174 ApiGPUError (C enumerator), 120
AlazarSetRecordSize (C function), 175 ApiHSNotSupported (C enumerator), 117
AlazarSetTriggerDelay (C function), 176 ApiInconsistentChannel (C enumerator), 119
AlazarSetTriggerOperation (C function), 177 ApiInsufficientResources (C enumerator),
AlazarSetTriggerOperationForScanning (C 117
function), 180 ApiInterleaveNotSupportedInTraditionalMode
AlazarSetTriggerTimeOut (C function), 181 (C enumerator), 120
AlazarSleepDevice (C function), 182 ApiInvalidAccessType (C enumerator), 116
AlazarStartCapture (C function), 182 ApiInvalidAddress (C enumerator), 116
AlazarTriggered (C function), 183 ApiInvalidBuffer (C enumerator), 118
AlazarWaitAsyncBufferComplete (C function), ApiInvalidClockFrequency (C enumerator),
183 119
AlazarWaitNextAsyncBufferComplete (C func- ApiInvalidData (C enumerator), 117
tion), 184 ApiInvalidDeviceInfo (C enumerator), 116
API_DISABLE_TRACE (C enumerator), 141 ApiInvalidDriverVersion (C enumerator), 118
API_ENABLE_TRACE (C enumerator), 141 ApiInvalidDspModule (C enumerator), 119
API_FLAGS (C enumerator), 140 ApiInvalidHandle (C enumerator), 117

©2008-2021 Alazar Technologies Inc. 197


ATS-SDK Documenta on, Release 7.5.0

ApiInvalidIndex (C enumerator), 116 ATS315 (C enumerator), 133


ApiInvalidInputRange (C enumerator), 120 ATS330 (C enumerator), 133
ApiInvalidIopSpace (C enumerator), 116 ATS335 (C enumerator), 133
ApiInvalidNptFooter (C enumerator), 119 ATS460 (C enumerator), 133
ApiInvalidOffset (C enumerator), 117 ATS660 (C enumerator), 133
ApiInvalidPciSpace (C enumerator), 116 ATS665 (C enumerator), 133
ApiInvalidPowerState (C enumerator), 117 ATS850 (C enumerator), 133
ApiInvalidRecordsPerBuffer (C enumerator), ATS855 (C enumerator), 133
118 ATS860 (C enumerator), 133
ApiInvalidRegister (C enumerator), 116 ATS9000 (C enumerator), 134
ApiInvalidSize (C enumerator), 116 ATS9120 (C enumerator), 134
ApiInvalidSkipTable (C enumerator), 119 ATS9130 (C enumerator), 134
ApiInvalidStateDoRetry (C enumerator), 120 ATS9146 (C enumerator), 134
ApiLockAndProbePagesFailed (C enumerator), ATS9310 (C enumerator), 134
118 ATS9325 (C enumerator), 134
ApiNetworkError (C enumerator), 119 ATS9350 (C enumerator), 134
ApiNoAction (C enumerator), 117 ATS9351 (C enumerator), 134
ApiNoActiveDriver (C enumerator), 116 ATS9352 (C enumerator), 134
ApiNotEnoughNptFooters (C enumerator), 119 ATS9353 (C enumerator), 134
ApiNotInitialized (C enumerator), 117 ATS9358 (C enumerator), 134
ApiNotSupportedInDualChannelMode (C enu- ATS9360 (C enumerator), 134
merator), 118 ATS9370 (C enumerator), 134
ApiNotSupportedInQuadChannelMode (C enu- ATS9371 (C enumerator), 134
merator), 118 ATS9373 (C enumerator), 134
ApiNotSupportThisChannel (C enumerator), ATS9410 (C enumerator), 134
117 ATS9416 (C enumerator), 134
ApiNullParam (C enumerator), 116 ATS9434 (C enumerator), 133
ApiOCTIgnoreBadClockNotSupported (C enu- ATS9437 (C enumerator), 134
merator), 119 ATS9440 (C enumerator), 134
ApiOCTNoTriggerDetected (C enumerator), 119 ATS9453 (C enumerator), 134
ApiOCTTriggerTooFast (C enumerator), 119 ATS9461 (C enumerator), 134
ApiPciTimeout (C enumerator), 117 ATS9462 (C enumerator), 133
ApiPllNotLocked (C enumerator), 118 ATS9470 (C enumerator), 135
ApiPMNotSupported (C enumerator), 118 ATS9618 (C enumerator), 134
ApiPowerDown (C enumerator), 117 ATS9625 (C enumerator), 134
ApiRecordFootersNotSupported (C enumera- ATS9626 (C enumerator), 134
tor), 120 ATS9628 (C enumerator), 135
ApiRecordHeadersNotSupported (C enumera- ATS9637 (C enumerator), 134
tor), 120 ATS9850 (C enumerator), 134
ApiSuccess (C enumerator), 115 ATS9870 (C enumerator), 134
ApiTransferComplete (C enumerator), 118 ATS9872 (C enumerator), 134
ApiUnsupportedFunction (C enumerator), 116 ATS_NONE (C enumerator), 133
ApiVpdNotEnabled (C enumerator), 117 ATST371 (C enumerator), 134
ApiWaitCanceled (C enumerator), 118 ATU7825 (C enumerator), 134
ApiWaitTimeout (C enumerator), 118 AUX_IN_AUXILIARY (C enumerator), 95
ASOPC_TYPE (C enumerator), 160 AUX_IN_TRIGGER_ENABLE (C enumerator), 95
ATG6500 (C enumerator), 134 AUX_INPUT_HIGH (C enumerator), 141
ATS310 (C enumerator), 133 AUX_INPUT_LOW (C enumerator), 141

198 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

AUX_OUT_PACER (C enumerator), 95 CLOCK_EDGE_FALLING (C enumerator), 170


AUX_OUT_SERIAL_DATA (C enumerator), 95 CLOCK_EDGE_RISING (C enumerator), 170
AUX_OUT_TRIGGER (C enumerator), 95 CPF_OPTION_DMA_DOWNLOAD (C enumerator), 101
AXI9870 (C enumerator), 134 CRA_MODE_DISABLE (C enumerator), 98
CRA_MODE_ENABLE_FPGA_AVE (C enumerator), 98
B CRA_OPTION_SIGNED (C enumerator), 98
BOARD_TYPE (C enumerator), 160 CRA_OPTION_UNSIGNED (C enumerator), 98
BoardTypes (C enum), 133
D
C DATA_WIDTH (C enumerator), 139
CAP_IS_VFIFO_BOARD (C enumerator), 161 DC_COUPLING (C enumerator), 156
CAP_MAX_NPT_PRETRIGGER_SAMPLES (C enumera- DSP_FFT_DATAPATH (C enumerator), 113
tor), 161 DSP_FFT_POSTPROC_IMAG_A (C enumerator), 112
CAP_SUPPORT_8_BIT_PACKING (C enumerator), DSP_FFT_POSTPROC_IMAG_B (C enumerator), 111
161 DSP_FFT_POSTPROC_IMAG_C (C enumerator), 111
CAP_SUPPORT_12_BIT_PACKING (C enumerator), DSP_FFT_POSTPROC_REAL_A (C enumerator), 112
161 DSP_FFT_POSTPROC_REAL_B (C enumerator), 110
CAP_SUPPORT_SOFTWARE_CAL (C enumerator), DSP_FFT_POSTPROC_REAL_C (C enumerator), 111
161 DSP_FFT_POSTPROC_SCALE_OUT_MAIN (C enumer-
CAP_SUPPORT_TRADITIONAL_SAMPLES_INTERLEAVED ator), 111
(C enumerator), 161 DSP_FFT_POSTPROC_SCALE_OUT_SEC (C enumera-
CAP_SUPPORTS_API_LOG_CLEAR (C enumerator), tor), 111
161 DSP_FFT_SUBTRACTOR_SUPPORTED (C enumera-
CAP_SUPPORTS_NATIVE_SINGLE_PORT (C enumer- tor), 113
ator), 161 DSP_MODULE_DIS (C enumerator), 108
CAP_SUPPORTS_NPT_AUTODMA (C enumerator), DSP_MODULE_FFT (C enumerator), 108
161 DSP_MODULE_NONE (C enumerator), 108
CAP_SUPPORTS_TRADITIONAL_AUTODMA (C enu- DSP_MODULE_PCD (C enumerator), 108
merator), 161 DSP_MODULE_SSK (C enumerator), 108
CAP_SUPPORTS_TRIGGER_SKIPPING (C enumera- DSP_MODULE_TYPE (C enum), 108
tor), 161 DSP_PARAMETERS_FLOAT (C enum), 110
CHANNEL_A (C enumerator), 151 DSP_PARAMETERS_S32 (C enum), 112
CHANNEL_ALL (C enumerator), 151 DSP_PARAMETERS_U32 (C enum), 113
CHANNEL_B (C enumerator), 151 DSP_RAW_PLUS_FFT_SUPPORTED (C enumerator),
CHANNEL_C (C enumerator), 151 113
CHANNEL_D (C enumerator), 151 DSP_WINDOW_BARTLETT (C enumerator), 106
CHANNEL_E (C enumerator), 151 DSP_WINDOW_BLACKMAN (C enumerator), 106
CHANNEL_F (C enumerator), 151 DSP_WINDOW_BLACKMAN_HARRIS (C enumerator),
CHANNEL_G (C enumerator), 151 106
CHANNEL_H (C enumerator), 151 DSP_WINDOW_HAMMING (C enumerator), 106
CHANNEL_I (C enumerator), 151 DSP_WINDOW_HANNING (C enumerator), 106
CHANNEL_J (C enumerator), 151 DSP_WINDOW_ITEMS (C enum), 106
CHANNEL_K (C enumerator), 151 DSP_WINDOW_NONE (C enumerator), 106
CHANNEL_L (C enumerator), 152
CHANNEL_M (C enumerator), 152 E
CHANNEL_N (C enumerator), 152 ECC_DISABLE (C enumerator), 141
CHANNEL_O (C enumerator), 152 ECC_ENABLE (C enumerator), 141
CHANNEL_P (C enumerator), 152 ECC_MODE (C enumerator), 140

©2008-2021 Alazar Technologies Inc. 199


ATS-SDK Documenta on, Release 7.5.0

ETR_1V_50OHM (C enumerator), 172 GET_BOARD_OPTIONS_HIGH (C enumerator), 160


ETR_2V5_50OHM (C enumerator), 172 GET_BOARD_OPTIONS_LOW (C enumerator), 160
ETR_5V_50OHM (C enumerator), 172 GET_CHANNELS_PER_BOARD (C enumerator), 140
ETR_5V_300OHM (C enumerator), 172 GET_CPF_DEVICE (C enumerator), 161
ETR_TTL (C enumerator), 172 GET_DATA_FORMAT (C enumerator), 140
EXTERNAL_CLOCK (C enumerator), 168 GET_FIRST_CAL_DATE (C enumerator), 160
EXTERNAL_CLOCK_10MHZ_PXI (C enumerator), GET_FPGA_TEMPERATURE (C enumerator), 140
168 GET_LATEST_CAL_DATE (C enumerator), 160
EXTERNAL_CLOCK_10MHZ_REF (C enumerator), GET_LATEST_CAL_DATE_DAY (C enumerator), 160
168 GET_LATEST_CAL_DATE_MONTH (C enumerator),
EXTERNAL_CLOCK_AC (C enumerator), 168 160
EXTERNAL_CLOCK_DC (C enumerator), 168 GET_LATEST_CAL_DATE_YEAR (C enumerator),
160
F GET_LATEST_TEST_DATE (C enumerator), 160
FAST_EXTERNAL_CLOCK (C enumerator), 168 GET_MAX_PRETRIGGER_SAMPLES (C enumerator),
FFT_FOOTER (C enum), 129 160
FFT_FOOTER_NONE (C enumerator), 129 GET_PCIE_LINK_SPEED (C enumerator), 160
FFT_FOOTER_NPT (C enumerator), 129 GET_PCIE_LINK_WIDTH (C enumerator), 160
FFT_OUTPUT_FORMAT (C enum), 128 GET_POWER_MONITOR_STATUS (C enumerator),
FFT_OUTPUT_FORMAT_FLOAT_AMP2 (C enumera- 143
tor), 129 GET_RECORDS_CAPTURED (C enumerator), 140
FFT_OUTPUT_FORMAT_FLOAT_LOG (C enumerator), GET_SAMPLES_PER_TIMESTAMP_CLOCK (C enumer-
129 ator), 140
FFT_OUTPUT_FORMAT_RAW_PLUS_FFT (C enumera- GET_SERIAL_NUMBER (C enumerator), 160
tor), 129 GND_COUPLING (C enumerator), 156
FFT_OUTPUT_FORMAT_S32_IMAG (C enumerator),
129 H
FFT_OUTPUT_FORMAT_S32_REAL (C enumerator), HAS_RECORD_FOOTERS_SUPPORT (C enumerator),
129 161
FFT_OUTPUT_FORMAT_U8_AMP2 (C enumerator), HAS_RECORD_HEADERS_SUPPORT (C enumerator),
128 161
FFT_OUTPUT_FORMAT_U8_LOG (C enumerator),
128 I
FFT_OUTPUT_FORMAT_U16_AMP2 (C enumerator), IMPEDANCE_1M_OHM (C enumerator), 156
128 IMPEDANCE_50_OHM (C enumerator), 156
FFT_OUTPUT_FORMAT_U16_LOG (C enumerator), IMPEDANCE_75_OHM (C enumerator), 156
128 IMPEDANCE_300_OHM (C enumerator), 156
FFT_OUTPUT_FORMAT_U32_AMP2 (C enumerator), INPUT_RANGE_0_TO_1_V (C enumerator), 154
128 INPUT_RANGE_0_TO_2_V (C enumerator), 154
INPUT_RANGE_0_TO_2_V_5 (C enumerator), 154
G INPUT_RANGE_0_TO_4_V (C enumerator), 154
GET_ASYNC_BUFFERS_PENDING (C enumerator), INPUT_RANGE_0_TO_5_V (C enumerator), 154
139 INPUT_RANGE_0_TO_8_V (C enumerator), 154
GET_ASYNC_BUFFERS_PENDING_EMPTY (C enumer- INPUT_RANGE_0_TO_10_V (C enumerator), 154
ator), 140 INPUT_RANGE_0_TO_16_V (C enumerator), 154
GET_ASYNC_BUFFERS_PENDING_FULL (C enumera- INPUT_RANGE_0_TO_20_V (C enumerator), 154
tor), 139 INPUT_RANGE_0_TO_32_V (C enumerator), 154
GET_AUX_INPUT_LEVEL (C enumerator), 140 INPUT_RANGE_0_TO_40_MV (C enumerator), 153

200 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

INPUT_RANGE_0_TO_80_MV (C enumerator), 153 tor), 155


INPUT_RANGE_0_TO_80_V (C enumerator), 154 INPUT_RANGE_0_TO_MINUS_800_MV (C enumera-
INPUT_RANGE_0_TO_100_MV (C enumerator), 153 tor), 155
INPUT_RANGE_0_TO_160_MV (C enumerator), 153 INPUT_RANGE_0_TO_MINUS_1600_MV (C enumera-
INPUT_RANGE_0_TO_200_MV (C enumerator), 153 tor), 155
INPUT_RANGE_0_TO_250_MV (C enumerator), 153 INPUT_RANGE_PM_1_V (C enumerator), 152
INPUT_RANGE_0_TO_400_MV (C enumerator), 153 INPUT_RANGE_PM_1_V_25 (C enumerator), 153
INPUT_RANGE_0_TO_500_MV (C enumerator), 153 INPUT_RANGE_PM_2_V (C enumerator), 152
INPUT_RANGE_0_TO_800_MV (C enumerator), 154 INPUT_RANGE_PM_2_V_5 (C enumerator), 153
INPUT_RANGE_0_TO_1600_MV (C enumerator), INPUT_RANGE_PM_4_V (C enumerator), 152
154 INPUT_RANGE_PM_5_V (C enumerator), 153
INPUT_RANGE_0_TO_MINUS_1_V (C enumerator), INPUT_RANGE_PM_8_V (C enumerator), 153
155 INPUT_RANGE_PM_10_V (C enumerator), 153
INPUT_RANGE_0_TO_MINUS_2_V (C enumerator), INPUT_RANGE_PM_16_V (C enumerator), 153
155 INPUT_RANGE_PM_20_MV (C enumerator), 152
INPUT_RANGE_0_TO_MINUS_2_V_5 (C enumera- INPUT_RANGE_PM_20_V (C enumerator), 153
tor), 155 INPUT_RANGE_PM_40_MV (C enumerator), 152
INPUT_RANGE_0_TO_MINUS_4_V (C enumerator), INPUT_RANGE_PM_40_V (C enumerator), 153
155 INPUT_RANGE_PM_50_MV (C enumerator), 152
INPUT_RANGE_0_TO_MINUS_5_V (C enumerator), INPUT_RANGE_PM_80_MV (C enumerator), 152
155 INPUT_RANGE_PM_100_MV (C enumerator), 152
INPUT_RANGE_0_TO_MINUS_8_V (C enumerator), INPUT_RANGE_PM_125_MV (C enumerator), 153
155 INPUT_RANGE_PM_200_MV (C enumerator), 152
INPUT_RANGE_0_TO_MINUS_10_V (C enumerator), INPUT_RANGE_PM_250_MV (C enumerator), 153
155 INPUT_RANGE_PM_400_MV (C enumerator), 152
INPUT_RANGE_0_TO_MINUS_16_V (C enumerator), INPUT_RANGE_PM_500_MV (C enumerator), 152
155 INPUT_RANGE_PM_800_MV (C enumerator), 152
INPUT_RANGE_0_TO_MINUS_20_V (C enumerator), INPUT_RANGE_UNCALIBRATED (C enumerator),
155 153
INPUT_RANGE_0_TO_MINUS_32_V (C enumerator), INPUT_RANGE_UNCALIBRATED_PM_750_MV (C enu-
155 merator), 155
INPUT_RANGE_0_TO_MINUS_40_MV (C enumera- INTERNAL_CLOCK (C enumerator), 168
tor), 154 INTERNAL_CLOCK_10MHZ_REF (C enumerator),
INPUT_RANGE_0_TO_MINUS_80_MV (C enumera- 168
tor), 154
INPUT_RANGE_0_TO_MINUS_80_V (C enumerator), L
155 LED_OFF (C enumerator), 173
INPUT_RANGE_0_TO_MINUS_100_MV (C enumera- LED_ON (C enumerator), 173
tor), 154 LSB_AUX_IN_1 (C enumerator), 96
INPUT_RANGE_0_TO_MINUS_160_MV (C enumera- LSB_AUX_IN_2 (C enumerator), 96
tor), 154 LSB_DEFAULT (C enumerator), 96
INPUT_RANGE_0_TO_MINUS_200_MV (C enumera- LSB_EXT_TRIG (C enumerator), 96
tor), 154
INPUT_RANGE_0_TO_MINUS_250_MV (C enumera- M
tor), 154 MEDIUM_EXTERNAL_CLOCK (C enumerator), 168
INPUT_RANGE_0_TO_MINUS_400_MV (C enumera- MEMORY_SIZE (C enumerator), 160
tor), 155
INPUT_RANGE_0_TO_MINUS_500_MV (C enumera-

©2008-2021 Alazar Technologies Inc. 201


ATS-SDK Documenta on, Release 7.5.0

O SAMPLE_RATE_25MSPS (C enumerator), 169


OPTION_2GHZ_ADC (C enumerator), 162 SAMPLE_RATE_50KSPS (C enumerator), 169
OPTION_180MHZ_OSCILLATOR (C enumerator), SAMPLE_RATE_50MSPS (C enumerator), 169
162 SAMPLE_RATE_100KSPS (C enumerator), 169
OPTION_ALT_INPUT_RANGES (C enumerator), 162 SAMPLE_RATE_100MSPS (C enumerator), 169
OPTION_DCLK_PHASE (C enumerator), 162 SAMPLE_RATE_125MSPS (C enumerator), 169
OPTION_DUAL_EDGE_SAMPLING (C enumerator), SAMPLE_RATE_160MSPS (C enumerator), 169
162 SAMPLE_RATE_180MSPS (C enumerator), 169
OPTION_DUAL_PORT_MEMORY (C enumerator), 162 SAMPLE_RATE_200KSPS (C enumerator), 169
OPTION_EXTERNAL_CLOCK (C enumerator), 162 SAMPLE_RATE_200MSPS (C enumerator), 169
OPTION_LVTTL_EXT_CLOCK (C enumerator), 162 SAMPLE_RATE_250MSPS (C enumerator), 169
OPTION_MULTI_FREQ_VCO (C enumerator), 162 SAMPLE_RATE_300MSPS (C enumerator), 170
OPTION_OEM_FPGA (C enumerator), 162 SAMPLE_RATE_350MSPS (C enumerator), 170
OPTION_STREAMING_DMA (C enumerator), 162 SAMPLE_RATE_370MSPS (C enumerator), 170
OPTION_SW_SPI (C enumerator), 162 SAMPLE_RATE_400MSPS (C enumerator), 169
OPTION_USER_CALIBRATION (C enumerator), 162 SAMPLE_RATE_500KSPS (C enumerator), 169
OPTION_VARIABLE_RATE_10MHZ_PLL (C enumera- SAMPLE_RATE_500MSPS (C enumerator), 169
tor), 162 SAMPLE_RATE_800MSPS (C enumerator), 169
OPTION_WIDEBAND (C enumerator), 162 SAMPLE_RATE_1000MSPS (C enumerator), 169
SAMPLE_RATE_1200MSPS (C enumerator), 169
P SAMPLE_RATE_1333MSPS_RECUR_DECIMAL (C enu-
PACK_8_BITS_PER_SAMPLE (C enumerator), 141 merator), 170
PACK_12_BITS_PER_SAMPLE (C enumerator), 141 SAMPLE_RATE_1500MSPS (C enumerator), 169
PACK_DEFAULT (C enumerator), 141 SAMPLE_RATE_1600MSPS (C enumerator), 169
PACK_MODE (C enumerator), 140 SAMPLE_RATE_1800MSPS (C enumerator), 169
POWER_OFF (C enumerator), 182 SAMPLE_RATE_2000MSPS (C enumerator), 169
POWER_ON (C enumerator), 182 SAMPLE_RATE_2400MSPS (C enumerator), 169
SAMPLE_RATE_2666MSPS_RECUR_DECIMAL (C enu-
R merator), 170
RETURN_CODE (C enum), 115 SAMPLE_RATE_3000MSPS (C enumerator), 169
SAMPLE_RATE_3600MSPS (C enumerator), 170
S SAMPLE_RATE_4000MSPS (C enumerator), 170
SAMPLE_RATE_1GSPS (C enumerator), 169 SAMPLE_RATE_5000MSPS (C enumerator), 170
SAMPLE_RATE_1KSPS (C enumerator), 168 SAMPLE_RATE_10000MSPS (C enumerator), 170
SAMPLE_RATE_1MSPS (C enumerator), 169 SAMPLE_RATE_USER_DEF (C enumerator), 170
SAMPLE_RATE_2GSPS (C enumerator), 169 SET_ADC_MODE (C enumerator), 143
SAMPLE_RATE_2KSPS (C enumerator), 168 SET_BUFFERS_PER_TRIGGER_ENABLE (C enumera-
SAMPLE_RATE_2MSPS (C enumerator), 169 tor), 143
SAMPLE_RATE_3GSPS (C enumerator), 170 SET_DATA_FORMAT (C enumerator), 140
SAMPLE_RATE_4GSPS (C enumerator), 170 SET_EXT_TRIGGER_RANGE (C enumerator), 143
SAMPLE_RATE_5GSPS (C enumerator), 170 SET_SINGLE_CHANNEL_MODE (C enumerator), 140
SAMPLE_RATE_5KSPS (C enumerator), 168 SET_SOFTWARE_CAL_MECHANISM (C enumerator),
SAMPLE_RATE_5MSPS (C enumerator), 169 140
SAMPLE_RATE_10GSPS (C enumerator), 170 SETGET_ASYNC_BUFFCOUNT (C enumerator), 139
SAMPLE_RATE_10KSPS (C enumerator), 169 SETGET_ASYNC_BUFFSIZE_BYTES (C enumerator),
SAMPLE_RATE_10MSPS (C enumerator), 169 139
SAMPLE_RATE_20KSPS (C enumerator), 169 SETGET_TRIGGER_SKIPPING (C enumerator), 140
SAMPLE_RATE_20MSPS (C enumerator), 169 SLOW_EXTERNAL_CLOCK (C enumerator), 168

202 ©2008-2021 Alazar Technologies Inc.


ATS-SDK Documenta on, Release 7.5.0

SSM_DISABLE (C enumerator), 100


SSM_ENABLE (C enumerator), 100
STOS_OPTION_DEFER_START_CAPTURE (C enumer-
ator), 181

T
TIMESTAMP_RESET_ALWAYS (C enumerator), 165
TIMESTAMP_RESET_FIRSTTIME_ONLY (C enumera-
tor), 165
TRIG_CHAN_A (C enumerator), 179
TRIG_CHAN_B (C enumerator), 179
TRIG_CHAN_C (C enumerator), 179
TRIG_CHAN_D (C enumerator), 179
TRIG_CHAN_E (C enumerator), 179
TRIG_CHAN_F (C enumerator), 179
TRIG_CHAN_G (C enumerator), 179
TRIG_CHAN_H (C enumerator), 179
TRIG_CHAN_I (C enumerator), 179
TRIG_CHAN_J (C enumerator), 179
TRIG_CHAN_K (C enumerator), 179
TRIG_CHAN_L (C enumerator), 179
TRIG_CHAN_M (C enumerator), 179
TRIG_CHAN_N (C enumerator), 180
TRIG_CHAN_O (C enumerator), 180
TRIG_CHAN_P (C enumerator), 180
TRIG_DISABLE (C enumerator), 179
TRIG_ENGINE_J (C enumerator), 179
TRIG_ENGINE_K (C enumerator), 179
TRIG_ENGINE_OP_J (C enumerator), 178
TRIG_ENGINE_OP_J_AND_K (C enumerator), 178
TRIG_ENGINE_OP_J_AND_NOT_K (C enumerator),
178
TRIG_ENGINE_OP_J_OR_K (C enumerator), 178
TRIG_ENGINE_OP_J_XOR_K (C enumerator), 178
TRIG_ENGINE_OP_K (C enumerator), 178
TRIG_ENGINE_OP_NOT_J_AND_K (C enumerator),
178
TRIG_EXTERNAL (C enumerator), 179
TRIGGER_SLOPE_NEGATIVE (C enumerator), 180
TRIGGER_SLOPE_POSITIVE (C enumerator), 180

©2008-2021 Alazar Technologies Inc. 203

You might also like