麻豆一区区三三四区产品麻豆-麻豆影视国产TV在线观看-麻豆影视国产在线观看-麻豆影视在线-麻豆影视在线观看av-麻豆影院

vios1161
級別: 略有小成
精華主題: 0
發(fā)帖數(shù)量: 190 個
工控威望: 308 點
下載積分: 675 分
在線時間: 210(小時)
注冊時間: 2016-07-30
最后登錄: 2024-11-20
查看vios1161的 主題 / 回貼
樓主  發(fā)表于: 2016-11-26 01:07
今天教的直接用 PC 程式來控制機臺 ( 臺灣丙級機電整合術(shù)科第一題 )
用 PC 來程式…真的不方便,還是 Ladder 比較容易。
附上程式
PCtoPLC.rar (73 K) 下载次数:210
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重新編輯 ]
lyntechme
虛心做人,踏實做事
級別: 家園常客
精華主題: 0
發(fā)帖數(shù)量: 563 個
工控威望: 709 點
下載積分: 12711 分
在線時間: 256(小時)
注冊時間: 2012-03-31
最后登錄: 2023-06-04
查看lyntechme的 主題 / 回貼
1樓  發(fā)表于: 2017-02-21 18:35
這個資料不錯啊
 

主站蜘蛛池模板: 国产在线成人一区二区三区| 97夜夜澡人人爽人人| 丝袜诱惑在线视频| 亚洲欧美激情精品| 久久国产中文字幕免费| 无码人妻AV一区二区三区蜜臀| 各种场合肉H校园1V1| 日韩国产一区二区三区在线| 久久成人国产精品一区二区| 国产在线a免费观看| 亚洲自拍中文字幕在线| 96无人区码一码二码三码| 乱色熟女综合一区二区三区| 国产免费不卡v片在线观看| 国产SUV精品一区二区33| 无码高清另类影院| 国产成人不卡亚洲精品91| 黄色网址www| 美女天天干天天操| 91精品国产综合久久婷婷| 免费综合色视频| 色欲AV蜜臀AV在线观看麻豆| 国产精品三级国产电影| 亚洲国产五月综合网| 日本91av在线观看| 久久久国产久久国产首页| 日韩欧美三级视频| 成年免费大片黄在线观看视频 | 亚洲av片不卡无码久久| 久久久久久综合对白国产| 国产亚洲精品久久久久久久| 成人国产在线播放一区二区| 日本成熟少妇高潮A片| 精品久久久AV无码专区| 国产午夜精品喷水久久| 一本道在线高清观看| 亚洲欧美一区二区三区在饯| 狠狠色噜噜狠狠狠狠黑人 | 嫩草院一区二区乱码| 国产成人精品午夜福利| 四虎欧美在线观看免费|