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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

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.

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

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.

ICS-121. VxWORKS DEVICE DRIVER MANUAL

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

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

System calls. Reading from a file. Closing a file

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

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

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

Lecture files in /home/hwang/cs375/lecture05 on csserver.

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

POSIX Shared Memory. Linux/UNIX IPC Programming. Outline. Michael Kerrisk, man7.org c 2017 November 2017

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

What Is Operating System? Operating Systems, System Calls, and Buffered I/O. Academic Computers in 1983 and Operating System

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

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

Section 3: File I/O, JSON, Generics. Meghan Cowan

CS 355 Operating Systems. Keeping Track of Processes. When are processes created? Process States 1/26/18. Processes, Unix Processes and System Calls

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

MultiCom/MV 1.0. Comtrol RocketPort Guide. Copyright , Viewpoint Systems, Inc. All Rights Reserved

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C.

CSE 333 SECTION 3. POSIX I/O Functions

spwr_base & spwr_chan

Assignment 4 cpe 453 Fall 2018

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

Advcan QNX Driver User Manual V1.02

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

PRODUCT OVERVIEW ISSUE 4

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

CS 33. Files Part 2. CS33 Intro to Computer Systems XXI 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

T4-Input/Output Management

MaRTE OS Misc utilities

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

UNIX System Calls. Sys Calls versus Library Func

ECE 650 Systems Programming & Engineering. Spring 2018

ECEN 449 Microprocessor System Design. Review of C Programming. Texas A&M University

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

Standards / Extensions C or C++ Dependencies POSIX.1 XPG4 XPG4.2 Single UNIX Specification, Version 3

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

Operating Systems CS 217. Provides each process with a virtual machine. Promises each program the illusion of having whole machine to itself

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

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

Operating systems. Lecture 7

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

Project 1 System Calls

Gaisler LEON3 RTEMS driver documentation

CSE 333 SECTION 3. POSIX I/O Functions

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

CS 3013 Operating Systems WPI, A Term Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007

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

System Calls & Signals. CS449 Spring 2016

CSC 271 Software I: Utilities and Internals

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

ECEN 449 Microprocessor System Design. Review of C Programming

CS240: Programming in C. Lecture 14: Errors

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

Operating Systems II Systems Programming in C

9/19/18. COS 318: Operating Systems. Overview. Important Times. Hardware of A Typical Computer. Today CPU. I/O bus. Network

Amsterdam Compiler Kit-ANSI C compiler compliance statements

MultiCom. for LabVIEW for Windows. Windows 95/98/NT Edition. Copyright , Viewpoint Software Solutions, Inc. All Rights Reserved

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT

Goals of this Lecture

Outline. Overview. Linux-specific, since kernel 2.6.0

Lab 09 - Virtual Memory

Pebbles Kernel Specification September 26, 2004

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

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

I/O Management! Goals of this Lecture!

I/O Management! Goals of this Lecture!

Simpact STREAMS ICP2432 Programmer s Guide for Windows NT DC B

CS240: Programming in C

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

Programs. Function main. C Refresher. CSCI 4061 Introduction to Operating Systems

Objectives. External declarations Pointers Dynamic data structures using pointers Function pointers

Transcription:

The Embedded I/O Company TIP114-SW-72 LynxOS Device Driver 10 Channel Absolute Encoder Interface (SSI) Version 1.0.0 User Manual Issue 1.0 February 2004 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek / Germany Phone: +49-(0)4101-4058-0 Fax: +49-(0)4101-4058-19 e-mail: info@tews.com 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

TIP114-SW-72 10 Channel Absolute Encoder Interface (SSI) LynxOS 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. This product has been designed to operate with IndustryPack compatible carriers. Connection to incompatible hardware is likely to cause serious damage. TEWS TECHNOLOGIES GmbH is not liable for any damage arising out of the application or use of the device described herein. 2004 by TEWS TECHNOLOGIES GmbH Issue Description Date 1.0 First Issue February 23, 2004 TIP114-SW-72 - LynxOS Device Driver Page 2 of 19

