ICP DAS USA LP-22 Series User Manual page 114

Hide thumbs Also See for LP-22 Series:
Table of Contents

Advertisement

char i[10];
// Check Open_Com9 on the I-8114W
wRetVal = Open_Com(COM9, 115200, Data8Bit, NonParity, OneStopBit);
if (wRetVal > 0) {
printf("Failed to open port. \n");
return (-1);
}
// ***** 7044 DO & DI Parameters *******
wBuf[0] = 9;
wBuf[1] = 0x02;
wBuf[2] = 0x7044;
wBuf[3] = 0;
wBuf[4] = 100;
wBuf[6] = 0;
// 7044 DO
while(j!=113) {
printf("Enter the DO value, or press 'q' to quit -> ");
scanf("%s",i);
if (i[0]=='q') {
wBuf[5] = 0;
wRetVal = DigitalOut(wBuf, fBuf, szSend, szReceive);
break;
}
j=atoi(i);
if (j>=0 & j<=255)
wBuf[5] = j;
else if (j>255)
wBuf[5] = 255;
wRetVal = DigitalOut(wBuf, fBuf, szSend, szReceive);
if (wRetVal)
printf("Digital Output of 7044 is error, Error Code=%d\n", wRetVal);
else
printf("The DO value of 7044 is: %u \n", wBuf[5]);
AM335X-PAC Series User Manual
Copyright © 2019 ICP DAS Co., Ltd. All Rights Reserved.
// COM Port
// Address
// ID
// Checksum disable
// Timeout, 100 milliseconds
// Debug string
// All DO Channels OFF
// DO Channels ON
//
There was an error with the Digital Output on the I-7044
version 2.0.1
Page: 114
E-mail: service@icpdas.com

Advertisement

Table of Contents
loading

Table of Contents