Tews Technologies TPMC551-SW-95 User Manual

Qnx6 - neutrino device driver

Advertisement

Quick Links

The Embedded I/O Company
TPMC551-SW-95
QNX6 - Neutrino Device Driver
8/4 Channel 16 Bit DAC PMC
Version 1.0.x
User Manual
Issue 1.0.0
December 2015
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

Advertisement

Table of Contents
loading

Summary of Contents for Tews Technologies TPMC551-SW-95

  • Page 1 QNX6 - Neutrino Device Driver 8/4 Channel 16 Bit DAC PMC Version 1.0.x User Manual Issue 1.0.0 December 2015 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...
  • Page 2 TPMC551 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. 2015 by TEWS TECHNOLOGIES GmbH...
  • Page 3: Table Of Contents

    DAC Output Functions .........................13 3.2.1 tpmc551DacWrite ......................13 3.2.2 tpmc551DacWriteMulti.......................15 Sequencer Functions........................17 3.3.1 tpmc551SeqSetup ......................17 3.3.2 tpmc551SeqStart .......................20 3.3.3 tpmc551SeqStop .......................22 3.3.4 tpmc551SeqWrite ......................24 3.3.5 tpmc551SeqFlush ......................27 3.3.6 tpmc551SeqStatus......................29 TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 3 of 30...
  • Page 4: Introduction

    1 Introduction The TPMC551-SW-95 QNX-Neutrino device driver allows the operation of the TPMC551 on QNX- Neutrino operating systems. The TPMC551 device driver is basically implemented as a user installable Resource Manager. An Application Programming Interface (API) provides access to the driver functionality, and wraps the standard file (I/O) functions (open, close and devctl).
  • Page 5: Installation

    2 Installation Following files are located in the directory TPMC551-SW-95 on the distribution media: TPMC551-SW-95-SRC.tar.gz GZIP compressed archive with driver source code TPMC551-SW-95-1.0.0.pdf This manual in PDF format ChangeLog.txt Release history Release.txt Information about the Device Driver Release The GZIP compressed archive TPMC551-SW-95-SRC.tar.gz contains the following files and directories: Directory path ‘tpmc551’:...
  • Page 6: Build The Example Application

    /dev/tpmc551_0, /dev/tpmc551_1, ... This pathname must be used in the application program to open a path to the desired TPMC551 channel device. Please refer to the corresponding description within this document. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 6 of 30...
  • Page 7: Api Documentation

    PARAMETERS DeviceName This parameter points to a null-terminated string that specifies the name of the device. The following device naming must be used: Device Number Device Name /dev/tpmc551_0 /dev/tpmc551_1 TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 7 of 30...
  • Page 8 A device handle, or NULL if the function fails. An error code will be stored in errno. ERROR CODES The error codes are stored in errno. The error code is a standard error code set by the I/O system. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 8 of 30...
  • Page 9: Tpmc551Close

    This value specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. EXAMPLE #include <tpmc551api.h> TPMC551_HANDLE hdl; TPMC551_STATUS result; ** close the device result = tpmc551Close(hdl); if (result != TPMC551_OK) /* handle close error */ TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 9 of 30...
  • Page 10 On success, TPMC551_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TPMC551_ERR_INVALID_HANDLE The specified device handle is invalid TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 10 of 30...
  • Page 11: Tpmc551Getmoduleinfo

    This argument is a pointer to an int array where the factory programmed gain correction data are returned. GainCorr[0] contains correction data for DAC channel 1, GainCorr[1] for DAC channel 2 and so forth. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 11 of 30...
  • Page 12 On success, TPMC551_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TPMC551_ERR_INVALID_HANDLE The specified TPMC551_HANDLE is invalid. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 12 of 30...
  • Page 13: Dac Output Functions

    This argument specifies the new 16-bit D/A value. Valid data range depends on the voltage range of specified channel (0…65535 0...10V voltage range -32768…32767 for +/-10V voltage range). TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 13 of 30...
  • Page 14 The specified TPMC551_HANDLE is invalid. TPMC551_ERR_RANGE Invalid channel number TPMC551_ERR_TIMEOUT Timeout during D/A conversion TPMC551_ERR_BUSY This error occurs if the sequencer is still running. Please stop the sequencer before executing this function. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 14 of 30...
  • Page 15: Tpmc551Dacwritemulti

    Array index 0 corresponds to the first DAC channel, array index 1 corresponds to the second DAC channel and so on. Only channels selected for update (ChannelMask) will be modified. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 15 of 30...
  • Page 16 The specified TPMC551_HANDLE is invalid. TPMC551_ERR_RANGE Invalid channel number TPMC551_ERR_TIMEOUT Timeout during D/A conversion TPMC551_ERR_BUSY This error occurs if the sequencer is still running. Please stop the sequencer before executing this function. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 16 of 30...
  • Page 17: Sequencer Functions

    This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. CycleTime This argument specifies the sequencer cycle time in steps of 100 μs. This argument is only relevant if the flag TPMC551_TIMERMODE is set. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 17 of 30...
  • Page 18 Perform an offset and gain correction with factory calibration data stored in the TPMC551 EEPROM for all selected channels. TPMC551_SIMCONV Start conversion of active channels in latched mode and update analog outputs simultaneously. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 18 of 30...
  • Page 19 Invalid channel number or invalid number of channels. TPMC551_ERR_NOMEM Unable to allocate memory for the ring buffer. TPMC551_ERR_BUSY This error occurs if the sequencer is still running. Please stop the sequencer before executing this function. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 19 of 30...
  • Page 20: Tpmc551Seqstart

    This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. EXAMPLE #include <tpmc551api.h> TPMC551_HANDLE hdl; TPMC551_STATUS result; /* start the seuencer */ result = tpmc551SeqStart(hdl); if (result != TPMC551_OK) /* handle error */ TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 20 of 30...
  • Page 21 TPMC551_ERR_NODATA No data is available in the ring buffer to start the sequencer facility. Use the function tpmc551SeqWrite to write at least one data tuple before starting the sequencer. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 21 of 30...
  • Page 22: Tpmc551Seqstop

    This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. EXAMPLE #include <tpmc551api.h> TPMC551_HANDLE hdl; TPMC551_STATUS result; /* stop the sequencer */ result = tpmc551SeqStop(hdl); if (result != TPMC551_OK) /* handle error */ TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 22 of 30...
  • Page 23 On success, TPMC551_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TPMC551_ERR_INVALID_HANDLE The specified TPMC551_HANDLE is invalid. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 23 of 30...
  • Page 24: Tpmc551Seqwrite

    This argument is a pointer to an int variable where the number of written bytes is returned. In case of the error TPMC551_ERR_BUF_FULL this value can be used to adjust the buffer start pointer for subsequent writes. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 24 of 30...
  • Page 25 (result == TPMC551_ERR_BUF_FULL) /* send remaining data later */ /* Write new data for 1 cycle and 4 active channels (4 values) */ result = tpmc551SeqWrite( hdl, sizeof(ForOneCycle), ForOneCycle, &WrittenSize); TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 25 of 30...
  • Page 26 The sequencer buffer is full. Not all data was written to the buffer. Use the contents of WrittenSize to adjust the data pointer to write the remaining data tuples. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 26 of 30...
  • Page 27: Tpmc551Seqflush

    This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open-function. EXAMPLE #include <tpmc551api.h> TPMC551_HANDLE hdl; TPMC551_STATUS result; /* flush the sequencer ring buffer */ result = tpmc551SeqFlush(hdl); if (result != TPMC551_OK) /* handle error */ TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 27 of 30...
  • Page 28 On success, TPMC551_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TPMC551_ERR_INVALID_HANDLE The specified TPMC551_HANDLE is invalid. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 28 of 30...
  • Page 29: Tpmc551Seqstatus

    The sequencer hardware has detected a data underflow condition. The driver was not able to provide new data within a sequencer timer cycle. TPMC551_SEQ_NODATA No data available in the ring buffer for output. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 29 of 30...
  • Page 30 On success, TPMC551_OK is returned. In the case of an error, the appropriate error code is returned by the function. ERROR CODES Error Code Description TPMC551_ERR_INVALID_HANDLE The specified TPMC551_HANDLE is invalid. TPMC551-SW-95 – QNX6 - Neutrino Device Driver Page 30 of 30...

Table of Contents