Dim objIOField As HMIIOField
Set objIOField = Application.DefaultHMIObjects("HMIIOField")
objIOField.BorderColor = RGB(255, 255, 0)
Set objVariableTrigger =
objIOField.value .CreateDynamic(hmiDynamicCreationTypeVariableDirect, "'NewDynamic1'")
'
'To complete dynamic, e.g. def:
With objVariableTrigger
.CycleType = hmiVariableCycleType_2s
End With
objIOField.value .CreateDynamic这句肯定不对,其它也许也不对。应该怎么弄,高手快来救火。
最佳答案
Dim objIOField As HMIIOField
Dim objVariableTrigger As HMIVariableTrigger
Set objIOField = ThisDocument.HMIObjects("IOField1") ''IO域对象名称
objIOField.BorderColor = RGB(255, 255, 0)
Set objVariableTrigger = objIOField.OutputValue.CreateDynamic(hmiDynamicCreationTypeVariableDirect, “TagName”) ''IO域对象联接的WinCC 变量名
objVariableTrigger.CycleType = hmiVariableCycleTypeOnChange ''用变量一旦改变触发器
提问者对于答案的评价:
谢谢解答,已经好了,参考的是您以前写的。http://www.ad.siemens.com.cn/club/bbs/post.aspx?a_id=1238393&b_id=5&s_id=0&num=10#anch
原创文章,作者:ximenziask,如若转载,请注明出处:https://www.zhaoplc.com/plc359971.html