一区二区三区成人-一区二区三区www-一区二区三区 日韩-一区二区日韩欧美-一区二区日韩精品中文字幕-一区二区日韩

vios1161
級別: 略有小成
精華主題: 0
發帖數量: 190 個
工控威望: 308 點
下載積分: 675 分
在線時間: 210(小時)
注冊時間: 2016-07-30
最后登錄: 2024-11-20
查看vios1161的 主題 / 回貼
樓主  發表于: 2016-11-26 01:07
今天教的直接用 PC 程式來控制機臺 ( 臺灣丙級機電整合術科第一題 )
用 PC 來程式…真的不方便,還是 Ladder 比較容易。
附上程式
PCtoPLC.rar (73 K) 下载次数:211
private void timerAuto_Tick(object sender, EventArgs e)
        {
            int a1 = X0[0];
            int a0 = X0[1];
            int s0 = X0[2];
            int s1 = X0[3];
            int p0 = X0[4];
            int p1 = X0[5];
            int p2 = X0[6];
            int COS2 = X1[3];
            int COS1 = X1[4];
            int PB1 = X1[5];
            int ST = X1[6];
            int EMS = X1[7];
            int A = Y0[0];
            int R1 = Y0[2];
            int R2 = Y0[4];
            int R3 = Y0[5];
            int BF = Y0[6];
            int BB = Y0[7];
            int RL = Y1[5];
            int YL = Y1[6];
            int GL = Y1[7];
            switch (StepN0 )
            {
                case 1:
                    RL = 0; // Y15 紅燈滅
                    if (a0 == 1 && p0  == 1)
                    {
                        
                        GL = 1; // Y17 綠燈亮

                        if (COS1  == 1 && COS2 ==1 && ST ==1) // COS1 & COS2 & ST
                        {
                            StepN0 = 2;
                            TAuto = 0;
                        }
                    }
                    break;
                case 2:
                    TAuto =TAuto +1;
                    if (TAuto == 10)
                    {
                        R1 = 1;
                        GL = 0;
                        if (s0 == 1)
                        {
                            StepN0 = 3;
                            TAuto = 0;
                        }
                    }
                    break;
                case 3:
                    
                    TAuto =TAuto +1;
                    if(TAuto ==20 && s1 ==1)
                    {
                        StepN0 =4;
                    }
                    break;
                case 4:
                    R1 =0;
                    if (R1 ==0)
                    {
                        A = 1;
                    }
                    
                    if(a1 ==1)
                    {
                        BF = 1;
                        TAuto = TAuto + 1;
                            if (TAuto  == 20)
                            {
                        StepN0 =5;
                            }

                    }
                    break;
                case 5:
                    A  = 0;
                    if(a0==1)
                    {
                        R2=1;
                        if (p1 ==1)
                        {

                            TAuto = 0;
                            StepN0 = 6;
                        }
                    }
                    
                    break;
                case 6:
                    R2 = 0;
                    if(COS2 ==1)
                    {
                        TAuto = 0;
                        StepN0 = 7;
                    }
                    if (COS2 == 0 && ST==1)
                    {
                        TAuto = 0;
                        StepN0 = 7;
                    }
                    break;
                case 7:
                    BF = 0;
                    BB = 1;
                    TAuto = TAuto + 1;
                            if (TAuto  == 10)
                            {
                                R3 = 1;
                                if(p0 ==1)
                                {
                                    StepN0 = 8;
                                    TAuto = 0;
                                }
                            }
                            break;
                case 8:
                            R3 = 0;
                            TAuto = TAuto + 1;

                            if (TAuto == 10)
                            {
                                StepN0 = 1;
                            }
                            break;
            }

        
[ 此帖被vios1161在2016-11-26 15:39重新編輯 ]
oyiwiw
級別: 略有小成
精華主題: 0
發帖數量: 113 個
工控威望: 267 點
下載積分: 555 分
在線時間: 81(小時)
注冊時間: 2007-10-21
最后登錄: 2024-06-03
查看oyiwiw的 主題 / 回貼
1樓  發表于: 2016-11-28 19:50
用C#寫的吧,現在用三菱通訊的MX COMPENT軟件很方便,里面有很多函數。

主站蜘蛛池模板: 男女羞羞的视频| 午夜影院费试看黄| 国产午夜精品福利| 亚瑟天堂久久一区二区影院| 国产精品不卡高清在线观看| 2022最新国产在线| 亚州春色| 男同志与动人物zozotv| 国产自产自拍| 精品久久久久久午夜| 亚洲第一se情网站| 暖暖视频高清图片免费完整版| 国产小青蛙| 精品欧美一区二区三区在线观看| 欧美一级高清片| 视频精品一区二区三区| 国产成人免费高清激情明星| 国产精品久久久久久| 亚洲国产精品成人午夜在线观看| 日本妇人成熟免费不卡片| 国产高清不卡码一区二区三区| 变态 调教 视频 国产九色| 歪歪视频在线播放无遮挡| 欧美人妖草草xxoo| 国产精品不卡高清在线观看| bt天堂在线最新版www| 国内自拍视频在线观看| 睡男神的这件小事小说在线阅读| 午夜精品在线视频| 欧美一级鲁丝片免费看| 99久久国产综合精品1尤物| 华人在线京东热| 久久午夜一区二区| se婷婷| 青青久久久国产线免观| 我年轻漂亮的继坶2中字在线播放| 午夜伦理 第1页| 免费一看一级欧美| 亚洲 欧美 国产 视频二区| 99久在线| 国内精品91最新在线观看|