TPMC500-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. 32 Channel 12 Bit ADC. Version 2.0.x. Issue 2.0.

Similar documents
TPMC821-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. INTERBUS Master G4 PMC. Version 1.4. Issue 1.

TIP700-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. Digital Output 24V DC. Version 2.0.x. Issue June 2008.

TPMC851-SW-42. VxWorks Device Driver. Multifunction I/O (16 bit ADC/DAC, TTL I/O, Counter) Version 2.0.x. User Manual. Issue 2.0.

TIP120-SW-42. VxWorks Device Driver. Motion Controller with Incremental Encoder Interface. Version 2.1.x. User Manual. Issue 2.1.

TPMC868-SW-42. VxWorks Device Driver. 16 Channel Serial PMC. Version 2.1.x. User Manual. Issue December 2011

TPMC550-SW-12 OS-9 for PPC Device Driver 8 (4) Channels Isolated 12-bit D/A

The Embedded I/O Company TIP700-SW-82 Linux Device Driver User Manual TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC

TDRV006-SW-42. VxWorks Device Driver. 64 Digital Inputs/Outputs (Bit I/O) Version 4.0.x. User Manual. Issue December 2017

TPMC901-SW-95. QNX4 - Neutrino Device Driver. User Manual. The Embedded I/O Company. 6/4/2 Channel Extended CAN-Bus PMC

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013

TIP114-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. 10 Channel Absolute Encoder Interface (SSI) Version 1.0.

TPMC815-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. ARCNET Controller. Version 1.0.x. Issue 1.0 May 2004

CARRIER-SW-82. Linux Device Driver. IPAC Carrier Version 2.2.x. User Manual. Issue November 2017

TIP610-SW-95 QNX-Neutrino Device Driver TIP610 16/20 Channel Digital I/O on SBS PCI40 Carrier

CARRIER-SW-42. VxWorks Device Driver. IPAC Carrier. Version 4.2.x. User Manual. Issue July 2018

TPMC860-SW-82. Linux Device Driver. 4 Channel Isolated Serial Interface RS232 Version 1.4.x. User Manual. Issue 1.4.

TIP670-SW-95. QNX-Neutrino Device Driver. User Manual. The Embedded I/O Company. Digital I/O. Version 1.0.x. Issue August 2008.

TCP866-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 8 Channel Serial PMC Version 1.0.x. Issue 1.

TDRV010-SW-95. QNX6 - Neutrino Device Driver. Isolated 2x CAN Bus. Version 1.0.x. User Manual. Issue September 2016

TPMC815 ARCNET PMC. User Manual. The Embedded I/O Company. Version 2.0. Issue 1.2 November 2002 D

TIP866-SW-95. QNX-Neutrino Device Driver. 8 Channel Serial Interface IP. Version 2.1.x. User Manual. Issue October 2009

TPMC Channel Motion Control. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 March 2003 D

TPMC810-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. Isolated 2x CAN Bus Version 1.2.x. Issue 1.2.

TPMC680-SW-82. Linux Device Driver. 64 Digital Input/Output Version 1.1.x. User Manual. Issue April 2010

TIP SERCOS IP with 2 Encoder Interfaces. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 September 2006 D

TPMC310. Conduction Cooled PMC Isolated 2 x CAN Bus. Version 1.1. User Manual. Issue June 2014

TPMC917-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 4 MB SRAM with Battery Backup and 4 Channel Serial Interface Version 1.0.

TIP111. Motion Controller with Absolute Encoder Interface (SSI) User Manual. The Embedded I/O Company. Version 1.1. Issue 1.4 September 2005 D

TIP120. Motion Controller with Incremental Encoder Interface. Version 1.0. User Manual. Issue August 2014

TPMC816. Two Independent Channels Extended CAN Bus PMC Module. Version 2.2. User Manual. Issue August 2014

TPMC Channel Isolated Serial Interface RS232. Version 1.0. User Manual. Issue August 2017

TDRV011-SW-82. Linux Device Driver. Extended CAN Bus Version 1.0.x. User Manual. Issue April 2018

TDRV002-SW-82. Linux Device Driver. Multi-Channel Serial Interface Version 1.8.x. User Manual. Issue November 2017

TIP550. Optically Isolated 8/4 Channel 12-bit D/A. Version 1.2. User Manual. Issue October 2009

TPMC Channel Isolated Serial Interface RS422/RS485. Version 1.0. User Manual. Issue July 2009

