ICP DAS USA LinPAC AM335 Series User Manual page 119

Hide thumbs Also See for LinPAC AM335 Series:
Table of Contents

Advertisement

// 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;
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]);
DigitalIn(wBuf, fBuf, szSend, szReceive);
printf("The DI of 7044 : %u \n", wBuf[5]);
}
Close_Com(COM9);
return 0;
}
AM335X-PAC Series User Manual
Copyright © 2021 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.4
// 7044 DO
// 7044 DI
Page: 119
E-mail: service@icpdas.com

Advertisement

Table of Contents
loading

Table of Contents