I-8026W API User Manual, v1.0.1, June 2015
Copyright © 2015 ICP DAS Co., Ltd. All Rights Reserved. E-mail: [email protected]
3-26
3.11.
i8026W_ReadDIO
This function is used to read the Digital Input and Digital Output values from the I-8026W module.
Prototype
short i8026W_ReadDIO (
int slot, short* diVal, short* doVal,unsigned char diBitArr[], unsigned char doBitArr[]
);
Parameters
slot: specifies the slot number (1 ~ 8)
*diVal: [Output] the Digital Input data
*doVal: [Output] the Digital Output data
diBitArr: [Output] the bit status of the Digital Input data
doBitArr: [Output] the bit status of the Digital Output data
Return Values
0 = No Error
For other return values, see the Error Codes in Appendix A.
Example
[C]
int slot=1, diVal=0, doVal=0;
unsigned char diBitArr[2], doBitArr[2];
Open_Slot(slot);
i8026W_ReadDIO(slot, &diVal, &doVal, diBitArr, doBitArr);
printf("\n DI=[%02X]; DO=[ %02X ]", diVal ,doVal);