13.07.2015 Views

User manual - ICP DAS USA

User manual - ICP DAS USA

User manual - ICP DAS USA

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

wRetVal = Open_Slot(0);if (wRetVal > 0) {printf("open Slot failed!\n");return (-1);}//Check Open_Com1wRetVal = Open_Com(COM1, 115200, Data8Bit, NonParity, OneStopBit);if (wRetVal > 0) {printf("open port failed!\n");return (-1);}ChangeToSlot(2);//--- Analog output ---- **** 87022 -- AO ****i=0;wBuf[0] = 1;// COM PortwBuf[1] = 0x00;// AddresswBuf[2] = 0x87022; // IDwBuf[3] = 0;// CheckSum disablewBuf[4] = 100;// TimeOut , 100 msecondwBuf[5] = i;// Channel Number of AOwBuf[6] = 0;// string debugfBuf[0] = 2.5;// AO ValuewRetVal = AnalogOut_87k(wBuf, fBuf, szSend, szReceive);if (wRetVal)printf("AO of 87022 Error !, Error Code=%d\n", wRetVal);elseprintf("AO of 87022 channel %d = %f \n",i,fBuf[0]);ChangeToSlot(3);//--- Analog Input ---- **** 87017 -- AI ****j=1;wBuf7[0] = 1;// COM PortwBuf7[1] = 0x00; // AddresswBuf7[2] = 0x87017; // IDwBuf7[3] = 0;// CheckSum disablewBuf7[4] = 100;// TimeOut , 100 msecondwBuf7[5] = j;//Channel Number of AIwBuf7[6] = 0;// string debugwRetVal = AnalogIn_87k(wBuf7, fBuf, szSend, szReceive);if (wRetVal)printf("AI of 87017 Error !, Error Code=%d\n", wRetVal);elseprintf("AI of 87017 channel %d = %f \n",j,fBuf[0]);}Close_Com(COM1);Close_SlotAll();return 0;LinPAC-8x4x SDK:256

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

Saved successfully!

Ooh no, something went wrong!