Table of Contents 1 INTRODUCTION... 4 2 INSTALLATION... 5 2.1 Device Driver Installation...6 2.1.1 Static Installation...6 2.1.1.1 Build the driver object...6 2.1.1.2 Create Device Information Declaration...6 2.1.1.3 Modify the Device and Driver Configuration File...6 2.1.1.4 Rebuild the Kernel...7 2.1.2 Dynamic Installation...8 2.1.2.1 Build the driver object...8 2.1.2.2 Create Device Information Declaration...8 2.1.2.3 Uninstall dynamic loaded driver...8 2.1.3 Configuration File: CONFIG.TBL...9 3 TIP114 DEVICE DRIVER PROGRAMMING... 10 3.1 open()...10 3.2 close()...11 3.3 read()...12 3.4 ioctl()...14 3.4.1 T114_SET_CHAN_CONF...15 3.4.2 T114_GET_CHAN_CONF...17 4 DEBUGGING AND DIAGNOSTIC... 19 TIP114-SW-72 - LynxOS Device Driver Page 3 of 19

1 Introduction The TIP114-SW-72 LynxOS device driver allows the operation of a TIP114 IPAC module on LynxOS operating systems. Because the TIP114 device driver is stacked on the TEWS TECHNOLOGIES IPAC carrier driver, it s necessary to install also the IPAC carrier driver. Please refer to the IPAC carrier driver user manual for further information. The standard file (I/O) functions (open, close, read, write and ioctl) provide the basic interface for opening and closing a file descriptor and for performing device I/O and control operations. The TIP114 device driver includes the following functions:! TEWS TECHNOLOGIES IPAC carrier driver support. To understand all features of this device driver, it is very important to read the controller manual, which is part of the engineering kit TIP114-EK. TIP114-SW-72 - LynxOS Device Driver Page 4 of 19

2 Installation The software is delivered on a PC formatted 3½" HD diskette. The directory A:\TIP114-SW-72 contains the following files: TIP114-SW-72.pdf TIP114-SW-72.tar This manual in PDF format Device Driver and Example sources The TAR archive TIP114-SW-72.tar contains the following files and directories: tip114/tip114.c tip114/tip114.h tip114/tip114def.h tip114/tip114_info.c tip114/tip114_info.h tip114/tip114.cfg tip114/tip114.import tip114/makefile tip114/example/example.c tip114/example/makefile Driver source code Definitions and data structures for driver and application Definitions and data structures for the driver Device information definition Device information definition header Driver configuration file include Linker imports file for PowerPC platforms Device driver make file Example application source Example make file In order to perform a driver installation first extract the TAR file to a temporary directory then copy the following files to their target directories: 1. Create a new directory in the system drivers directory path /sys/drivers.xxx, where xxx represents the BSP that supports the target hardware. For example: /sys/drivers.pp_drm/tip114 or /sys/drivers.cpci_x86/tip114 2. Copy the following files to this directory: - tip114.c - tip114def.h - tip114.import - Makefile 3. Copy tip114.h to /usr/include/ 4. Copy tip114_info.c to /sys/devices.xxx/ or /sys/devices if /sys/devices.xxx does not exist (xxx represents the BSP). 5. Copy tip114_info.h to /sys/dheaders/ 6. Copy tip114.cfg to /sys/cfg.xxx/, where xxx represents the BSP for the target platform For example: /sys/cfg.ppc or /sys/cfg.x86... Before building a new device driver, the TEWS TECHNOLOGIES IPAC carrier driver must be installed properly, because this driver includes the header file ipac_carrier.h, which is part of the IPAC carrier driver distribution. Please refer to the IPAC carrier driver user manual in the directory path A:\CARRIER-SW-72 on the separate distribution diskette. TIP114-SW-72 - LynxOS Device Driver Page 5 of 19

