xpci3xxx  1.00.00
Macros
Sequence mode

Macros

#define CMD_xpci3xxx_InitAnalogInputSequence   _IOR(xpci3xxx_MAGIC, 20,long)
 Initialize an analog input sequence acquisition. More...
 
#define CMD_xpci3xxx_StartAnalogInputSequence   _IOR(xpci3xxx_MAGIC, 21,long)
 Start an analog input sequence acquisition. More...
 
#define CMD_xpci3xxx_StopAnalogInputSequence   _IOR(xpci3xxx_MAGIC, 22,long)
 Stop an analog input sequence acquisition. More...
 
#define CMD_xpci3xxx_ReleaseAnalogInputSequence   _IOR(xpci3xxx_MAGIC, 23,long)
 Release an analog input sequence conversion. More...
 

Detailed Description

Macro Definition Documentation

◆ CMD_xpci3xxx_InitAnalogInputSequence

#define CMD_xpci3xxx_InitAnalogInputSequence   _IOR(xpci3xxx_MAGIC, 20,long)

Initialize an analog input sequence acquisition.

This function prepare the board for an acquisition in sequence mode and allocate the relevant resources. A call to CMD_xpci3xxx_ReleaseAnalogInputSequence is necessary to release theses resources before being able to start another type of acquisition.

Parameters
[in]uint32_targ[((3*Number Of Channels) + 8)] Parameters

arg[0] Number of channel to initialize ( 1 .. ADDIDATA_MAX_AI)

  • arg[1] .. arg[arg[0]] : List of the channels to initialize
  • arg[arg[0]+1] .. arg[2*arg[0]] : Gain factor
    • ADDIDATA_1_GAIN : Gain = 1
    • ADDIDATA_2_GAIN : Gain = 2
    • ADDIDATA_5_GAIN : Gain = 5
    • ADDIDATA_10_GAIN: Gain = 10
  • arg[2*arg[0]+1] .. arg[3*arg[0]] : Polarity array of the channels
    • ADDIDATA_UNIPOLAR: 0V - +10V
    • ADDIDATA_BIPOLAR: -10V - +10V
  • arg[3*arg[0]+1] : Hardware configuration = 0 :Single ended HW config | 1 : Differential HW config
  • arg[3*arg[0]+2] : if DMA not used:
    • 0: continuous mode
    • <>0: single mode if DMA used: define the number of DMA transfer
  • arg[3*arg[0]+3] : DMA control = ADDIDATA_ENABLE | ADDIDATA_DISABLE
  • arg[3*arg[0]+4] : number of sequence to acquire before generating an interrupt
  • arg[3*arg[0]+5] : Delay mode for the analog input = ADDIDATA_DELAY_MODE_1 | ADDIDATA_DELAY_MODE_2
  • arg[3*arg[0]+6] : Delay time unit for the analog input:
    • ADDIDATA_MICRO_SECOND microseconds
    • ADDIDATA_MILLI_SECOND milliseconds
    • ADDIDATA_SECOND seconds
  • arg[3*arg[0]+7] : Delay time value for the analog input conversion
Return values
0Success
1Internal error
2Wrong number of channels
3Wrong channel number
4Wrong gain factor
5Wrong polarity
6Wrong single diff parameter (not 0 or 1)
7Wrong use DMA parameter
8Wrong number of sequence for each interrupt parameter
9Wrong delay mode parameter
10Wrong delay time unit parameter
11Wrong delay time parameter
12A conversion is already started
13DMA mode not supported
14No memory space available
15Error by initialising the DMA
16Requested single/differential mode not supported by the board
17Inconsistent parameters for DMA mode
Note

Constraints on parameter arg[0] (Number of channels)

Let NumberOfAnalogInput be the number of analog inputs (4,8,16) of the board, then NumberOfChannel is correct if

  • 0 < NumberOfChannel <= ADDIDATA_MAX_AI
  • if the board is in differential mode, NumberOfChannel < (NumberOfAnalogInput/2)
  • if the board is in single mode, NumberOfChannel < NumberOfAnalogInput

More on List of Channel

"List of Channel" describes the sequence to follow during acquisition. It must contain indexes of valid channels. Which index is valid depends on the connection mode of the board (single or differential).

The order of the index in this array is the order of the values returned after the acquisition.

Constraints on the List of Channel to initialize

Let NumberOfAnalogInput be the number of analog inputs (4,8,16) of the board, then "List of Channel to initialize" is correct if:

  • if the board is in differencial mode, for each value in "List of Channel", value < (NumberOfAnalogInput/2)
  • if the board is in single mode, for each value in "List of Channel", value < NumberOfAnalogInput

Definition at line 716 of file xpci3xxx.h.

◆ CMD_xpci3xxx_ReleaseAnalogInputSequence

#define CMD_xpci3xxx_ReleaseAnalogInputSequence   _IOR(xpci3xxx_MAGIC, 23,long)

Release an analog input sequence conversion.

This function frees the resources allocated by a CMD_xpci3xxx_InitAnalogInputSequence and must be called before initializing another acquisition.

Parameters
NULL(ignored)
Return values
0Success
1Internal error
2Auto refresh not initialized
3A conversion is already started
4Error by releasing DMA

Definition at line 765 of file xpci3xxx.h.

◆ CMD_xpci3xxx_StartAnalogInputSequence

#define CMD_xpci3xxx_StartAnalogInputSequence   _IOR(xpci3xxx_MAGIC, 21,long)

Start an analog input sequence acquisition.

Parameters
[in]uint16_targ[2] Parameters
  • arg[0] Convert time unit for the analog input:
    • ADDIDATA_NANO_SECOND : nanoseconds
    • ADDIDATA_MICRO_SECOND : microseconds
    • ADDIDATA_MILLI_SECOND : milliseconds
  • arg[1] Convert time value for the analog input conversion
Return values
0Success
1Internal error
2Sequence not initialized
3Wrong convert time unit
4Wrong convert time
5A conversion is already started
6Error by starting DMA
Note
A sequence must have been initialized previously.

Definition at line 738 of file xpci3xxx.h.

◆ CMD_xpci3xxx_StopAnalogInputSequence

#define CMD_xpci3xxx_StopAnalogInputSequence   _IOR(xpci3xxx_MAGIC, 22,long)

Stop an analog input sequence acquisition.

Parameters
NULL(ignored)
Return values
0Success
1Internal error
2Auto refresh not initialized
3Sequence not started
4Error by stoping DMA

Definition at line 750 of file xpci3xxx.h.