TIP815. ARCNET Controller. Version 1.0. User Manual. Issue September 2009

TXMC885. Four Channel 10/100/1000 Mbit/s Ethernet Adapter. Version 1.0. User Manual. Issue October 2011

TPMC x ADC, 16x/0x DAC and 8x Digital I/O. Version 1.0. User Manual. Issue May 2018

TPMC /8 Digital Inputs (24V) 16/8 Digital Outputs (24V, 0.5A) Version 3.0. User Manual. Issue June 2014

TCP Channel Serial Interface RS232 / RS422 cpci Module. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.

TPMC810. Isolated 2x CAN Bus. Version 1.1. User Manual. Issue June 2009

TPMC Digital Inputs/Outputs (Bit I/O) Version 2.0. User Manual. Issue February 2014

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

TPMC500. Optically Isolated 32 Channel 12 Bit ADC. Version 1.1. User Manual. Issue January 2014

ICS-121. VxWORKS DEVICE DRIVER MANUAL

VxWorks Driver Installation

TPCE260. PCI Express PMC Carrier. Version 1.0. User Manual. Issue August 2014

TPMC Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

spwr_base & spwr_chan

TPMC Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

Systems Programming. 08. Standard I/O Library. Alexander Holupirek

RCU. ò Walk through two system calls in some detail. ò Open and read. ò Too much code to cover all FS system calls. ò 3 Cases for a dentry:

VFS, Continued. Don Porter CSE 506

PRODUCT OVERVIEW ISSUE 4

VME Basics. Appendix. Introduction to the VMEbus Accessing boards across the VMEbus VMEbus interrupt handling

TCP Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

Advcan QNX Driver User Manual V1.02

DYNAMIC ENGINEERING. 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, CA Fax Est.

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est

24DSI32 24DSI12 24-bit, 32 Channel Delta-Sigma A/D Boards

DYNAMIC ENGINEERING 150 DuBois Suite C Santa Cruz, CA (831) Fax (831) Est.

VxWorks Device Driver User s Manual

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

The Peripheral Component Interconnect (PCI) Bus and vxworks

TIP Digital Inputs Optically Isolated Version 1.0 Revision A. User Manual. Issue May 1997 D

SYSTEM CALL IMPLEMENTATION. CS124 Operating Systems Fall , Lecture 14

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

Lecture 3. Introduction to Unix Systems Programming: Unix File I/O System Calls

Overview. This Lecture. Interrupts and exceptions Source: ULK ch 4, ELDD ch1, ch2 & ch4. COSC440 Lecture 3: Interrupts 1

tekdxfxsl FibreXtreme I/O Interface

The CCB gpio-104 device-driver

FLICONV-API. Generated by Doxygen

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA Fax Est.

Experiment 6 The Real World Interface

Intel P6 (Bob Colwell s Chip, CMU Alumni) The course that gives CMU its Zip! Memory System Case Studies November 7, 2007.

TPMC / 16 Channels of 16 bit D/A. Version 1.0. User Manual. Issue December 2010

VxWorks Device Driver User s Manual

Page Which had internal designation P5

Small Logger File System

Short Notes of CS201

Intel P The course that gives CMU its Zip! P6/Linux Memory System November 1, P6 memory system. Review of abbreviations

CS201 - Introduction to Programming Glossary By

DRIVER AND LIBRARY FOR DB67 DSP BOARD DRIVER AND LIBRARY FOR DB67 DSP BOARD

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

Operating systems. Lecture 7

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

Writing Custom SCSI Routines

CSC369 Lecture 2. Larry Zhang, September 21, 2015

CHAPI/VAX-Qbus. The CHARON-VAX Application Programming Interface (CHAPI) for Qbus peripheral emulation in Windows

CSE 333 SECTION 3. POSIX I/O Functions

Memory System Case Studies Oct. 13, 2008

11/3/71 SYS MOUNT (II) sys mount; special; name / mount = 21.; not in assembler

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

Pentium/Linux Memory System March 17, 2005

Intel IXP400 Digital Signal Processing (DSP) Software: Priority Setting for 10 ms Real Time Task

Transcription:

The Embedded I/O Company TPMC500-SW-42 VxWorks Device Driver 32 Channel 12 Bit ADC Version 2.0.x User Manual Issue 2.0.0 October 2004 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 e-mail: info@tews.com 25469 Halstenbek / Germany www.tews.com TEWS TECHNOLOGIES LLC 1 E. Liberty Street, Sixth Floor Reno, Nevada 89504 / USA Phone: +1 (775) 686 6077 Fax: +1 (775) 686 6024 e-mail: usasales@tews.com www.tews.com