2.1 Device Driver Installation The two methods of driver installation are as follows: Static Installation Dynamic Installation (only native LynxOS systems) Both installation methods require the TEWS TECHNOLOGIES IPAC Carrier Driver. Please refer to the IPAC Carrier Driver User Manual for detailed information. 2.1.1 Static Installation With this method, the driver object code is linked with the kernel routines and is installed during system start-up. 2.1.1.1 Build the driver object 1. Change to the directory /sys/drivers.xxx/tip114, where xxx represents the BSP that supports the target hardware. 2. To update the library /sys/lib/libdrivers.a enter: make install 2.1.1.2 Create Device Information Declaration 1. Change to the directory /sys/devices.xxx/ or /sys/devices if /sys/devices.xxx does not exist (xxx represents the BSP). 2. Add the following dependencies to the Makefile DEVICE_FILES_all =... tip114_info.x And at the end of the Makefile tip114_info.o:$(dheaders)/tip114_info.h 3. To update the library /sys/lib/libdevices.a enter: make install 2.1.1.3 Modify the Device and Driver Configuration File In order to insert the driver object code into the kernel image, an appropriate entry in file CONFIG.TBL must be created. 1. Change to the directory /sys/lynx.os/ respective /sys/bsp.xxx, where xxx represents the BSP that supports the target hardware. 2. Create an entry at the end of the file CONFIG.TBL Insert the following entry at the end of this file. Be sure that the necessary TEWS TECHNOLOGIES IPAC carrier driver is included before this entry. I:tip114.cfg TIP114-SW-72 - LynxOS Device Driver Page 6 of 19

2.1.1.4 Rebuild the Kernel 1. Change to the directory /sys/lynx.os/ (/sys/bsp.xxx) 2. Enter the following command to rebuild the kernel: make install 3. Reboot the newly created operating system by the following command (not necessary for KDIs): reboot an The N flag instructs init to run mknod and create all the nodes mentioned in the new nodetab. 4. After reboot you should find the following new devices (depends on the device configuration): /dev/tip114_0, /dev/tip114_1, /dev/tip114_2, TIP114-SW-72 - LynxOS Device Driver Page 7 of 19

2.1.2 Dynamic Installation This method allows you to install the driver after the operating system is booted. The driver object code is attached to the end of the kernel image and the operating system dynamically adds this driver to its internal structures. The driver can also be removed dynamically. 2.1.2.1 Build the driver object 1. Change to the directory /sys/drivers.xxx/tip114, where xxx represents the BSP that supports the target hardware. 2. To make the dynamic link-able driver enter : make 2.1.2.2 Create Device Information Declaration 1. Change to the directory /sys/drivers.xxx/tip114, where xxx represents the BSP that supports the target hardware. 2. To create a device definition file for the major device (this works only on native system) make t114info 3. To install the driver enter: drinstall c tip114.obj If successful, drinstall returns a unique <driver-id> 4. To install the major device enter: devinstall c d <driver-id> t114info The <driver-id> is returned by the drinstall command 5. To create nodes for the devices enter: mknod /dev/tip114_0 c <major_no> 0 mknod /dev/tip114_1 c <major_no> 1 mknod /dev/tip114_2 c <major_no> 2... The <major_no> is returned by the devinstall command. If all steps are successful completed the TIP114 is ready to use. 2.1.2.3 Uninstall dynamic loaded driver To uninstall the TIP114 device enter the following commands: devinstall u c <device-id> drinstall u <driver-id> TIP114-SW-72 - LynxOS Device Driver Page 8 of 19

