发布于 2003-08-31 12:02:04
0楼
可以使用 WINCC 提供的SIMATIC DMC ActiveX 控件存取
WINCC 过程数据,简单例程如下:
Dim tagVal as Variant
Dim myState as Long
Dim myDmc as Object
' Write the WinCC tag value named "NewTag"
'tagVal is the value which will be written in WinCC
Private Sub Command1_Click()
Dmc1.Connect myDmc
Dmc1.Write "NewTag",100,tagVal
Dmc1.Disconnect
End Sub
' Read the WinCC tag value named "NewTag"
' tagVal will get the tag value from WinCC
Private Sub Command1_Click()
Dmc1.Connect myDmc
Dmc1.Read "NewTag",100,tagVal,myState
Dmc1.Disconnect
End Sub
微信公众号:PLC标准化编程,ZHO6371995