XP8500
42
s
Software Reference
float adc4_convert( int data, struct
adc4coeff *cnvrsn )
Converts A/D
data
read by
adc4_read( )
or
adc4_set ( )
into
voltage equivalent. An
adc4coeff
structure pointed to by
cnvrsn
stores the conversion constants for this function. The voltage is
voltage = cnvrsn->invgain *
( cnvrsn->zero_offset data)
.
RETURN VALUE: voltage value of the A/D data.
int adc4_readcoeff( unsigned int board_adr,
int chan, struct adc4coeff *cnvrsn )
Reads the constants for converting A/D data to voltages.
PARAMETERS:
board_adr
is the physical address of the XP8500
board, defined as 0000 1100 ppxy.
chan
ranges from 0 to 10, corresponding to the boards 11 A/D
channels.
cnvrsn
is a pointer to the
adc4coeff
structure that stores the
constant
zero_offset
and the data-to-voltage conversion constant
invgain
. The structure stores the constants as 6 continuous bytes in
reserved spaces of the XP8500s EEPROM.
RETURN VALUE: 0 if the constants are read successfully from the
EEPROM, 1 if the XP8500 board cannot be found, 2 if a problem
occurs while accessing the EEPROM.
int adc4_writecoeff( unsigned int board_adr,
int chan, struct adc4coeff *cnvrsn )
Stores the constants for converting A/D data to voltages.
PARAMETERS:
board_adr
is the physical address of the XP8500
board, defined as 0000 1100 ppxy.
chan
ranges from 0 to 10, corresponding to the boards 11 A/D
channels.
cnvrsn
is a pointer to an
adc4coeff
structure that stores the
constant
zero_offset
and the data-to-voltage conversion constant
invgain
. The structure stores the constants as 6 continuous bytes in
reserved spaces of the XP8500s EEPROM.
RETURN VALUE: 0 if the constants are stored successfully in the
EEPROM, 1 if the XP8500 board cannot be found, -2 if a problem
occurs while accessing the EEPROM, 3 if the upper 256 bytes of the
EEPROM are write-protected.
Содержание Exp-A/D12
Страница 6: ...vi s Contents XP8500 and Exp A D12 Blank...
Страница 10: ...XP8500 and Exp A D12 x s About This Manual Blank...
Страница 11: ...XP8500...
Страница 12: ...Blank...
Страница 49: ...EXP A D12...
Страница 50: ...Blank...
Страница 58: ...Exp A D12 58 s Getting Started Blank...
Страница 64: ...Exp A D12 64 s I O Configurations Blank...
Страница 73: ...APPENDICES...
Страница 74: ...Blank...
Страница 86: ...XP8500 and Exp A D12 86 s PLCBus Blank...
Страница 87: ...XP8500 and Exp A D12 Specifications s 87 APPENDIX B SPECIFICATIONS...
Страница 92: ...XP8500 and Exp A D12 92 s Specifications Blank...
Страница 97: ...XP8500 and Exp A D12 Simulated PLCBus Connection s 97 APPENDIX D SIMULATED PLCBUS CONNECTION...
Страница 99: ...XP8500 and Exp A D12 Technical Circuit Details s 99 APPENDIX E TECHNICAL CIRCUIT DETAILS...
Страница 104: ...XP8500 and Exp A D12 104 s Technical Circuit Details Blank...