2.1.3 Configuration File: CONFIG.TBL The device and driver configuration file CONFIG.TBL contains entries for device drivers and its major and minor device declarations. Each time the system is rebuild, the config utility read this file and produces a new set of driver and device configuration tables and a corresponding nodetab. To install the TIP114 driver and devices into the LynxOS system, the configuration include file tip114.cfg must be included in the CONFIG.TBL (see also 2.1.1.3). The file tip114.cfg on the distribution disk contains the driver entry (C:tip114:\...) and a major device entry ( D:TIP114:t114info:: ) with 9 minor device entries ( N: tip114_0:0,..., N: tip114_8:8 ). If the driver should support more than 9 minor devices because more than 3 TIP114 are plugged, additional minor device entries must be added. To create the device node /dev/tip114_9 the line N:tip114_9:9 must be added at the end of the file tip114.cfg. For the next node a minor device entry with 10 must be added and so on. This example shows a driver entry with one major device and three minor devices: # Format: # C:driver-name:open:close:read:write:select:control:install:uninstall # D:device-name:info-block-name:raw-partner-name # N:node-name:minor-dev C:tip114:\ :t114open:t114close:t114read:t114write:\ ::t114ioctl:t114install:t114uninstall D:TIP114:t114info:: N:tip114_0:0 N:tip114_1:1 N:tip114_2:2 N:tip114_3:3 N:tip114_4:4 N:tip114_5:5 N:tip114_6:6 N:tip114_7:7 N:tip114_8:8 The configuration above creates the following node in the /dev directory. /dev/tip114_0... /dev/tip114_8 TIP114-SW-72 - LynxOS Device Driver Page 9 of 19

3 TIP114 Device Driver Programming LynxOS system calls are all available directly to any C program. They are implemented as ordinary function calls to "glue" routines in the system library, which trap to the OS code. Note that many system calls use data structures, which should be obtained in a program from appropriate header files. Necessary header files are listed with the system call synopsis. 3.1 open() NAME open() - open a file SYNOPSIS #include <sys/file.h> #include <sys/types.h> #include <fcntl.h> int open ( char *path, int oflags[, mode_t mode] ) DESCRIPTION Opens a file (TIP114 device) named in path for reading and writing. The value of oflags indicates the intended use of the file. In case of a TIP114 devices oflags must be set to O_RDWR to open the file for both reading and writing. The mode argument is required only when a file is created. Because a TIP114 device already exists this argument is ignored. EXAMPLE int fd fd = open ("/dev/tip114_0", O_RDWR); RETURNS Open returns a file descriptor number if successful or 1 on error. The global variable errno contains the detailed error code. TIP114-SW-72 - LynxOS Device Driver Page 10 of 19

3.2 close() NAME close() close a file SYNOPSIS int close( int fd ) DESCRIPTION This function closes an opened device associated with the valid file descriptor handle fd. EXAMPLE int result; result = close(fd); RETURNS Close returns 0 (OK) if successful, or 1 on error. The global variable errno contains the detailed error code. SEE ALSO LynxOS System Call - close() TIP114-SW-72 - LynxOS Device Driver Page 11 of 19

3.3 read() NAME read() - read from a file SYNOPSIS #include <tip114.h> int read ( int fd, char *buff, int count ) DESCRIPTION The read function reads a single SSI channel of the IP module specified by parameter fd. A pointer to the callers message buffer (T114_IO_BUFFER) and the size of this structure is passed by the parameters buff and count to the device. Before reading, you have to setup the specified channel using ioctl function T114_SET_CHAN_CONF. The T114_IO_BUFFER structure has the following layout: typedef struct { int chan; /* channel number to read (0..9) */ long value; /* returned value */ int timeout; /* timeout for IO request, man pages(tswait) */ } T114_IO_BUFFER; chan value This parameter holds the channel of the specified tip114 module the driver should read from. Valid values are 0 to 9. This parameter contains the channel value after the read call terminates. timeout Specifies the amount of time (in ticks) the caller is willing to wait for execution of read. To wait for ever set timeout to a negative value. Note: This parameter is used two times during read. So the worst case read delay is timeout * 2. EXAMPLE int fd; int result; T114_IO_BUFFER io_buf; io_buf.chan = 3; /* read value from channel 3 */ io_buf.timeout = -1; /* wait for ever */ TIP114-SW-72 - LynxOS Device Driver Page 12 of 19

