2.5 撰寫 PlcRun 的順序
plcRun 是整個 PLC 中最重要的程序,這邊會撰寫訊號狀態、警報、機械面板、M 碼、S 碼、T 碼的處理方式。通常相同的處理程序會寫在一起,plcRun 處理順序如下:
void PLCAPI plcRun(struct Status &sts, struct PlcBlock &plc){
.
signal state procedure
alarm procedure
machine panel procedure
M code procedure
S code procedure
T code procedure
emgency procedure
signal state save procedure
stage machine procedure
}