AX5412.TXT Driver File Contents (AS59099V2_0.zip)

[AX5412 - High Speed Data Acquisition Board]

Function:
   ax5412Init

Description:
   Initialize the device.

   int ax5412Init(int base_addr, int function);
   base_addr: I/O base address of the device.
   function: Function ID.

Remarks:
   This function should be called once before the device performming any data
   I/O functions. The function ID could be either of the constants listing below
   or any combinition of them:
      ID_FUNC_AI
      ID_FUNC_AI_IRQ
      ID_FUNC_AO
      ID_FUNC_DI
      ID_FUNC_DO
      ID_FUNC_EVCNT
      ID_FUNC_FOUT
      ID_FUNC_ALL

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function: ax5412Term

Description:
   Terminate the device driver.

   int ax5412Term(int base_addr);
   base_addr: I/O base address of the device.

Remarks:
   This function should be called once if the device will no longer performming
   any data I/O functions. Usually at the end of you data acquisition/control
   processes.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412GetDevAtbu

Description:
   Retrieve the device attribute.

   int ax5412GetDevAtbu(int base_addr, LPDEVATBU lpDevAtbu);
   base_addr: I/O base address of the device.
   lpDevAtbu: Pointer to the DEVATBU struct, which stores the device attribute.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412DI

Description:
   Digital input function for a specified channel.

   int ax5412DI(int base_addr, int chan, int* data);
   base_addr: I/O base address of the device.
   chan: Channel to perform DI function.
   data: Storage for digital input status.

Remarks:
   This function will retrieve the one and only specified channel for it's
   digital input status. The status value will stored in the third parameter,
   data, where '1' stands for 'HIGH' status, and '0' for 'LOW' one.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412DI_P

Description:
   Digital input function for a specified port(8-bit).

   int ax5412DI_P(int base_addr, int* data);
   base_addr: I/O base address of the device.
   data: Storage for digital input status.

Remarks:
   This function will retrieve all the digital input status of channels in
   the same port at one time.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412DO

Description:
   Digital output function for the specified channel.

   int ax5412DO(int base_addr, int chan, int data);
   base_addr: I/O base address of the device.
   chan: channel to proform digital output function.
   data: Digital output status.0:LOW, 1:HIGH.

Remarks:
   Use this function to output a LOW or HIGH signal to the specified channel.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.



Function:
   ax5412DO_P

Description:
   Digital output function for a specified port(8-bit).

   int ax5412DO_P(int base_addr, int data);
   base_addr: I/O base address of the device.
   data: Digital output status for a port(8-channel).

Remarks:
   Use this function to output signals(LOW/HIGH) at one time for channels in
   the same port.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412AI

Description:
   Analog input function for specified channel.

   int ax5412AI(int base_addr, int chan, int gaincode, float* pfdata);
   base_addr: I/O base address of the device.
   chan: channel to perform analog input function.
   gaincode: Gain code of the device. The high byte of the gaincode determines
      whether high gain or low gain this device is, and the low byte of the
      gaincode determines the gain code used.For example, gaincode 0x0102 stands
      for AX5412 high gain device, since HIBYTE(gaincode)=01, and the gain is
      100(gain code:02), since LOBYTE(gaincode)=02.
   pfdata: Pointer to storage of analog input data.

Remarks:
   This function uses software triggered method to perform an analog input
   function. The gaincode should be set according to the users maunal of the
   device.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412AO

Description:
   Analog output function.

   int ax5412AO(int base_addr,int chan, float fdata);
   base_addr: I/O base address of the device.
   chan: channel to perform analog output function.
   fdata: Analog output value.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412IRQStart

Description:
   Analog input function for specified channel with interrupt.

   int ax5412IRQStart(int base_addr, WORD ScanChan, int GainCode, int IRQNo,
                      int TrigMode, int Div1, Div2);
   base_addr: I/O base address of the device.
   ScanChan: Range of Channels to perform analog input function.
   GainCode: Gain code of the device. The high byte of the gaincode determines
      whether high gain or low gain this device is, and the low byte of the
      gaincode determines the gain code used.For example, gaincode 0x0102 stands
      for AX5412 high gain device, since HIBYTE(gaincode)=01, and the gain is
      100(gain code:02), since LOBYTE(gaincode)=02.
   IRQNo: IRQ number used for generating interrupt.
   TrigMode: Trigger method for analog input function.
   Div1, Div2: Used to set the sampling rate of the device.