result = read(fd, (char*)&io_buf, sizeof(io_buf)); if(result!= sizeof(t114_io_buffer)) { /* handle read error */ } else { /* show read value */ printf( Channel %d: %d\n, io_buf.value); } RETURNS When read succeeds, the size of the read buffer is returned. If read fails, -1 (SYSERR) is returned. On error, errno will contain a standard read error code (see also LynxOS System Call read) or one of the following TIP114 specific error codes: ENXIO EMSGSIZE EINVAL EACCESS ETIMEDOUT EAGAIN EINTR EIO Illegal device This error code is returned if the size of the I/O-buffer is too small. Invalid argument. This error code is returned if the specified channel number is out of range This error code is returned if you read the specified channel without setup. The maximum allowed time to finish the read request is exhausted. You ve set a timeout value, but there are no timeouts available. Do it again without a timeout. Interrupted system call (probably by a signal). This error code is returned if a parity error has occurred. SEE ALSO LynxOS System Call - read() TIP114-SW-72 - LynxOS Device Driver Page 13 of 19

3.4 ioctl() NAME ioctl() - I/O device control SYNOPSIS #include <ioctl.h> #include <tip114.h> int ioctl ( int fd, int request, char *arg ) DESCRIPTION ioctl provides a way of sending special commands to a device driver. The call sends the value of request and the pointer arg to the device associated with the descriptor fd. The following ioctl codes are defined in TIP114.h : Value T114_SET_CHAN_CONF T114_GET_CHAN_CONF Meaning Write the configuration of a single channel Read the configuration of a single channel See behind for more detailed information on each control code. RETURNS On success, zero is returned. In the case of an error, a value of 1 is returned. The global variable errno contains the detailed error code. The TIP114 ioctl function returns always standard error codes. SEE ALSO LynxOS System Call ioctl() for detailed description of possible error codes. TIP114-SW-72 - LynxOS Device Driver Page 14 of 19

3.4.1 T114_SET_CHAN_CONF NAME T114_SET_CHAN_CONF Write configuration of a single channel DESCRIPTION This ioctl function configures a specified SSI channel. A pointer to the caller's parameter buffer (T114_CTRL_BUFFER) is passed by the argument pointer arg to the driver. The T114_CTRL_BUFFER structure has the following layout: typedef struct { int chan; /* channel number to read (0..9) */ int clock; /* Clock Rate (0..15) */ int databits; /* Data Bits (0..31) */ int parity; /* T114_NOP T114_ODP T114_EVP */ int zerobit; /* T114_ENABLE T114_DISABLE */ int graycode; /* T114_ENABLE T114_DISABLE */ int timeout; /* timeout for IO request, man pages(tswait) */ } T114_CTRL_BUFFER; chan This parameter holds the channel of the specified tip114 module the driver should setup. Valid values are 0 to 9. clock This parameter defines the clock rate of the specified channel. Valid values are 0 to 15. For more details see hardware manual. databits This parameter defines the data length of the specified channel. Valid values are 0 to 31. For more details see hardware manual. parity This parameter enables or disables parity checking. To disable parity checking set it to T114_NOP, otherwise T114_ODP for odd parity or T114_EVP for even parity. For more details see hardware manual. zerobit This parameter enables or disables parity with zerobit. To enable parity with zerobit set it to T114_ENABLE otherwise set it to T114_DISABLE. For more details see hardware manual. graycode This parameter enables or disables graycoded transmission. To enable it set this parameter to T114_ENABLE otherwise set it to T114_DISABLE. TIP114-SW-72 - LynxOS Device Driver Page 15 of 19

timeout Specifies the amount of time (in ticks) the caller is willing to wait for execution of ioctl. To wait for ever set timeout to a negative value. EXAMPLE int fd; int result; T114_CTRL_BUFFER ctrl_buf; /* ** Example values for HEIDENHAIN ROQ 424 SSI connected to channel 7 of ** an TIP114 module */ ctrl_buf.chan = 7; ctrl_buf.clock = 1; ctrl_buf.databits = 25; ctrl_buf.parity = T114_NOP; ctrl_buf.zerobit = T114_DISABLE; ctrl_buf.graycode = T114_ENABLE; ctrl_buf.timeout = -1; result = ioctl(fd, T114_SET_CHAN_CONF, (char*)&ctrl_buf); if (result < 0) { /* handle ioctl error */ } SEE ALSO TIP114 Hardware manual. TIP114-SW-72 - LynxOS Device Driver Page 16 of 19

