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.

(2) When I-8K AIO modules are in the I-8000 controller, then please refer to thedemo in section 7.6.2.7.6.1 I-8k Modules in slots of LinPAC-8000In this section, this demo program – i8kaio.c will illustrate how to control the AI/AOwith the I-8024W ( 4 AO channels ) and I-8017HW ( 8 AI channels ) module and they are inslot 1 and slot 2 of the LinPAC-8000 separately.The address and baudrate in the LinPAC-8000 are constant and they are 00 and115200 separately. The result of this demo lets AO voltage channel 0 of I-8024W output5.5V and AI channel 2 of I-8017HW input. The source code of this demo program is asfollows:#include#include#include "msw.h"char szSend[80], szReceive[80];DWORD dwBuf[12];float fBuf[12];/* ------------------------------------------------------------------- */int main(){int i, wRetVal,j;float fAi;int hAi, chAi, Succ;int Arr_hAi[5];float Arr_fAi[5];//I-8024wRetVal = Open_Slot(1);if (wRetVal > 0) {printf("open Slot failed!\n");return (-1);}//I8024 InitialI8024_Initial(1);//I8024_AO OutputI8024_VoltageOut(1,0,5.5);Close_Slot(1);//I-8017HwRetVal = Open_Slot(2);if (wRetVal > 0) {printf("open Slot failed!\n");LinPAC-8x4x SDK:263

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

Saved successfully!

Ooh no, something went wrong!