TPMC500-SW-42 32 Channel 12 Bit ADC VxWorks Device Driver This document contains information, which is proprietary to TEWS TECHNOLOGIES GmbH. Any reproduction without written permission is forbidden. TEWS TECHNOLOGIES GmbH has made any effort to ensure that this manual is accurate and complete. However TEWS TECHNOLOGIES GmbH reserves the right to change the product described in this document at any time without notice. TEWS TECHNOLOGIES GmbH is not liable for any damage arising out of the application or use of the device described herein. 1999-2004 by TEWS TECHNOLOGIES GmbH IndustryPack is a registered trademark of SBS Technologies, Inc Issue Description Date 1.0 First Issue November 1999 1.1 General Revision November 2003 2.0.0 New Device Initialization Parameters, File list modified, Support for Intel x86 added October 29, 2004 TPMC500-SW-42 - VxWorks Device Driver Page 2 of 19

Table of Contents 1 INTRODUCTION 4 2 INSTALLATION. 5 2.1 Hardware dependent Configuration.5 2.2 Including the driver in VxWorks.5 2.3 Special installation for Intel x86 based targets.6 3 I/O SYSTEM FUNCTIONS 7 3.1 tp500drv().7 3.2 tp500devcreate()..8 4 I/O INTERFACE FUNCTIONS. 10 4.1 open() 10 4.2 close()12 4.3 read().13 4.4 ioctl().15 4.4.1 FIOSTARTSEQ Setup and start the sequencer.16 4.4.2 FIOSTOPSEQ Stop the sequencer..16 4.4.3 ioctl() example17 5 APPENDIX. 19 5.1 Predefined Symbols.19 5.2 Error Codes..19 TPMC500-SW-42 - VxWorks Device Driver Page 3 of 19

1 Introduction The TPMC500-SW-42 VxWorks device driver software allows the operation of the TPMC500 32 Channel 12-bit ADC PMC conforming to the VxWorks I/O system specification. This includes a device-independent basic I/O interface with open(), read() and ioctl() functions. The TPMC500 driver includes following functions:! read the actual input value! start and setup the input sequencer! stop the input sequencer TPMC500-SW-42 - VxWorks Device Driver Page 4 of 19

2 Installation Following files are located on the distribution media: tp500drv.c tp500def.h tpmc500.h tp500pci.c tpxxxhwdep.c tpxxxhwdep.h tp500exa.c TPMC500 Device Driver Source TPMC500 Local Include File TPMC500 Application Include File TPMC500 PCI MMU mapping for Intel x86 based targets Collection of hardware dependent functions Include for hardware dependent functions Example Application For installation the files have to be copied to the desired target directory. 2.1 Hardware dependent Configuration The driver is written to be used on TEWS carrier boards and others, but sometimes it is necessary to adapt the software. The following points have to be guaranteed:! full access to the PMC I/O area of the card! full access to PMC memory area of the card (correction data address space)! interrupt must be connected Most systems should work without any changes, but it may be necessary to setup address offsets or an offset between interrupt level and vector. Information for these values should be available in you BSP manual and/or CPU board manual. If such an adaptation is necessary you will get a warning while compilation. The values that have to be modified can be found in tpxxxhwdep.h. There are three values that will be explicitly undefined after installation. To use these values, you have to define them with an appropriate value. USERDEFINED_MEM_OFFSET USERDEFINED_IO_OFFSET USERDEFINED_LEV2VEC This value defines the offset between CPU-bus and PCI-bus address for memory accesses. This value defines the offset between CPU-bus and PCI-bus address for 16-bit I/0 accesses. This value defines the value that should be added to the interrupt level number to get the interrupt vector number. If everything works fine while the values are undefined, and warnings are generated, you can define these values with a value of 0; 2.2 Including the driver in VxWorks How to include the device drive in the VxWorks system is described in the VxWorks and Tornado manuals. TPMC500-SW-42 - VxWorks Device Driver Page 5 of 19

