supermanxm
級(jí)別: 略有小成
|
trd(SM412,D6000); IF D6010<>D6002 THEN D6010:=D6002; FOR ii:=0 TO 49 DO Chanliang(ii,8):=Chanliang(ii,7); Chanliang(ii,7):=Chanliang(ii,6); Chanliang(ii,6):=Chanliang(ii,5); Chanliang(ii,5):=Chanliang(ii,4); Chanliang(ii,4):=Chanliang(ii,3); Chanliang(ii,3):=Chanliang(ii,2); END_FOR ii; END_IF; IF M6007:=TRUE THEN Chengxuhao(D800,0):=D800; Chengxuhao(D800,1):=D801; Chengxuhao(D800,2):=Chengxuhao(D800,1)+1; END_IF; //*求和 FOR ii:=0 TO 49 DO FOR jj=2 TO 8 DO chanliang(ii,9):=chanliang(ii,9)+chanliang(ii,jj) END_FOR jj; END_FOR ii; IF M401 THEN Z0:=Z0+1 IF Z0>5 THEN Z0:=4 END_IF; END_IF; IF M400 THEN Z0:=Z0-1; IF Z0<=0 THEN Z0=0; END_IF; END_IF; D6008:=Z0*K10; |
---|---|
|
13821917697
承接電氣自動(dòng)化項(xiàng)目、電氣接線圖設(shè)計(jì)、IO點(diǎn)表、電氣元器件選型
級(jí)別: 工控俠客
|
IF M6007:=TRUE THEN 把這改下試試 |
---|---|
|
hstec2002
級(jí)別: 論壇先鋒
|
圖片:
太多語(yǔ)法錯(cuò)誤了,肯定是沒怎么看手冊(cè)。 |
|
---|---|---|
|
catywu
級(jí)別: 家園?
|
樓主找相關(guān)視頻好好看看,就不會(huì)頻繁報(bào)錯(cuò)了 |
---|---|
|
冰魚兒
級(jí)別: 正式會(huì)員
|
B站有個(gè)老師專門講這個(gè),講的很好,可以去學(xué)習(xí)一下。 |
---|---|
|
樂菱科技
級(jí)別: 略有小成
|
叫什么啊 |
---|---|
|
投湖自盡的魚
級(jí)別: 略有小成
|
感覺還是要先看視頻學(xué)習(xí)下再寫,這個(gè)問題有點(diǎn)多 |
---|---|
|
qq240559043
干就完了
級(jí)別: 略有小成
|
bool AddOK,AddNG,ON=true short AddDatOK,AddDatNG short Month,Day,DateStamp short hour short zero = 0 int int_zero = 0 int DayShift_ProductOKCount //白班OK總計(jì)數(shù) int DayShift_ProductNGCount //白班NG總計(jì)數(shù) int NightShift_ProductOKCount //夜班OK總計(jì)數(shù) int NightShift_ProductNGCount //夜班NG總計(jì)數(shù) float DayPassRate //白班良率 float NightPassRate //白班良率 int Recipe_OK,Recipe_NG//配方內(nèi)的NG/OK數(shù)量 short Current_Recipe char date[6] //date of string char str_zero[1] = "0" //字符'0' int str_len //字符長(zhǎng)度 //*******************************************配方系統(tǒng)變量的定義********************** short Recipe_Selection //選中配方的編號(hào) short Recipe_Count //配方大小 short Recipe_Creat = 1 //新增配方記錄 short Recipe_Update = 2 //更新所選配方記錄 short Recipe_Delete = 3 //刪除所選配方記錄 //*******************************************配方系統(tǒng)變量的定義********************** //*******************************************獲取HMI時(shí)間日期********************** GetData(Month, "Local HMI", LW, 9021, 1) //HMI_月 GetData(Day, "Local HMI", LW, 9020, 1) //HMI_日 GetData(hour, "Local HMI", LW, 9019, 1) //HMI_時(shí) //*******************************************獲取HMI時(shí)間日期********************** GetData(DateStamp, "Local HMI", RW, 1000, 1) //時(shí)間戳 GetData(Recipe_Count, "Local HMI", RECIPE, "ProduceCount.Count") if Recipe_Count > 0 then Current_Recipe = Recipe_Count - 1 else Current_Recipe = Recipe_Count end if GetData(AddOK, "CODESYS V3 (Ethernet)", "Application.Important_GVL.AddOK", 1) GetData(AddNG, "CODESYS V3 (Ethernet)", "Application.Important_GVL.AddNG", 1) GetData(AddDatOK, "CODESYS V3 (Ethernet)", "Application.Important_GVL.AddDatOK", 1) //********************************************************OK開始累加**************************************** if AddOK and AddDatOK >= 0 then //*****************************數(shù)據(jù) 到達(dá)上限后刪除第一組數(shù)據(jù)************************* if DateStamp <> Day and Recipe_Count >= 31 then SetData(zero, "Local HMI", RECIPE, "ProduceCount.Selection") //選中第一個(gè)數(shù)據(jù) SetData(Recipe_Delete, "Local HMI", RECIPE, "ProduceCount.Command") //刪除選中數(shù)據(jù) DELAY(100) end if //GetData(AddDatOK, "CODESYS V3 (Ethernet)", "Application.Important_GVL.AddDatOK", 1) //*****************************根據(jù)時(shí)間修改當(dāng)前數(shù)據(jù)************************* if DateStamp == Day and Recipe_Count > 0 then SetData(Current_Recipe, "Local HMI", RECIPE, "ProduceCount.Selection") select case hour case 0 GetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK1") Recipe_OK = Recipe_OK + AddDatOK SetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK1") break case 1 GetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK2") Recipe_OK = Recipe_OK + AddDatOK SetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK2") break case 2 GetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK3") Recipe_OK = Recipe_OK + AddDatOK SetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK3") break case 3 GetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK4") Recipe_OK = Recipe_OK + AddDatOK SetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK4") break case 4 GetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK5") Recipe_OK = Recipe_OK + AddDatOK SetData(Recipe_OK, "Local HMI", RECIPE, "ProduceCount.OK5") break |
---|---|
|