📄 manual_interrupt-based_da_conversion_scan.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="en"><head><title>Interrupt-Based DA Conversion 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'>Interrupt-Based DA Conversion 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>
Interrupt-based analog output is useful for generating analog output values automatically at a specified rate, such as generating an analog waveform. It differs in operation from a single D/A conversion scan in that it generates output data continuously or for a specified number of samples each time the function is called. There are a number of different options that can be set for interrupt-based operations; these are explained in the interrupt-based operations chapter.
<p>
The Universal Driver function for performing interrupt-based D/A conversion scans is <tt><a href="manual_DscDAConvertScanInt.html" class='printable' title ="DscDAConvertScanInt">dscDAConvertScanInt</a>()</tt>.
<p>
<h3><a name="Step-By-Step_Instructions"> Step-By-Step Instructions </a></h3>
<p>
Create and initialize an analog I/O interrupts structure (<a href="manual_DSCAIOINT.html" class='printable' title ="DSCAIOINT">DSCAIOINT</a>).
<p>
Set the entries of the <tt>sample_values</tt> buffer in the <tt><a href="manual_DSCAIOINT.html" class='printable' title ="DSCAIOINT">DSCAIOINT</a></tt> structure to the desired output codes. You must have <tt>num_conversion</tt> entries of size, <tt>WORD</tt>, in the buffer to ensure proper operation.
<p>
Call <tt><a href="manual_DscDAConvertScanInt.html" class='printable' title ="DscDAConvertScanInt">dscDAConvertScanInt</a>()</tt> and pass it a pointer to the above-mentioned <tt><a href="manual_DSCAIOINT.html" class='printable' title ="DSCAIOINT">DSCAIOINT</a></tt> structure to begin interrupt operation. The interrupt operations will now run in a separate system thread until either they reach the maximum number of conversions specified (one-shot mode only) or they are cancelled by a call to <tt><a href="manual_DscCancelOp.html" class='printable' title ="DscCancelOp">dscCancelOp</a></tt>.
<p>
<h3><a name="Example_of_Usage_for_Interrupt-Based_D/A_Scan"> Example of Usage for Interrupt-Based D/A Scan </a></h3>
<p>
<pre>...
DSCB dscb;
DSCAIOINT dscaioint;
int i;
/* Step 1 */
dscaioint.num_conversions = 1024;
dscaioint.conversion_rate = 10000;
dscaioint.cycle = FALSE;
dscaioint.internal_clock = TRUE;
dscaioint.low_channel = 0;
dscaioint.high_channel = 3;
dscaioint.external_gate_enable = FALSE;
/* Step 2 */
dscaioint.sample_values = (WORD*)malloc(sizeof(WORD) * dscaioint.num_conversions);
for (i = 0; i < dscaioint.num_conversions; i++)
dscaioint.sample_values[i] = (WORD)4095;
/* Step 3 */
if ((result = dscDAConvertScanInt(dscb, &dscaioint)) != DE_NONE)
return result;
...</pre>
<p></div><p><em> <br> This page was last modified 19:43, 30 Jan 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 + -