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

vios1161
級(jí)別: 略有小成
精華主題: 0
發(fā)帖數(shù)量: 190 個(gè)
工控威望: 308 點(diǎn)
下載積分: 675 分
在線時(shí)間: 210(小時(shí))
注冊(cè)時(shí)間: 2016-07-30
最后登錄: 2024-11-20
查看vios1161的 主題 / 回貼
樓主  發(fā)表于: 2016-11-26 01:07
今天教的直接用 PC 程式來(lái)控制機(jī)臺(tái) ( 臺(tái)灣丙級(jí)機(jī)電整合術(shù)科第一題 )
用 PC 來(lái)程式…真的不方便,還是 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重新編輯 ]
vios1161
級(jí)別: 略有小成
精華主題: 0
發(fā)帖數(shù)量: 190 個(gè)
工控威望: 308 點(diǎn)
下載積分: 675 分
在線時(shí)間: 210(小時(shí))
注冊(cè)時(shí)間: 2016-07-30
最后登錄: 2024-11-20
查看vios1161的 主題 / 回貼
1樓  發(fā)表于: 2016-11-28 22:46
沒(méi)學(xué)過(guò)…不知道怎用
現(xiàn)在老師準(zhǔn)備教 Labview ... 真的拉一拉就好,不用太花時(shí)間搞程式語(yǔ)法

引用
引用第3樓oyiwiw于2016-11-28 19:50發(fā)表的  :
用C#寫的吧,現(xiàn)在用三菱通訊的MX COMPENT軟件很方便,里面有很多函數(shù)。

主站蜘蛛池模板: 免费无码又爽又刺激A片小说| 美女脱18以下禁止看免费| 特级淫片aaaa毛片aa视频| 国产精品伦一区二区三级视频| 五月天激情综合网| 亚洲国产精品久久精品成人| 国产无内肉丝精品视频| 亚洲鲁丝片AV无码多人| 强被迫伦姧高潮无码A片漫画| 激情销魂乳妇奶水小说| 一级a毛片免费观看久久精品| 亚洲国产精品一区二区第四页| 精品国产亚洲一区二区三区| 制服丝袜中文在线| 亚洲aⅴ男人的天堂在线观看| 精品国产自在现线看久久| 在线精品亚洲一区二区三区| 亚洲阿v天堂无码在线| 精品国产人妻一区二区三区| 一区二区三区四区五区六| 亚洲精品无码专区在线播放| 麻豆国产av网站| 丁香花chengren| 波多野结衣国产区42部| 男女爽爽午夜18污污影院 | 亚洲vs日韩vs欧美vs久久| 亚洲日本一期二期三期精华液| 国产视频中文字幕| 亚洲 欧美 中文 在线 视频| 狠狠躁| 国产老妇全程露脸视频| 无码精品一区二区三区四区爱奇艺| 国产毛片| 国产精品人妻无码免费A片导航| 色欲久久综合亚洲精品蜜桃| 三级在线网站| 国产成人精品无码一区二区| 日本三区四区免费高清不卡| 人妇乱理三级| 成人女人A级毛片免费软件| 欧美成人香蕉网在线观看|