struct plcx{ /*转换主令链*/
char x〔5〕; /*每步主令*/
struct plcx *xnext;
};
struct plcy{ /*输出继电器链*/
char y〔5〕; /*输出继电器*/
struct plcy *ynext;
};
struct plcy { /*定时器链*/
char t〔5〕; /*时间继电器*/
float tb; /*时间常数*/
int tn; /*断开时间继电器步序号*/
struct plct *tnext;
};
struct plcc; /*计数器链*/
char c〔5〕; /*计数器*/
int cb; /*计数常数*/
int crnl; /*1-初始复位,0-初始不复位*/
struct plccb *blist; /*计数逻辑链*/
struct plccr *rlist; /*复位逻辑链*/
};
struct plccb{ /*计数逻辑链*/
char cb〔5〕; /*计数逻辑*/
struct plccb *bnext;
};
struct plccr{ /*复位逻辑链*/
char cr 〔5〕; /*复位逻辑*/
struct plccr *rnext;
};
struct PLC{
struct plcx *xlist; /*主令链*/
struct plcy *ylist; /*输出链*/
struct plct *tlist; /*时间链*/
};
struct PLC P_num〔MAX〕 /*PLC结构数组*/
struct Plcc c_num〔MAX〕 /*计数器结构数组*/
程序流程如图1所示。
图1 总体流程图
4 模拟试验
以双动薄板拉伸液压机为对象进行模拟试验,根据受控对象工艺要求拟定工步状态表如表2所示。
表2
本文关键字:暂无联系方式PLC入门,plc技术 - PLC入门
上一篇:可编程控制器原理