AXIOMTEK IRU151-I Reference Manual Download Page 51

IRU151-I Programmer Guidel

 

Function Description

 

 

45

 

 

2.36  EnDOPWM 

 

Description 

Enable  PWM mode on the channel 0 and set all parameters. 

 

 

Definition 

int  EnDOPWM ( 

int  

 

channel ,  

int  

 

dutycycle,  

short  

 

freq 

); 

 

 

Parameters 

channel 

 

Selected channel (Must be 0) 

dutycycle 

 

The range of the duty cycle is from 1(%) to 99(%). 

freq 

 

The range of the value is from 1 to 500(Hz). 

 

 

Return value 

AXIO_OK if success, or other value represents the error. (See Error Code) 

 

 

Example 

short  

freq = 100; 

int  

duty = 50; 

short  

channel = 1; 

int   

ret; 

 

ret = EnDOPWM(channel, duty, freq); 

 

if(ret != AXIO_OK){ 

     printf(

“Enable DO PWM failure\n”); 

Summary of Contents for IRU151-I

Page 1: ...IRU151 I Software Development Kit Reference Manual...

Page 2: ...ii Revision History Version Revised Date Author Description 1 0 2018 12 05 Hank 1st release...

Page 3: ...r 1 Basic Structure introduces the fundamental information for applying the functions in this document Chapter 2 Function Description introduces the detailed information of the functions provided by t...

Page 4: ...rigConfEx 15 2 9 SetAIChannel 16 2 10 SetAISampleRate 17 2 11 SetAInputRange 18 2 12 FactoryCalibratedRestore 19 2 13 ReadCaliFactors 20 2 14 GetAISingleValueEx 21 2 15 GetAIinitConfEx 23 2 16 SetAIin...

Page 5: ...v 2 32 ClearDOInitConf 41 2 33 SetDOInitConf 42 2 34 SetDOStatus 43 2 35 GetDOStatus 44 2 36 EnDOPWM 45 2 37 DisDOPWM 46 2 38 GetDOPWMConf 47 APPENDIX A Error Code 49...

Page 6: ...vi This page is intentionally left blank...

Page 7: ...nclude IRU head file When user program a IRU application to call IRU API user has to include libiru h and axiomtek_err h files libiru h files is for API and control IRU device and axiomtek_err h files...

Page 8: ...PI int i 0 char pDevInfo short length Continue int 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...

Page 9: ...K 0x00 int channel 1 int filter 0 int trig 2 int stop int ret ret Open_Device IRU151 if ret AXIO_OK printf open iru151 failure n return while 1 switch stop case 0 ret EnDIReceiver channel filter trig...

Page 10: ...IRU151 I Programmer Guidel 4 Introduction if stop 2 break Close_Device...

Page 11: ...IRU151 I Programmer Guidel Introduction 5 1 3 The Calibration Flow Chart...

Page 12: ...IRU151 I Programmer Guidel 6 Introduction This page is intentionally left blank...

Page 13: ...ions 2 1 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 Return value AXIO_OK...

Page 14: ...ription 2 2 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 Err...

Page 15: ...nt infoLen Parameters infoIndex in This information index 0x00 Model Name 0x01 Manufacture 0x02 Firmware version info out The information string infoLen out The length of information string Return val...

Page 16: ...nfo failure n 2 4 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 th...

Page 17: ...iption 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 int...

Page 18: ...or example Setting AI channel are 0 1 2 the input data will put buffer by order The data of channel 0 is stored in data 0 and and data 1 the data of channe 1 is stroed in data 2 and and data 3 the dat...

Page 19: ...id ReadAIVoltEx int size double data int 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 The data o...

Page 20: ...I Programmer Guidel 14 Function Description Example int ret 0 int i 0 double data 1024 int length 0 ret ReadAIVoltEx 1024 data length Continue if length 0 for i 0 i DataLength i printf lf n data i pr...

Page 21: ...evel Parameters mode Trigger mode 0x00 Auto run 0x01 Post trigger source Triger source 0x00 AI channel 0 Analog trigger 0x01 DI channel 0 Digital trigger condition Trigger condition 0x00 Rising edge 0...

Page 22: ...f ret AXIO_OK printf Set AI Trigger configure failure n 2 9 SetAIChannel Description Select the input channel Definition int SetAIChannel short channel Parameters channel in Bit0 7 indicates channel0...

Page 23: ...int SetAISampleRate Int divisor Parameters divisor in The divisor of sample rate The internal clock source is 88 67M Sample rate 88 67M divisor 24 bit Return value AXIO_OK if success or other value re...

Page 24: ...5V 10 10V 0 20 mA Definition int SetAInputRange short range Parameters range Input voltage range 0 0V 5V 1 0V 10V 2 5V 5V 3 10V 10V 14 0 20 mA 0 5V 15 20 20 mA 5V 5V Return value AXIO_OK if success o...

Page 25: ...set 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 in...

Page 26: ...ALI_FACTORS factors Int length Parameters mode in 0 User mode 1 Factory mode size in The buffer size of factors factors out The factors buffer length out The length of factors Return value AXIO_OK if...

Page 27: ...calibration factor failure n 2 14 GetAISingleValueEx Description Get the AI single voltage with the selected channels and input range Definition int GetAISingleValue int size double data int length P...

Page 28: ...if ret AXIO_OK printf Set AI channel failure n ret SetAInputRange 0 if ret AXIO_OK printf Set AI input range failure n ret GetAISingleValueEx 16 data length Continue if ret AXIO_OK for i 0 i length i...

Page 29: ...buffer size of AI configuration config out The AI configuration buffer length out The length of AI configuration Return value AXIO_OK if success or other value represents the error See Error Code Exam...

Page 30: ...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...

Page 31: ...ange 0V 10V 0x03 Zero input 0V Span input 8V For input range 10V 10V 0x04 Zero input 2 5V Span input 4V For input range 0V 5V 0x05 Zero input 0V Span input 4V For input range 5V 5V 0x06 Start zero cal...

Page 32: ...el 26 Function Description char pCalibratedInfo short length int ret int i ret AICalibration 1 pCalibratedInfo length if ret AXIO_OK for i 0 i length i printf 0x 02x pCalibratedInfo i printf n else pr...

Page 33: ...eset 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 Example int...

Page 34: ...n 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 Example int ret 0...

Page 35: ...eters config out The DI trigger configuration Return value AXIO_OK if success or other value represents the error See Error Code Example int i 0 DI_TRIGGER_CONFIG config int length 0 int ret 0 ret Get...

Page 36: ...iption 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 i...

Page 37: ...ption 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 Example int r...

Page 38: ...nt 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 Example int ret 0 int level...

Page 39: ...nel Bit0 7 indicates channel 0 7 filter in DI filter time 0 250 ms condition in DI trigger condition 0x00 Raising edge 0x01 Falling edge 0x02 Both Return value AXIO_OK if success or other value repres...

Page 40: ...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 Example short...

Page 41: ...unter Parameters channel in Channel Bit0 7 indicates channel 0 7 condition in Set the trigger condition 0x00 Raising edge 0x01 Falling edge 0x02 Both counter in The number of counts 1 65535 Return val...

Page 42: ...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 LO length out The length of data Return value AXIO_OK if s...

Page 43: ...el int data Parameters channel in The channel index Bit0 7 indicates channel 0 7 data out The current data of DI counter Return value AXIO_OK if success or other value represents the error See Error C...

Page 44: ...unterCompletedCallback 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 Exampl...

Page 45: ...finition int SetDIStatusChangedCallback DIStatusChanged_Callback callback Parameters callback in The callback function for receiving DI Data notification Return value AXIO_OK if success or other value...

Page 46: ...config out The data of the gotten information Byte 0 Channel 0 0x00 Low 0x01 High 0xFF User not been set Byte 1 Channel 1 0x00 Low 0x01 High 0xFF User not been set length out The data length of DO in...

Page 47: ...gh Default printf n else printf Get DO setting failure n 2 32 ClearDOInitConf Description Clear the DO setting Definition int ClearDOInitConf void Parameters NULL Return value AXIO_OK if success or ot...

Page 48: ...etDOInitConf 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 SetDO...

Page 49: ...cted channel Bit 0 to 1 indicates the channels 0 1 level in The output status Bit 0 to 3 indicates the status of channel 0 1 1 High 0 Low Return value AXIO_OK if success or other value represents the...

Page 50: ...ameters channel in The value of 1 to 3 indicates the channels 0 1 level out The current DO output status 0x03 channel0 1 HI Return value AXIO_OK if success or other value represents the error See Erro...

Page 51: ...e short freq Parameters channel Selected channel Must be 0 dutycycle The range of the duty cycle is from 1 to 99 freq The range of the value is from 1 to 500 Hz Return value AXIO_OK if success or othe...

Page 52: ...Disable PWM mode on the channel 0 Definition int DisDOPWM int channel Parameters channel Selected channel Must be 0 Return value AXIO_OK if success or other value represents the error See Error Code...

Page 53: ...MConf char config int length Parameters config The data of the gotten information Byte 0 Channel index Byte 1 Duty cycle Byte 2 Frequency H Byte 3 Frequency L length The data length of the gotten info...

Page 54: ...IRU151 I Programmer Guidel 48 Function Description if ret AXIO_OK printf Get DO PWM Configure failure n else for int i 0 i length i printf 0x 02x config i printf n...

Page 55: ...00001 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 f...

Reviews: