#define Stepll 10 /Dieu Tien Khuon

Một phần của tài liệu Thiết kế bộ điều khiển máy ép phun nhựa dùng vi xử lý (Trang 57 - 60)

: HUỲNH THANH DƯƠNG

#define Stepll 10 /Dieu Tien Khuon

#define Step12 #define Stepl3 #define Stepl4 #define Step15

11 /Dieu Lui Khuon

12 /Cho Dong Cua

13 /Nen Keo 14 /Lui Keo I

//Định nghĩa các thời gian

#define KemOnTimeOut_ 3000 //Time Out Dong Kem #define KemOffTimeOut 3000 //Time Out Mo Kem

#define LoaiSPTimeOut 3000 /Time Out Loại SP

#define BomKeoTimeOut_ 3000 /Time Out Bom Keo

#define LuiKeoTimeOut 3000 //Time Out Ea Keo

#define LayKeoTimeOut 3000 //Time Out Lay Keo

#define MoCuaTimeOut_ 3000 //Time Out Mo Cua Lay SP

#define TienDaiTimeOut 3000 //Time Out Tien Dai

//Time delay Co Khi

#define CKKemOn 30 //Delay Co Khi Cho Dong Kem #define CKKemOff 30 /Delay Co Khi Cho Mo Kem #define CKBomKeo 30 /Delay Co Khi Cho Bom Keo #define CKULuiKeo 30 //Delay Co Khi Cho Lui Keo #define CKLayKeo 30 /Delay Co Khi Cho Lay Keo

#define MaxProValve 4350 /Gia tri Max cua PWM

#endif

Í[-Ở~-<~=eerrrrrrerrrrrrrrrxrrsrrrrsrrmrrrrrrerrrrrrer /J

// Xet chay chuong trinh sử đụng cho he thong may ep nhua // /Ặ-~-ce~e~~e==r=rrsrrrrrrrrmrmrrrrrrsrmrrrr=rrrrrrrrerrrei tị

void RunSystemMode(void) //Xet chay chuong trinh cho he thong

{

/ICap nhat Loi Lui

LoiForRev=BI9; //Bao Loi Toi = Lui

//Xet nhan phim Mode Ôperation

UpdateModeOperationQ; //Cap nhat Mode hoat dong /Xet cac chay chuong trinh

ChayChuongTrinhQ; //Chay chuong trinh ung dung /'Cap nhat Coi

UpdateCoiQ;

//Xet Dem San Pham DemSanPhamQ;

LUẬN ÁN TỐT NGHIỆP

/Xet Dem San Pham //

void DemSanPham(void)/⁄/Xet Dem San Pham

{ (adsbygoogle = window.adsbygoogle || []).push({});

//Dem San Pham

1fXetDem) //Dem SP { XetDem=O0; //Init //Tang Dem SP If(+trCounSP0==100) { CounSPO=0; /Init 1f(++CounSPI==100) { CounSP1=0; /Init 1f(++CounSP2==100) { CounSP2=0; /Init 1f(++CounSP3==I00) CounSP3=0; /Inr void UpdateCoi(void) {

/'Xet tat coi If(T5_OVER)

{

3

Một phần của tài liệu Thiết kế bộ điều khiển máy ép phun nhựa dùng vi xử lý (Trang 57 - 60)