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

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) 下载次数: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重新編輯 ]
碎心斷劍
每天給自己一個微笑,快樂幸福少不了
級別: 家園常客
精華主題: 0
發帖數量: 173 個
工控威望: 947 點
下載積分: 676 分
在線時間: 69(小時)
注冊時間: 2011-08-31
最后登錄: 2024-12-01
查看碎心斷劍的 主題 / 回貼
1樓  發表于: 2017-02-21 19:40
好東西謝謝樓主分享希望多多分享哦
每天給自己一個微笑,快樂幸福少不了!呵呵……

主站蜘蛛池模板: 91麻豆精品国产自产在线| 真实国产乱子伦精品视频久久久久 | 久久综合图区亚洲综合图区| 久久久久久亚洲精品专区| 人妻斩 无码在线| av无码av无码专区| 免费播放欧美毛片欧美AAAAA| 国产一区二区三区四区五在线观看| 国产精品亚洲一区二区无码国产| 亚洲A片无码精品毛片色戒| 美国一级毛片视频| 国产午夜小视频| 亚洲狠狠爱| 刘涛一级毛片| 国产亚洲AV综合一区二区A片| 国产精品蝌蚪| 5566在线资源 | 亚洲a∨无码成人精品区在线观看| 精品亚洲a一区二区三区| 日日夜夜精品视频天天综合精品视频| 2024精品国产无码| 久久精品国产亚洲av麻豆图片| 国产久久在线观看| 2024人人干人人操| 久久久av久av久片一区二区| 国产成人女人视频在线观看| 69精品一区二区三区蜜桃| 久久精品美女| 中日黄色录像一级片免费播放| av无码天堂人妻一区二区三区| 久久99国产精品综合毛片| 中文字幕无码日韩专区免费| 欧美牲交a欧美牲交| 精品久久久久久久久精品| 在线视频精品久久| 亚洲欧美精品在线| 久久ra热在线精品视频| 无码精品黑人一区二区三区| 人妻精品丰满熟妇区| 精品国产乱码久久久久久软件大全| 一级a一级a爰片免费免免欧美|