⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manual_performing_an_ad_scan.html

📁 Diamond公司Dscud通用驱动使用说明手册
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"        "http://www.w3.org/TR/html4/loose.dtd"><html lang="en"><head><title>Performing an AD Scan - Universal Driver Documentation</title><meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"><meta name="robots" content="index,follow"><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" href="/dscud/style/wikiprintable.css"><script type="text/javascript" src="/dscud/style/wikibits.js"></script><style type='text/css'><!--a.new, #quickbar a.new { color: #CC2200; }#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }#article { margin-left: 152px; margin-right: 4px; }//--></style></head><body bgcolor='#FFFFFF'><div class='titlebox'><h1 class='pagetitle'>Performing an AD Scan</h1><span class='subtitle'>Universal Driver Documentation</span></div><div class='navbox'><a href="manual_Main_Page.html" class='printable' title ="Main Page">Main Page</a> || <a href="manual_Table_of_Contents.html" class='printable' title ="Table of Contents">Table_of_Contents</a> || <a href="http://www.diamondsystems.com/">Diamond Systems Website</a></div></div><div class='bodytext'><h3><a name="Description"> Description </a></h3>
<p>
An A/D scan is similar to an A/D sample except that it performs several conversions on a specified range of input channels with each function call. The Universal Driver function for performing an A/D scan is <tt><a href="manual_DscADScan.html" class='printable' title ="DscADScan">dscADScan</a>()</tt>.
<p>
<h3><a name="Step-By-Step_Instructions"> Step-By-Step Instructions </a></h3>
<p>
Create and initialize an A/D settings structure (<a href="manual_DSCADSETTINGS.html" class='printable' title ="DSCADSETTINGS">DSCADSETTINGS</a>).
<p>
Call <tt><a href="manual_DscADSetSettings.html" class='printable' title ="DscADSetSettings">dscADSetSettings</a>()</tt> and pass it a pointer to this structure in order to setup the driver for A/D operations.
<p>
Create and initialize an A/D scan structure (<a href="manual_Struct_DSCADSCAN.html" class='printable' title ="Struct DSCADSCAN">DSCADSCAN</a>).
<p>
Create and initialize a sample buffer of type <tt><a href="manual_DSCSAMPLE.html" class='printable' title ="DSCSAMPLE">DSCSAMPLE</a>*</tt>.
<p>
Call <tt>dscADScan()</tt> and pass it a pointer to your scan structure - this will generate an A/D conversion for each channel in your scan range and the results will be stored in the <tt>sample_values</tt> element of your <tt><a href="manual_Struct_DSCADSCAN.html" class='printable' title ="Struct DSCADSCAN">DSCADSCAN</a></tt> structure.
<p>
<strong>NOTE:</strong> You must always remember to allocate enough memory for your sample buffer (in this case, the <tt>WORD* sample_values</tt>). The driver assumes that your application has allocated at least the amount of memory given in the following formula:
<p>
<pre>        Memory = sizeof(WORD) * ( high_channel - low_channel + 1 )</pre><p><h3><a name="Example_of_Usage_for_A/D_Scan"> Example of Usage for A/D Scan </a></h3>
<p>
<pre>...
DSCB dscb;
DSCADSETTINGS dscadsettings;
DSCADSCAN dscadscan;

/* Step 1 */
dscadsettings.current_channel = 0;
dscadsettings.gain = 0;
dscadsettings.range = 0;
dscadsettings.polarity = 0;
dscadsettings.load_cal = 0;

/* Step 2 */
if ((result = dscADSetSettings(dscb, &dscadsettings)) != DE_NONE)
	return result;

/* Step 3 */
dscadscan.low_channel = 0;
dscadscan.high_channel = 3;

/* Step 4 */
dscadscan.sample_values = (DSCSAMPLE*)malloc(sizeof(DSCSAMPLE) *
(dscadscan.high_channel - dscadscan.low_channel + 1));
memset(dscadscan.sample_values, 0, sizeof(DSCSAMPLE) *
(dscadscan.high_channel - dscadscan.low_channel + 1));

/* Step 5 */
if ((result = dscADScan(dscb, &dscadscan, dscadscan.sample_values)) != DE_NONE)
	return result;
...</pre>
<p></div><p><em> <br> This page was last modified 15:48, 12 Feb 2004.<br>Copyright (c) 2004 Diamond Systems.  All Rights Reserved.</em><!-- Time since request: 0.15 secs. --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -