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

📄 manual_checking_interrupt_operation_status.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>Checking Interrupt Operation Status - 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'>Checking Interrupt Operation Status</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>
The function <tt><a href="manual_DscGetStatus.html" class='printable' title ="DscGetStatus">dscGetStatus</a>()</tt> is used to indicate the current status of any interrupt operation, including A/D sampling, D/A conversions, digital input, digital output, and user interrupts. It provides several status indicators (see the definition for the data structure <tt><a href="manual_DSCS.html" class='printable' title ="DSCS">DSCS</a></tt> on page 167 for complete details):
<p>
<dl><dt> Operation status </dt><dd> Either <tt>OP_TYPE_NONE</tt> (no operation or operation completed) or any bit-wise combination of  <tt>INT_TYPE_*</tt> (interrupt operations in progress)
</dd></dl><p>
<dl><dt> Number of transfers </dt><dd> In one-shot mode, this is the number of input or output transfers have been completed. This is not necessarily the number of interrupts that have occurred, since if a FIFO is being used each interrupt will account for more than one transfer. <br><br>In recycle mode, this is the current position in the input/output buffer. When the buffer pointer reaches the end of the buffer, it will be reset to 0 and start counting up again. <br><br>Each individual A/D conversion in a scan counts as one transfer.
</dd></dl><p>
<dl><dt> Total transfers </dt><dd> The total number of transfers that have occurred during this operation. In one-shot mode, total transfers is the same as number of transfers.  In recycle mode, this number is not reset and should be used instead of the transfers variable for tracking the total number of conversions taken.
</dd></dl><p>
<dl><dt> Overflow </dt><dd> During A/D sampling operations on boards with a FIFO, this indicates how many times the board's FIFO has overflowed during the current operation. During correct operation this value should always be zero. If this value is non-zero, data has been missed and the sampling rate is too high for the current system configuration.
</dd></dl><p>
The common convention for using this function is to start a particular interrupt function, and then go into a while loop that terminates when a specified condition has occurred, such as when a specified timeout has been reached or when the interrupt operation completes. Completion is indicated by the status indicator <tt>OP_TYPE_NONE</tt>.<p><h3><a name="Step-By-Step_Instructions"> Step-By-Step Instructions </a></h3>
<p>
Create and initialize a driver status structure (<a href="manual_DSCS.html" class='printable' title ="DSCS">DSCS</a>).
Call <tt><a href="manual_DscGetStatus.html" class='printable' title ="DscGetStatus">dscGetStatus</a>()</tt> and pass it a pointer to this structure in order to return the current interrupt operation status. The two important elements to note in the <tt><a href="manual_DSCS.html" class='printable' title ="DSCS">DSCS</a></tt> structure are op_type and transfers. After calling <tt><a href="manual_DscGetStatus.html" class='printable' title ="DscGetStatus">dscGetStatus</a>()</tt>, these elements will contain the interrupt operation status and current number of transfers respectively.
<p>
<h3><a name="Example_of_Usage_for_Checking_Interrupt_Status"> Example of Usage for Checking Interrupt Status </a></h3>
<p>
<pre>
/* run the interrupt operation for 30 seconds, then cancel */
#define TIMEOUT_MS 30000
DSCS dscs;
DWORD time_last, time_now;

/* Start interrupt function - dscADSampleInt() etc. */

dscGetTime(&time_last);
do
{
    dscGetTime(&time_now);
    if (time_now - time_last &gt; TIMEOUT_MS) 
    {
        dscCancelOp(dscb);
        break;
    }
    time_last = time_now;

    dscGetStatus(dscb, &dscs);
} while (dscs.op_type != OP_TYPE_NONE);
</pre>
<p></div><p><em> <br> This page was last modified 22:01, 21 Sep 2004.<br>Copyright (c) 2004 Diamond Systems.  All Rights Reserved.</em><!-- Time since request: 0.16 secs. --></body></html>

⌨️ 快捷键说明

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