📄 manual.tex~
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) 2001 IAG Software Team,%%%% Beijing R&D Center%%%% Advantech Co., Ltd.%%%% User program for Linux comedi device driver%%%% This is An Unpublished Work Containing Confidential And Proprietary%% Information Which Is The Property Of Advantech Automation Corp.%%%% Any Disclosure, Use, Or Reproduction, Without Written Authorization From%% Advantech Automation Corp., Is Strictly Prohibit.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Document : Manual for pci1784%% Revision: 1.0%% Author : Edwin%% Date : 05/01/03%%%% Description: This manual discribes usage of pci1784 examples and%% utilitys.%%%%-------------------------------------------------------------------------\documentclass{report}\usepackage{graphicx}%Title page style\makeatletter\def\thickhrulefill{\leavevmode \leaders \hrule height 1pt\hfill \kern \z@}\renewcommand{\maketitle}{\begin{titlepage}% \let\footnotesize\small \let\footnoterule\relax \parindent \z@ \reset@font \null \vskip 10\p@ \hbox{\mbox{\hspace{3em}}% \vrule depth 0.6\textheight% \mbox{\hspace{2em}} \vbox{ \vskip 40\p@ \begin{flushleft} \Large \@author \par \end{flushleft} \vskip 80\p@ \begin{flushleft} \huge \bfseries \@title \par \end{flushleft} \vfil }} \end{titlepage}% \setcounter{footnote}{0}%}%Source code listing settings\usepackage{listings}\lstloadlanguages{C, csh, make}\lstset{language=C,tabsize=4, keepspaces=true, breakindent=22pt, numbers=left,stepnumber=1,numberstyle=\tiny, basicstyle=\footnotesize, showspaces=false, flexiblecolumns=true, breaklines=true, breakautoindent=true,breakindent=4em, escapeinside={/*@}{@*/}}% notes format:\newenvironment{notes} {\rule{1ex}{1ex}% \hspace{\stretch{1}}} {\hspace{\stretch{1}}% \rule{1ex}{1ex}}\title{\textbf{Using Advantech PCI-1784 \\ with Linux}}\author{Advantech Co., Ltd. }\begin{document} \maketitle \paragraph{Copyright\newline} This documentation and the software included with this product are copyrighted 2002 by Advantech Co.,ltd.All rights are reserved. Advantech Co.,ltd. reserves the right to make improvements in the product described in this manual at any time without notice. No part of this manual may be reproduced, copied, translated or transmitted in any form or by any means without the prior written permission of Advantech Co.,ltd. Information provided in this manual is intended to be accurate and reliable. However, Advantech Co.,ltd. assumes no responsibility for its use, nor for any infringements of the rights of third parties which can result from its use. \paragraph{Acknowledgments\newline} PC-LabCard is a trademark of Advantech Co.,ltd. \paragraph{CE notification\newline} The PCI-1784, developed by ADVANTECH CO.,LTD., has passed the CE test for environmental specifications when shielded cables are used for external wiring. We recommend the use of shielded cables. This kind of cable is available from Advantech. Please contact your local supplier for ordering information. \paragraph{On-line Technical Support\newline} For technical support and service, please visit our support web site at:\\ http://www.advantech.com/support \tableofcontents \chapter{Introduction} Drivers for Advantech data acquisition boards and motion control cards for Linux are developed on COMEDI (Linux Control \& Measurement Device Interface). This document informs you instructions of using Advantech PCI-1784 with Advantech Linux Driver and utilities. \section{Scope and Features} This document mainly introduces Advantech PCI-1784 cases under Linux platform. These cases are developed in order to provide an example of Linux programming in terms of COMEDILIB interface. Functionally, Advantech PCI-1784 DAS card includes four 32-bit quadruple AB phase encoder counters, multi-range timer and four isolated digital input and digital output channels. Flexible interrupt sources are suitable for wide range of applications. \begin{itemize} \item \textbf{Four 32-bit up/down counters.} \item \textbf{x1, x2, x4 counts for each encoder cycle.} \item \textbf{4-stage digital filter with selectable sampling rate.} \item \textbf{On board 8-bit timer with wide range time-base selector.} \item \textbf{Multiple interrupt sources for precision application.} \item \textbf{Four isolated digital input.} \item \textbf{Four isolated digital output.} \item \textbf{Board ID.} \end{itemize} \newpage \section{Definitions, Acronyms and Abbreviations} Table \ref{t1} shows some acronyms and abbreviations of COMEDI and COMEDILIB. \begin{table}[h] \centering \begin{tabular}{|c|c|} \hline \textbf{Definition} & \textbf{Description} \\ \hline \texttt{COMEDI} & Linux control \& Measurement Device Interface \\ \hline \texttt{AI} & Analog input \\ \hline \texttt{AO} & Analog output \\ \hline \texttt{DI} & Digital input \\ \hline \texttt{DO} & Digital output \\ \hline \texttt{insn} & Instruction mode IO \\ \hline \texttt{cmd} & Command mode IO \\ \hline \end{tabular} \caption{COMEDI Acronyms and Abbreviations list} \label{t1} \end{table} \section{References} \paragraph{For more information, visit COMEDI web site:\\} http://stm.lbl.gov/comedi \paragraph{The IO-Port Programming Mini HOWTO:\\} http://www.linuxdoc.org/HOWTO/mini/IO-Port-Programming.html \paragraph{Linux Kernel Module Programming Guide\\} http://www.linuxdoc.org/LDP/lkmpg/mpg.html \paragraph{Kernel Hacker's Guide\\} http://www.linuxdoc.org/LDP/khg/HyperNews/get/khg.html \paragraph{Linux Device Drivers, 2nd Edition\\} http://www.xml.com/ldd/chapter/book/index.html \paragraph{Linux source\\} \paragraph{\emph{Advantech PCI-1784 Manual}\\} \paragraph{\emph{Advantech Linux Driver User Manual 2.1}\\} \chapter{Environmental setup} \section{COMEDI installation} To use Advantech PCI-1784 with Linux, you must install COMEDI to establish the platform for driver and user cases. Please refer to \emph{Advantech Linux Driver User Manual} for detailed instructions to installation and configuration of COMEDI. Remember to select installing PCI-1784 module. \section{Driver configuration} Linux treat your hardware as a character device file that had been established when COMEDI was installed by \texttt{make dev} command. Next a driver module should be bound to the device file. There are four device files by default installation, which are \texttt{/dev/comedi0 /dev/comedi1 /dev/comedi2 /dev/comedi3}. If multiple cards are installed, these device files could be assigned to different cards according to its PCI bus and slot. Driver installation could follow the commands: \begin{verse} \texttt{\#modprobe pci1784} \end{verse} This step would automatically insert module \texttt{comedi} and module \texttt{pci1784} which is depended on module \texttt{comedi}. \begin{verse} \texttt{\#comedi\_config /dev/comedi0 pci1784} \end{verse} \texttt{comedi\_config} is the comedilib tool to configure the module, and bind it onto specified device file. Note that if multiple cards are installed, each one could be identified by the pci bus and slot number, which could be transferred to \texttt{comedi\_config} as arguments. For example, command \begin{verse} \texttt{\#comedi\_config /dev/comedi1 pci1784 0,3} \end{verse} would configure pci1784 at pci bus 0, slot 3 to device file \texttt{/dev/comedi1}. Therefore all related user cases should treat this device file, which represents the physical card. For more information,please see \texttt{comedi\_config} manual page. \section{COMEDI applications structure} \begin{figure}[h] \centering \includegraphics{structure.eps}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -