int main(
int argc,
char * argv[])
{
int rc;
char szFileName[80] = "/etc/RTU/config.rtu";
int isNameSet = 0;
int isValueSet = 0;
int i;
char ch;
char *tagName[] = {"S0_DI0_DIValue",
"S0_DI1_DIValue",
"S0_DI2_DIValue",
"S0_DI3_DIValue",
"S0_DI4_DIValue",
"S0_DI5_DIValue",
"S0_DI6_DIValue",
"S0_DI7_DIValue",
"S0_DIO0_DOValue",
"S0_DIO1_DOValue",
"S0_DIO2_DOValue",
"S0_DIO3_DOValue",
"S0_DIO4_DOValue",
"S0_DIO5_DOValue",
"S0_DIO6_DOValue",
"S0_DIO7_DOValue"};
const int tagAmount = sizeof(tagName) / sizeof(char *);
printf("MX_RTU_Tag_Init(), return code = %d.\n", retval);
return 0;
}
while (1) {
UINT8 bitVal = 0;
for (i = 0; i < tagAmount/2; i++) {
printf("DI[%d] = %d\n", i, bitVal);
printf("MX_RTU_Tag_Read(%s) = %d\n", tagName[i], retval);
}
}
printf("==========================\n");
sleep(2);
}
printf("MX_RTU_Tag_Uninit(), return code = %d\n", retval);
}
return 0;
}