Remarks:
   This function should be called before performing analog input function
   via interrupt. Ths ScanChan specify the channels to scan. To scan channel
   0 to 15, the ScanChan will be 0x000f, ie. from higher byte 00 to lower
   byte 0f(15), GainCode should be set according to the users manual of the
   device. IRQNo will also be the set as the on board jumper's setting.
   TrigMode specified the trigger method as internal or external trig. Div1
   and Div2 will be used when internal trigger method was set. And the
   sampling rate for each channel will be 1MHz/(Div1*Div2).

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412IRQGetStatus

Description:
   Check the writting status of the driver buffer.

   int ax5412IRQGetStatus(int IRQNo, int* flag, WORD CheckSize,
                          WORD* Index1, WORD* Index2);
   IRQNo: IRQ number specified in the ax5412IRQStart function.
   flag: Pointer to a flag to determine whether the data was ready to get.
   CheckSize: Specify the block size of data to check from the driver.
   Index1: Pointer to the current writing index of the driver buffer.
   Index2: Pointer to the current reading index of the driver buffer.

Remarks:
   Use this function to check whether the data was ready inside the driver
   buffer. The default buffer size was 4K*2 bytes. Thus the maximun block
   size to check should not exceed 2K. If the flag turns to be SET, flag=1,
   it's ready to get data with

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412IRQGetData

Description:
   Get data from the driver buffer with specified block size.

   int ax5412IRQGetData(int IRQNo, int* buffer, WORD size);
   IRQNo: IRQ number specified in the ax5412IRQStart function.
   buffer: Pointer to a buffer that will then store data from the driver.
   size: Block size of buffer to retrive from the driver.

Remarks:
   After a call to check the driver buffer status, use this function to get
   the data ready in the driver if the status flag is SET. Note that 1 block
   size means 2 byte, the buffer pointer passed should have buffer size with
   2 times the block size. And the data retrived will still be raw data, call
   the raw-to-real convert function to convert the buffer data to real data.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412IRQStop

Description:
   Stops the analog input via interrupt function.

   int ax5412IRQStop(int IRQNo);
   IRQNo: IRQ number specified in the ax5412IRQStart function.

Remarks:
   This function should be called after performing analog input via interrupt
   function.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412DMAStart

Description:
   Analog input function with DMA.

   int ax5412DMAStart(int base_addr, WORD ScanChan, int GainCode, int DMACh,
                       int IRQNo, int TrigMode, int Div1, int Div2, WORD Count,
                       DWORD pBufORSize);
   base_addr: I/O base address of the device.
   ScanChan: Range of Channels to perform analog input function.
   GainCode: Gain code of the device.
   DMACh: DMA channel number.
   IRQNo: IRQ number used for generating interrupt.
   TrigMode: Trigger method for analog input function.
   Div1, Div2: Used to set the sampling rate of the device.
   Count: Number of data to retrieve from I/O device. 
      0 - recycle mode; 1~32767 - single cycle mode.
   pBufORSize: When Count=0(recycle mode), pBufORSize indicates the buffer size
      allocated by AXDDR; When Count=1~32767(single cycle mode), pBufORSize
      indicates the pointer of the buffer allocated by the user.

Remarks:
   This function should be called before performing analog input function via 
   DMA. The ScanChan specify the channels to scan. To scan channel 0 to 15, the 
   ScanChan will be 0x000f, ie. from higher byte 00 to lower byte 0f, GainCode 
   should be set according to the users manual of the device. DMACh and IRQNo 
   will also be the set as the on board jumper's setting. TrigMode specified 
   the trigger method as internal or external trig. Div1 and Div2 will be used 
   when internal trigger method was set. And the sampling rate for each channel 
   will be 1MHz/(Div1*Div2). Count and pBufORSize are related to each other.
   When in recycle mode, Count=0, and pBufORSize will determine the buffer size
   for driver(AXDDR) to allocated internally. Note that the buffer size should 
   be products of the total number of scan channels. i.e. when scan channel is
   0~15, then the buffer size should be products of 16. When in single cycle 
   mode, Count=1~32767, and pBufORSize will be the buffer pointer allocated by
   user to store data from I/O device.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412DMAGetStatus

Description:
   Check the writting status of the driver buffer.

   int ax5412DMAGetStatus(int DMACh, int* flag, WORD* ActiveBuffer, 
                           WORD* CurrentCount);
   DMACh: DMA channel number.
   flag: Pointer to a flag to determine whether the data was ready to get.
   ActiveBuffer: Indicates the current buffer used in DMA process.
   CurrentCount: Indicates the current count of the ActiveBuffer.

Remarks:
   Call this function to check whether the data was ready inside the driver
   buffer. If the flag turns to be SET, flag=ID_DATA_READY, the data buffer is
   ready. When in recycle mode, call axOOOODmAGetData() to retrieve data from 
   internal buffer to reset flag.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412DMAGetData

