Rockwell Automation 6001-F2E AB STANDARD DRIVER SFTW User Manual

Page 25

Advertising
background image

Application Program Examples

Appendix A

A-3

/* Fct_stat returns 1 if F2E snet the command successfully */

if (fct_stat != NORMAL){

Get_ErrMsg(fct_stat, err_msg);

printf(“%s/n”,err_msg);

fct_stat = close_StdDrv(device);

exit(1);

}

/* When a reply has been received or a timeout io_stat[0] will be set*/

while(!io_stat[0]);

printf(“status reply received\n”);

/* If io_stat[0] does not = 1 then an error occurred

if (io_stat[0] != NORMAL){

Get_ErrMsg(io_stat[0],err_msg);

printf(“%s/n”,err_msg);

}

fct_stat = Close_StdDrv(device);

exit(1);

}

Advertising