3.4.2 T114_GET_CHAN_CONF NAME T114_GET_CHAN_CONF Read configuration of a single channel DESCRIPTION This ioctl function reads the configuration of a specified SSI channel. A pointer to the caller's parameter buffer (T114_CTRL_BUFFER) is passed by the argument pointer arg to the driver. The T114_CTRL_BUFFER structure has the following layout: typedef struct { int chan; /* channel number to read (0..9) */ int clock; /* Clock Rate (0..15) */ int databits; /* Data Bits (0..31) */ int parity; /* T114_NOP T114_ODP T114_EVP */ int zerobit; /* T114_ENABLE T114_DISABLE */ int graycode; /* T114_ENABLE T114_DISABLE */ int timeout; /* timeout for IO request, man pages(tswait) */ } T114_CTRL_BUFFER; chan This parameter holds the channel of the specified tip114 module the driver should read from. Valid values are 0 to 9. clock This parameter receives the clock rate of the specified channel. For more details see hardware manual. databits This parameter receives the data length of the specified channel. For more details see hardware manual. parity This parameter receives one of following parity checking states, T114_NOP for parity disabled, T114_ODP for odd parity or T114_EVP for even parity. For more details see hardware manual. zerobit This parameter receives one of following zerobit on/off-states, T114_ENABLE for parity with zerobit or T114_DISABLE for zerobit disabled. For more details see hardware manual. graycode This parameter receives one of following graycode on/off-state, T114_ENABLE for graycoded transmission or T114_DISABLE for graycode disabled. TIP114-SW-72 - LynxOS Device Driver Page 17 of 19

timeout Specifies the amount of time (in ticks) the caller is willing to wait for execution of read. To wait for ever set timeout to a negative value. Note: This parameter is used two times during read. So the worst case read delay is timeout * 2. EXAMPLE int fd; int result; T114_CTRL_BUFFER ctrl_buf; ctrl_buf.chan = 2; /* read config of ch 2 */ ctrl_buf.timeout = -1; /* wait for ever */ result = ioctl(fd, T114_GET_CHAN_CONF, (char*)&ctrl_buf); if (result < 0) { /* handle ioctl error */ }else { printf( Configuration channel %d\n, ctrl_buf.chan); printf( Clockrate: %d\n, ctrl_buf.clock);... } SEE ALSO TIP114 Hardware manual. TIP114-SW-72 - LynxOS Device Driver Page 18 of 19

4 Debugging and Diagnostic If your installed IPAC port driver (e.g. tip114) doesn t find any devices although the IPAC is properly plugged on a carrier port, it s interesting to know what s going on in the system. Usually all TEWS TECHNOLOGIES device driver announced significant event or errors via the device driver routine kkprintf(). To enable the debug output you must define the macro DEBUG in the device driver source files (e.g. carrier_class.c, carrier_tews_pci.c, tip114.c,...). In tip114.c you should also define the TIP114_DEBUG_VIEW macro. The debug output should appear on the console. If not please check the symbol KKPF_PORT in uparam.h. This symbol should be configured to a valid COM port (e.g. SKDB_COM1). The following output appears at the LynxOS debug console if the carrier and IPAC driver starts: TEWS TECHNOLOGIES - IPAC Carrier Class Driver version 1.0.0 (2004-11-28) TEWS TECHNOLOGIES - VME Carrier version 1.0.0 (2004-12-05) IPAC_CC : IPAC (Manuf-ID=B3, Model#=1C) recognized @ slot=0 carrier=<tews TECHNOLOGIES - VME Carrier> TIP114 10 Channel Absolute Encoder Interface (SSI) version 1.0.0 (2004-11-28) TIP114 : Probe new TIP114 mounted on <TEWS TECHNOLOGIES - VME Carrier> at slot A If you can t solve the problem by yourself, please contact TEWS TECHNOLOGIES with a detailed description of the error condition, your system configuration and the debug outputs. TIP114-SW-72 - LynxOS Device Driver Page 19 of 19