2.3 Special installation for Intel x86 based targets The TPMC500 device driver is fully adapted for Intel x86 based targets. This is done by conditional compilation directives inside the source code and controlled by the VxWorks global defined macro CPU. If the contents of this macro is equal to I80386, I80386 or PENTIUM special Intel x86 conforming code and function calls will be included. The second problem for Intel x86 based platforms can t be solved by conditional compilation directives. Due to the fact that some Intel x86 BSP s doesn t map PCI memory spaces of devices which are not used by the BSP, the required PCI memory spaces can t be accessed. To solve this problem a MMU mapping entry has to be added for the required TPMC500 PCI memory spaces prior the MMU initialization (usrmmuinit()) is done. Please examine the BSP documentation or contact the BSP Vendor whether the BSP perform automatic PCI and MMU configuration or not. If the PCI and MMU initialization is done by the BSP the function tp500pciinit() won t be included and the user can skip to the following steps. The C source file tp461pci.c contains the function tp461pciinit(). This routine finds out all TPMC461 devices and adds MMU mapping entries for all used PCI memory spaces. Please insert a call to this function after the PCI initialization is done and prior to MMU initialization (usrmmuinit()). If the Tornado 2.0/2.2 project facility is used, the right place to call the function tp500pciinit() is at the end of the function syshwinit() in syslib.c (can be opened from the project Files window). Be sure that the function is called prior to MMU initialization otherwise the TPCM500 PCI spaces remains unmapped and an access fault occurs during driver initialization. Please insert the following call at a suitable place in either syslib.c or usrconfig.c: tp500pciinit(); The function tp500pciinit() is designed for and tested on generic Pentium targets. If another BSP is used, please refer to BSP documentation or contact the technical support for required adaptation. If strange errors appeared after system startup with the new build system please carrying out a VxWorks build clean and build all. TPMC500-SW-42 - VxWorks Device Driver Page 6 of 19

3 I/O system functions This chapter describes the driver-level interface to the I/O system. The purpose of these functions is to install the driver in the I/O system, add and initialize devices. 3.1 tp500drv() NAME tp500drv() - installs the TPMC500 driver in the I/O system and initializes the driver. SYNOPSIS STATUS tp500drv(void) DESCRIPTION This function installs the TPMC500 driver in the I/O system, allocates driver resources and initializes them. The call of this function is the first thing the user has to do before adding any device to the system or performing any I/O request. RETURNS OK or ERROR (if the driver cannot be installed) SEE ALSO VxWorks Programmer s Guide: I/O System TPMC500-SW-42 - VxWorks Device Driver Page 7 of 19

3.2 tp500devcreate() NAME tp500devcreate() - adds a TPMC500 device to the system and initializes device hardware. SYNOPSIS STATUS tp500devcreate ( char *name, /* name of the device to create */ int glbmodno, /* TPMC500 module number */ unsigned long type /* device type [TPMC500_nn] */ ) DESCRIPTION This routine is called to add a device to the system that will be serviced by the TPMC500 driver. This function must be called before performing any I/O request to this driver. PARAMETER The name of the device is selected by the string, which is deployed by this routine in the parameter name. The argument glbmodno specifies the index of the TPMC500 that should be set up. For the first found TPMC500 glbmodno must be set to 0, for the second to 1, and so on. The argument type specifies the module type mounted to the address. There are predefined symbols for this argument in tpmc500.h. Allowed values are TPMC500_10, TPMC500_11, TPMC500_12, TPMC500_13, TPMC500_20, TPMC500_21, TPMC500_22 and TPMC500_23. TPMC500-SW-42 - VxWorks Device Driver Page 8 of 19

EXAMPLE #include "tpmc500.h" /*------------------------------------------------------- Create the device "/tpmc500" for the first found TPMC500 The mounted module is a TPMC500-10 -----------------------------------------------------------*/ status = tp500devcreate ("/tpmc500", 1, TPMC500_10); RETURNS OK or ERROR (if the driver is not installed or the device already exists or any other error occurred during the creation) TPMC500-SW-42 - VxWorks Device Driver Page 9 of 19

4 I/O interface functions This chapter describes the interface to the basic I/O system. 4.1 open() NAME open() - opens a device or file. SYNOPSIS int open ( const char *name, /* name of the device to open */ int flags, /* not used for TPMC500 driver, must be 0 */ int mode /* not used for TPMC500 driver, must be 0 */ ) DESCRIPTION Before I/O can be performed to the TPMC500 device, a file descriptor must be opened by invoking the basic I/O function open(). PARAMETER The parameter name selects the device which shall be opened. The parameters flags and mode are not used and must be 0. EXAMPLE /*----------------------------------------------------------- Open the device named "/tpmc500" for I/O -----------------------------------------------------------*/ fd = open("/tpmc500", 0, 0); TPMC500-SW-42 - VxWorks Device Driver Page 10 of 19

