Tews Technologies TPMC500-SW-42 Скачать руководство пользователя страница 16

 

 

TPMC500-SW-42 - VxWorks Device Driver  

Page 16 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 

The user supplied FIFO is full and new data 
can not be stored 

TP500_SEQ_DATA_OVERFLOW 

Old data not read by the software when new 
values are ready 

TP500_SEQ_TIMER_ERR 

The specified cycle time is not long enough to 
convert the specified channels 

TP500_SEQ_INST_RAM_ERR 

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

Страница 1: ...2 0 x User Manual Issue 2 0 0 October 2004 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek Germany e mail info tews com www tews com TEWS TECHNOLOGIES LLC 1 E Liberty Street Sixth Floor Reno Neva...

Страница 2: ...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 ap...

Страница 3: ...rks 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: ...eration 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 TPMC50...

Страница 5: ...anges 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 suc...

Страница 6: ...MU 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 routi...

Страница 7: ...00Drv 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 re...

Страница 8: ...0 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 nam...

Страница 9: ...mc500 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 de...

Страница 10: ...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 b...

Страница 11: ...VxWorks Device Driver Page 11 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...

Страница 12: ...lose 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 e...

Страница 13: ...ints 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 in...

Страница 14: ...e 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 ERR...

Страница 15: ...ing 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 f...

Страница 16: ...s 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 T...

Страница 17: ...e 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...

Страница 18: ...TPMC500 SW 42 VxWorks Device Driver Page 18 of 19 Stop Sequencer result ioctl fd FIOSTOPSEQ 0 if result OK Sequencer started else Error when starting the sequencer...

Страница 19: ...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_...

Отзывы: