Moxa V2401-CE Руководство по программной части (Linux) онлайн [71/108] 170746

Moxa V2401-CE Руководство по программной части (Linux) онлайн [71/108] 170746
V2401/2402 Series Linux User’s Manual Programmer Guide
4-8
printf("Please keyin the DIN number : ");
scanf("%d", &i);
printf("Please input the DIN duration, this minimun
value must be over %d : ",MIN_DURATION);
scanf("%lu", &duration);
retval=set_din_event(i, hightolowevent,
DIN_EVENT_HIGH_TO_LOW, duration);
} else if ( i == 2 ) { // get now data
printf("DIN data : ");
for ( j=0; j<MAX_DIN_PORT; j++ ) {
get_din_state(j, &state);
printf("%s", DataString[state]);
}
printf("\n");
printf("DOUT data : ");
for ( j=0; j<MAX_DOUT_PORT; j++ ) {
get_dout_state(j, &state);
printf("%s", DataString[state]);
}
printf("\n");
} else if ( i == 3 ) { // set low to high event
printf("Please keyin the DIN number : ");
scanf("%d", &i);
printf("Please input the DIN duration, this minimun
value must be over %d : ",MIN_DURATION);
scanf("%lu", &duration);
retval = set_din_event(i, lowtohighevent,
DIN_EVENT_LOW_TO_HIGH, duration);
} else if ( i == 4 ) { // clear event
printf("Please keyin the DIN number : ");
scanf("%d", &i);
retval=set_din_event(i, NULL, DIN_EVENT_CLEAR, 0);
} else if ( i == 5 ) { // set high data
printf("Please keyin the DOUT number : ");
scanf("%d", &i);
retval=set_dout_state(i, 1);
} else if ( i == 6 ) { // set low data

Содержание

Похожие устройства

Скачать