RETURNS A device descriptor number or ERROR (if the device does not exist or no device descriptors are available) INCLUDES iolib.h, semlib.h SEE ALSO iolib, basic I/O routine - open() TPMC500-SW-42 - VxWorks Device Driver Page 11 of 19

4.2 close() NAME close() - closes a device or file. SYNOPSIS int close ( int fd, /* descriptor to close */ ) DESCRIPTION This function closes opened devices. EXAMPLE int retval; /*------------------ Close the device ------------------*/ retval = close(fd); RETURNS A device descriptor number or ERROR (if the device does not exist or no device descriptors are available) INCLUDES iolib.h, semlib.h SEE ALSO iolib, basic I/O routine - close() TPMC500-SW-42 - VxWorks Device Driver Page 12 of 19

4.3 read() NAME read() reads a value from the specified TPMC500 device. SYNOPSIS int read ( int fd, /* device descriptor from opened TPMC500 device */ char *buffer, /* pointer to an I/O buffer */ size_t maxbytes /* not used */ ) DESCRIPTION This function starts the conversion for one input channel and returns the value. PARAMETER The parameter fd is a file descriptor specifying the device which shall be used. The parameter buffer points to the special I/O structure TP500_IO_BUFFER (refer to tpmc500.h). The argument maxbytes is not used for the device driver. data structure TP500_IO_BUFFER: typedef struct { int Channel; /* Channel number */ int Gain; /* Gain for channel */ unsigned long flags; /* Special flags */ long value; /* Return value */ } TP500_IO_BUFFER; The argument Channel specifies the channel to use. The argument Gain specifies the gain, which shall be used. The flags specify the mode to use. Allowed values are: TP500_DIFFMODE TP500_SNGLMODE TP500_CORRENA TP500_CORRDIS Enable Differential Mode Enable Single Ended Mode Enable Data Correction Disable Data Correction The read value will be returned in value. TPMC500-SW-42 - VxWorks Device Driver Page 13 of 19

EXAMPLE int int TP500_IO_BUFFER fd; result; buf; /*----------------------------------------------------------- Read the actual value of the input differential channel 1, the gain shall be 2 and the value shall be corrected -----------------------------------------------------------*/ buf.channel = 1; buf.gain = 2; buf.flags = TP500_CORRENA TP500_DIFFMODE; result = read (fd, &buf, 0); RETURNS ERROR if an error occurred INCLUDE FILES iolib.h, semlib.h, tpmc500.h SEE ALSO iolib, basic I/O routine - read() TPMC500-SW-42 - VxWorks Device Driver Page 14 of 19

4.4 ioctl() NAME ioctl() - performs an I/O control function. SYNOPSIS int ioctl ( int fd, /* device descriptor from opened TPMC500 device */ int function, /* function code */ int arg /* optional function dependent argument */ ) DESCRIPTION Special I/O operation that do not fit to the standard basic I/O calls will be performed by calling the ioctl() function with a specific function code and an optional function dependent argument. PARAMETER The parameter fd specifies the device descriptor of the opened TPMC500 device. The parameter function selects the action, which will be executed by the driver. The structure arg depends on the function (see description below). RETURNS OK or ERROR (if the device descriptor does not exist or the function code is unknown or an error occurred) INCULDES iolib.h, semlib.h, tpmc500.h SEE ALSO iolib, basic I/O routine - ioctl(), VxWorks Programmer s Guide: I/O System TPMC500-SW-42 - VxWorks Device Driver Page 15 of 19