Description:
   Get data from the driver buffer with specified size.

   int ax5412DMAGetData(int DMACh, int* buffer, WORD Size);
   DMACh: DMA channel number.
   buffer: Pointer to a buffer that will then store data from the driver.
   size: Size of buffer to retrive from the driver.

Remarks:
   After a call to check the driver buffer status, use this function to get
   the data ready in the driver if the status flag is SET. The data retrived 
   will still be raw data, call the raw-to-real convert function to convert the 
   buffer data to be real data.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412DMAStop

Description:
   Stops the analog input via DMA function.

   int ax5412DMAStop(int DMACh);
   DMACh: DMA channel number.

Remarks:
   This function should be called after performing analog input via DMA
   function.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412RawToReal

Description:
   Convert data from raw data to real data.

   int ax5412RawToReal(int GainCode, float* fBuffer int* iBuffer, WORD size);
   GainCode: Gain code used when ax5412IRQStart was called. The high byte of 
      the gaincode determines whether high gain or low gain this device is, and 
      the low byte of the gaincode determines the gain code used. For example, 
      gaincode 0x0102 stands for AX5412 high gain device, since 
      HIBYTE(gaincode)=01, and the gain is 100(gain code:02), since 
      LOBYTE(gaincode)=02.
   fBuffer: Pointer to a buffer that will then store real data.
   iBuffer: Pointer to a buffer that stores raw data.
   size: Block size of buffer to be converted from raw data to real data.

Remarks:
   Use this function to convert the iBuffer data to real data.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412SetCntMode

Description:
   Setup up Intel i8254 counter/timer mode of AX5412.

   int ax5412SetCntMode(int base_addr, int CntNo, int Mode);
   base_addr: I/O base address of the device.
   CntNo: Counter number. CNT#0,1,2,....
   Mode: Mode number of Inter i8254. Value from 0, Mode0, to 5,Mode5.

Return Values:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412GetCntSts

Description:
   Retrieve the status of the specified counter.

   int ax5412GetCntSts(int base_addr, int CntNo, int* pStatus);
   base_addr: I/O base address of the device.
   CntNo: Counter number. CNT#0,1,2....
   pStatus: Pointer to storage of counter status.

Return Value:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412ReadCnt

Description:
   read the current count of the specified counter.

   int ax5412ReadCnt(int base_addr, int CntNo, WORD* pdata);
   base_addr: I/O base address of the device.
   CntNo: Counter number. CNT#0,1,2....
   pdata: Pointer to storage of current count.

Return Value:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412WriteCnt

Description:
   Write data to the specified counter.

   int ax5412WriteCnt(int base_addr, int CntNo, WORD data);
   base_addr: I/O base address of the device.
   CntNo: Counter number. CNT#0,1,2....
   data: Data that will be loaded onto the counter.

Return Value:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412EventCount

Description:
   Event counting function.

   int ax5412EventCount(int base_addr, int CntNo, WORD ConvNo);
   base_addr: I/O base address of the device.
   CntNo: Counter number. CNT#0,1,2....
   ConvNo: Specify the initial value to count down.

Return Value:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.


Function:
   ax5412WaveGen

Description:
   Generate square wave through OUT pin.

   int ax5412WaveGen(int base_addr, int CntNo, DWORD base_freq, DWORD out_freq);
   base_addr: I/O base address of the device.
   CntNo: Counter number. CNT#0,1,2....
   base_freq: Base frequency of the counter CLK source.
   out_freq: Value of the output frequency.

Return Value:
   This function will return an error code defined in the ERROR CODE LIST of
   AXDDR include file(axddr.h). Please be sure to check this returned value to
   determine whether the function call succeed or not. If there're no any error
   occured, the return value should be ERR_NOERR. Otherwise, the value will be
   the one defined in ERROR CODE LIST.

Download Driver Pack

How To Update Drivers Manually

After your driver has been downloaded, follow these simple steps to install it.

  • Expand the archive file (if the download file is in zip or rar format).

  • If the expanded file has an .exe extension, double click it and follow the installation instructions.

  • Otherwise, open Device Manager by right-clicking the Start menu and selecting Device Manager.

  • Find the device and model you want to update in the device list.

  • Double-click on it to open the Properties dialog box.

  • From the Properties dialog box, select the Driver tab.

  • Click the Update Driver button, then follow the instructions.

Very important: You must reboot your system to ensure that any driver updates have taken effect.

For more help, visit our Driver Support section for step-by-step videos on how to install drivers for every file type.

server: web4, load: 0.57