How to Use This Document This document is written to provide the information of the SDK and helps users implement their own applications Chapter 1, “Basic Structure” introduces the fundamental information for applying the functions in this document. Chapter 2, “Function Description”...
Table of Contents Revision History .................... ii How to Use This Document ................ iii CHAPTER 1 Introduction ..............1 The Basic of the Programming ..........1 Create a Receiver Data Example ..........3 The Calibration Flow Chart ............5 CHAPTER 2 Function Description ........... 7 Open_Device ................
IRU151-I Programmer Guidel CHAPTER 1 Introduction This chapter introduces the information of the SDK. The Basic of the Programming To create an application with SDK, please follow the steps below. Step 1 : Include IRU head file. When user program a IRU application to call IRU API, user has to include "libiru.h"...
Page 8
IRU151-I Programmer Guidel Step 3 : Get information from device via API i=0; char *pDevInfo; short length; (Continue) modelidx = 1; ret = GetDevInfo(modelidx, &pDevInfo, &length); if(ret == AXIO_OK){ for(i=0;i<length;i++) printf("%c", toascii( *(pDevInfo +i))); printf("\n"); } else printf("Get Device info failure\n");...
IRU151-I Programmer Guidel Create a Receiver Data Example This example shows how to receive DI data. The sample is for a digital I/O receiver. #define AXIO_OK 0x00 channel = 1; filter = 0 trig = 2; stop; ret; ret = Open_Device("IRU151");...
IRU151-I Programmer Guidel CHAPTER 2 Function Description This chapter describes the detail information of the SDK functions. Open_Device Description Open the communication channel of I/O module. Definition int Open_Device ( char *devName Parameters *devName [in]: The name of target module. (IRU151/IR152) ...
IRU151-I Programmer Guidel CloseDevice Description Close the communication channel of I/O module. Definition int Close_Device (); Parameters NULL Return value AXIO_OK if successful. Other value represent the error. (See Error Code) Example Int ret = 0;...
IRU151-I Programmer Guidel GetDevInfoEx Description Get the device information. Definition int GetDevInfoEx( infoIndex, char *info, *infoLen Parameters infoIndex [in]: This information index. 0x00 : Model Name 0x01 : Manufacture 0x02 : Firmware version *info [out]: The information string.
IRU151-I Programmer Guidel if (ret == AXIO_OK) printf(“%s\n”, info); else printf("Get Device info failure\n"); EnAIReceiver Description Enable the receiver of the selected AI receiver. Definition int EnAIReceiver (void); Parameters NULL Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel DisAIReceiver Description Disable the receiver of the selected AI channel. Definition int DisAIReceiver (void); Parameters NULL Return value AXIO_OK if success, or other value represents the error. (See Error Code) Example ret;...
IRU151-I Programmer Guidel ReadAIDataEx Description Read AI data from SDK Definition void ReadAIDataEx( size, char *data, *length Parameters size [in]: The buffer size. *data [out]: The AI data. (For example: Setting AI channel are 0, 1, 2, the input data will put buffer by order.
IRU151-I Programmer Guidel if (length > 0) for(i=0;i< length;i++) printf(“0x%02x “, data[i]); printf(“\n”); ReadAIVoltEx Description Read voltage data from SDK Definition void ReadAIVoltEx ( size, double *data, * length Parameters size [in]: The buffer size. *data [out]: The voltage data (For example: Setting AI channel are 0, 1, 3, the input data will put buffer by order.
Page 20
IRU151-I Programmer Guidel Example ret = 0; i = 0; double data[1024]; length = 0; ret = ReadAIVoltEx (1024, data, &length); (Continue) if (length > 0) for(i=0;i< DataLength;i++) printf(“%lf \n”, data[i]); printf(“\n”); Function Description...
IRU151-I Programmer Guidel 2.10 SetAISampleRate Description Set AI sample rate. (This API is not support on IRU151) Definition int SetAISampleRate ( divisor Parameters divisor [in]: The divisor of sample rate.. The internal clock source is 88.67M. Sample rate = 88.67M / divisor (24 bit) ...
IRU151-I Programmer Guidel 2.11 SetAInputRange Description Set AI input range. There are 4 types to be chosen. (IRU151 only supports -5~+5V, -10~+10V, 0~20 mA) Definition int SetAInputRange ( short range Parameters range Input voltage range 0 : 0V ~ +5V...
IRU151-I Programmer Guidel 2.12 FactoryCalibratedRestore Description Reset the AI calibration value to default value. Definition int FactoryCalibratedRestore(void); Parameters NULL Return value AXIO_OK if success, or other value represents the error. (See Error Code) Example ret;...
IRU151-I Programmer Guidel 2.15 GetAIinitConfEx Description Get AI initial setting from flash memory. Definition int GetAIinitConfEx ( configSize, AI_CONIFG *config, *length Parameters configSize [in]: The buffer size of AI configuration. *config [out]: The AI configuration buffer. *length [out]: The length of AI configuration.
IRU151-I Programmer Guidel printf("Sample rate: %d\n", config[i].sampleRate); printf("===============================================\n"); 2.16 SetAIinitConf Description Store AI initial configuration to flash memory. Definition int SetAIinitConf (void) Parameters NULL Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.17 AICalibrationEx Description Start the AI calibration mode. (IRU151 only supports -5~+5V and -10~+10V) Definition int AICalibrationEx( mode, size, char *data, *length Parameters mode [in]: The calibration mode. 0x01 : Enter the user calibrate mode.
IRU151-I Programmer Guidel 2.18 RestoreAIConf Description Reset AI intial configuration to default in flash memory. Definition int RestoreAIConf (void) Parameters NULL Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.19 GetAIDataLength Description Get remaining AI data length in SDK. Definition int GetAIDataLength (int *length); Parameters *length [out]: The length of remaining data. Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.20 GetDITrigConfEx Description Get DI trigger configuration. Definition int GetDITrigConf ( DI_TRIGGER_CONFIG *config Parameters *config [out]: The DI trigger configuration. Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.21 ClearDITrigConf Description Restore the default settings in the flash memory. Definition int ClearDITrigConf (void) Parameters NULL. Return value AXIO_OK if success, or other value represents the error. (See Error Code) Example ret;...
IRU151-I Programmer Guidel 2.22 SetDITrigConf Description Save the DI trigger setting in the flash memory. Definition int SetDITrigConf (void) Parameters NULL Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.23 GetDILevelEx Description Get current DI level. Definition int GetDILevel (int *level) Parameters *level [out]: The current DI level. Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.25 DisDIReceiver Description Disable the DI receiver. Definition int DisDIReceiver( short channel Parameters channel [in]: Channel. (Bit0-7 indicates channel 0-7) Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.27 DisDICounterEx Description Disable the DI counter mode. Definition int DisDICounterEx( channel, char *data, *length Parameters channel [in]: Channel (Bit0-7 indicates channel 0-7) data [out]: The data of DI counter. Byte0: Channel index. Byte1: Number of counts. (HI) Byte2: Number of counts.
IRU151-I Programmer Guidel 2.28 GetDICounterEx Description Get the DI counter number. Definition int GetDICounterEx (int channel, int *data) Parameters channel [in]: The channel index. (Bit0-7 indicates channel 0-7) data [out]: The current data of DI counter. ...
IRU151-I Programmer Guidel 2.29 SetDICounterCompletedCallback Description Set the DI counter finish callback function. Definition int SetDICounterCompletedCallback( DICounterCompletedCallback callback Parameters callback The callback function for receiving counter finished value. Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.30 SetDIStatusChangedCallback Description Set the DI status change callback function for the notification while receiving the DI Data. Definition int SetDIStatusChangedCallback( DIStatusChanged_Callback callback Parameters callback [in]: The callback function for receiving DI Data notification..
IRU151-I Programmer Guidel 2.31 GetDOInitConfEx Description Get the DO setting from the flash memory. Definition int GetDOInitConfEx ( char *config, *length Parameters *config [out]: The data of the gotten information. [Byte 0 : Channel 0 ] 0x00 : Low...
IRU151-I Programmer Guidel 2.33 SetDOInitConf Description Save DO settings. Definition int SetDOInitConf (void) Parameters NULL Return value AXIO_OK if success, or other value represents the error. (See Error Code) Example int ret; ret = SetDOInitConf ();...
IRU151-I Programmer Guidel 2.34 SetDOStatus Description Set the DO status on the selected channel.. Definition int SetDOStatus( channel, level Parameters channel [in]: Selected channel. Bit 0 to 1 indicates the channels 0 ~ 1. level [in]: The output status.
IRU151-I Programmer Guidel 2.35 GetDOStatus Description Get the DO status on the selected channels Definition int GetDOStatus ( short channel, *level Parameters [in]: The value of 1 to 3 indicates the channels 0 – 1. channel *level [out]: The current DO output status.
IRU151-I Programmer Guidel 2.36 EnDOPWM Description Enable PWM mode on the channel 0 and set all parameters. Definition int EnDOPWM ( channel , dutycycle, short freq Parameters channel Selected channel (Must be 0) dutycycle The range of the duty cycle is from 1(%) to 99(%).
IRU151-I Programmer Guidel 2.37 DisDOPWM Description Disable PWM mode on the channel 0. Definition int DisDOPWM ( channel Parameters channel Selected channel (Must be 0) Return value AXIO_OK if success, or other value represents the error. (See Error Code) ...
IRU151-I Programmer Guidel 2.38 GetDOPWMConf Description During DO PWM starting, User can call this function to get the DO PWM mode configuration. Definition int GetDOPWMConf ( char *config, *length Parameters *config The data of the gotten information.
IRU151-I Programmer Guidel APPENDIX A Error Code Error Code List Error Code Error Name Description 0x00000000 AXIO_OK Success 0xE0000001 AXIO_ERR_HANDLE The invalid handle. 0xE0000502 AXIO_ERR_CMD The command operation failure. 0xE0000003 AXIO_ERR_PARAMETERS The input parameters are incorrect.. 0xE0000004 AXIO_ERR_NOT_SUPPORTED The feature is not support.
Need help?
Do you have a question about the IRU151-I and is the answer not in the manual?
Questions and answers