4.4.1 FIOSTARTSEQ Setup and start the sequencer This function reads the values of the specified input lines and stores the input values into a user supplied FIFO. For this operation the argument arg points to a structure named TP500_IOC_BUF. This structure is defined in tpmc500.h. Data structure TP500_IOC_BUF: typedef struct { unsigned short cycletime; /* sequencer cycletime */ unsigned long act_channels; /* number of active channels */ TP500_IO_BUFFER *chan_setup; /* channel configurations */ unsigned long buf_size; /* size of buffer */ unsigned long buf_stat; /* buffer state / error */ unsigned long putidx; /* Index to put data */ unsigned long getidx; /* Index to read data */ long *buffer; /* pointer to buffer */ } TP500_IOC_BUF The cycletime argument specifies the length of a cycle. This value is specified in 100µs steps. The argument act_channels specifies the number of active channels. The pointer chan_setup points to an array of data structures specifying the channel setups. The used data structure is the same used by the read command (for more information refer to the read command). The argument buf_size specifies the size of the input FIFO. The actual state and errors will be shown in the buf_stat argument. The following bits are defined. TP500_SEQ_BUF_OVERRUN TP500_SEQ_DATA_OVERFLOW TP500_SEQ_TIMER_ERR TP500_SEQ_INST_RAM_ERR The user supplied FIFO is full and new data can not be stored Old data not read by the software when new values are ready The specified cycle time is not long enough to convert the specified channels The sequencer is started, but no channel has been selected. The arguments putidx and getidx are used to specify the actual read and write pointer into the FIFO. putidx shall be changed by the driver and just be read from the application. getidx must be moved by the application after reading a set of input values and is only read by the driver. The pointer buffer points to the user supplied memory area where the sequencer input data will be stored. 4.4.2 FIOSTOPSEQ Stop the sequencer This command stops a running sequence cycles. This command needs no argument. TPMC500-SW-42 - VxWorks Device Driver Page 16 of 19

4.4.3 ioctl() example #define SBUF_SIZE 0x200 int STATUS TP500_IOC_BUF TP500_IO_BUFFER long fd; result; seq_buf; seq_rw_par[2]; seq_data_buf[sbuf_size]; /*--------------------------------------------------------- Start sequence using channel 1 and 3 Channel 1: differential data correction on gain = 1 Channel 3: single-ended data correction off gain = 5 ---------------------------------------------------------*/ seq_buf.cycletime = 10000; /* Cycletime 1s */ seq_buf.buffer = seq_data_buf; seq_buf.act_channels = 2; seq_buf.buf_size = SBUF_SIZE / seq_buf.act_channels; seq_buf.chan_setup = seq_rw_par; seq_rw_par[0].channel = 1; seq_rw_par[0].gain = 1; seq_rw_par[0].flags = TP500_CORRENA TP500_DIFFMODE; seq_rw_par[1].channel = 3; seq_rw_par[1].gain = 5; seq_rw_par[1].mode = TP500_CORRDIS TP500_SNGLMODE; result = ioctl(fd, FIOSTARTSEQ, (int)&cntrl_par); if (result == OK) { /* Sequencer started */ } else { /* Error when starting the sequencer */ } TPMC500-SW-42 - VxWorks Device Driver Page 17 of 19

/*--------------------------------------------------------- Stop Sequencer ---------------------------------------------------------*/ result = ioctl(fd, FIOSTOPSEQ, 0); if (result == OK) { /* Sequencer started */ } else { /* Error when starting the sequencer */ } TPMC500-SW-42 - VxWorks Device Driver Page 18 of 19

5 Appendix This chapter describes the symbols which are defined in the file tpmc500h. 5.1 Predefined Symbols Ioctl Function Codes FIOSTARTSEQ 0x00000100 Start and setup the sequencer FIOSTOPSEQ 0x00000101 Stop the sequencer Module Types TPMC500_10 10 TPMC500-10 TPMC500_11 11 TPMC500-11 TPMC500_12 12 TPMC500-12 TPMC500_13 13 TPMC500-13 TPMC500_20 20 TPMC500-20 TPMC500_21 21 TPMC500-21 TPMC500_22 22 TPMC500-22 TPMC500_23 23 TPMC500-23 5.2 Error Codes If the device driver creates an error the error codes are stored in the errno. They can be read with the VxWorks function errnoget() or printerrno(). S_tp500Drv_ICHAN 0x05000001 Illegal channel number specified S_tp500Drv_IGAIN 0x05000002 Illegal gain specified S_tp500Drv_MODBUSY 0x05000003 Module is busy (the sequencer is running) S_tp500Drv_TIMEOUT 0x05000004 Hardware timed out S_tp500Drv_ICMD 0x05000005 Illegal I/O command S_tp500Drv_DBLCHAN 0x05000006 Channel is already in use S_tp500Drv_NOMEM 0x05000007 Can t allocate memory S_tp500Drv_NXIO 0x05000008 No module or specified module number not found S_tp500Drv_NODRV 0x05000009 Driver has not been started S_tp500Drv_ILLTYPE 0x0500000A Illegal model type specified TPMC500-SW-42 - VxWorks Device Driver Page 19 of 19