999久久久精品国产消防器材,国产成人久久综合77777,√最新版天堂资源网在线,精品久久久久区二区8888,卡一卡二卡三乱码视频

技成培訓(xùn)網(wǎng) 技成學(xué)習APP 技成工具箱 技成企業(yè)服務(wù)

歡迎回到技成培訓(xùn)網(wǎng)

技成培訓(xùn)網(wǎng)

電工題庫寶典

技成電工課堂

PLC練習題

技成PLC課堂

變頻器故障查詢

技成PLC學(xué)吧

伺服驅(qū)動故障查詢

技成PLC網(wǎng)校

當前位置:技成首頁 > 文章中心 > 技成百科 > wincc的vbs的按鈕代碼分析

wincc的vbs的按鈕代碼分析

鄭志武 發(fā)布于2012-12-04 22:58 5 0 標簽:

編了2個按鈕代碼:個按鈕按下去后出現(xiàn)小畫面,再按第二個按鈕,給b賦1;松開0;
個按鈕:
dimmotor_command_req
setmotor_command_req=hmiruntime.tags("motor_command_req_1")
motor_command_req.write"b"

第二個按鈕按下去:
subonlbuttondown(byvalitem,byvalflags,byvalx,byvaly)

dimmotor_command_req_1
setmotor_command_req_1=hmiruntime.tags("motor_command_req_1")

dimmotor_1
setmotor_1=hmiruntime.tags(motor_command_req_1.read)
motor_1.write1
endsub

第二個按鈕松開:
subonlbuttonup(byvalitem,byvalflags,byvalx,byvaly)

dimmotor_command_req_1
setmotor_command_req_1=hmiruntime.tags("motor_command_req_1")

dimmotor
setmotor=hmiruntime.tags(motor_command_req_1.read)
motor.write0
endsub
其中motor_command_req_1為wincc內(nèi)部變量;b是寫給plc的變量;
按下個按鈕后,再按第二個按鈕實現(xiàn)給plc變量b賦值1;松開b賦值0;
1.個按鈕的代碼起什么作用??終的目的是給plc的b變量寫值,為什么把b寫給motor_command_req_1????在我看來應(yīng)該是
setmotor_command_req_1=hmiruntime.tags("b")
motor_command_req_1.write"motor_command_req_1"
2.dimmotor_command_req_1
setmotor_command_req_1=hmiruntime.tags("motor_command_req_1")
這2行起啥作用??
dimmotor
setmotor=hmiruntime.tags(motor_command_req_1.read)
motor.write0
這3行起啥作用???

佳答案

1、實際按鈕1的代碼等同于:
hmiruntime.tags("motor_command_req_1").write"b"
2、這是定義一個腳本內(nèi)的變量連接到motor_command_req_1
3、這個腳本是有問題的,應(yīng)該是直接用
dimmotor
setmotor=hmiruntime.tags("motor_command_req_1")
motor.write0
這個是給變量motor_command_req_1賦值0
如果你懷疑我的分析你可以原來的這些代碼賦值到項目中運行一下看看。

若有收獲,就點個贊吧!

文章來源于網(wǎng)絡(luò)及文獻如有侵權(quán)請聯(lián)系站長
分享到:

微信掃一掃分享

閱讀與本文標簽相同的文章

相關(guān)推薦

最新文章 熱門文章
最新課程 免費課程
PLC資料下載 電工電氣資料下載
應(yīng)用新秀
變頻器故障代碼查詢APP
伺服故障代碼查詢APP
技成
手機APP
熱門標簽