13.07.2015 Views

User manual - ICP DAS USA

User manual - ICP DAS USA

User manual - ICP DAS USA

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.3 I-87k Modules DIO Control DemoWhen using I-87k modules for I/O control of the LinPAC-8000, the program will be alittle different, according to the location of I-87k modules. There are three conditions for thelocation of the I-87k modules:(1) When I-87k DIO modules are in the LinPAC-8000 slots, the two functions“ Open_Slot ” and “ ChangeToSlot ”, must be added before using other functions forthe I-87k modules and the function of “Close_Slot() “ also needs to be added to theend of the program. Please refer to demo in section 7.3.1.(2) When I-87K DIO modules are in the I-87k I/O expansion unit slots, then pleaserefer to the demo in section 7.3.2.(3) When the I-87k DIO modules are in the I-8000 controller slots, then the I-87kmodules will be regarded as I-8k modules and so please refer to I/O control of I-8kmodules in section 7.5.27.3.1 I-87k Modules in slots of LinPAC-8000This demo – i87kdio.c will illustrate how to control the DI/DO with the I-87054 module( 8 DO channels and 8 DI channels). The I-87054 module is in slot 3 of the LinPAC-8000.The address and baudrate in the LinPAC-8000 are constant and they are 00 and 115200respectively. The result of this demo lets DO channel 0 ~ 7 of I-87054 output and DIchannel 1 of I-87054 input. The source code of this demo program is as follows:#include#include#include "msw.h"char szSend[80], szReceive[80];DWORD dwBuf[12];float fBuf[12];int main(){int i, wRetVal;DWORD temp;//Check Open_SlotwRetVal = Open_Slot(0);if (wRetVal > 0) {LinPAC-8x4x SDK:251

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!