Hello,
I am learning to create shapes and VB Scripts in HMIWeb Display Builder. I wanted to change color of my rounded rectangle by script. I created .vbs file in folder Scripts in C:\ProgramData\Honeywell\Experion PKS\Client\Abstract\Scripts and then I wrote a sub procedure:
Sub Element_Change_State_OnUpdate(oSource)
Dim oShape,tag1
set oShape = oSource.parentnode.parentnode
tag1 = oSource.DataValue("tagname1.cp_pv")
if tag1 = 4 then
oSource.fillColor = vbRed
Else if tag1 <> 4
oSource.fillColor = vbGreen
End if
end sub
In my shape I have one group and within two elements oval and rounded rectangle, I just call sub procedure in event OnUpdate. I am receiving an error in Station:
Line: 132
Char: 1
Error: Type mismatch: Element_Change_State_OnUpdate
Code: 0
Display: test.htm
I can't figure it out where the problem is. I was looking for an answer in my shape configuration but whatever I did, there was no desired result.
I am asking for some help in this matter, is there someone who can give me some advices what I should do? Thank you for help.
I am learning to create shapes and VB Scripts in HMIWeb Display Builder. I wanted to change color of my rounded rectangle by script. I created .vbs file in folder Scripts in C:\ProgramData\Honeywell\Experion PKS\Client\Abstract\Scripts and then I wrote a sub procedure:
Sub Element_Change_State_OnUpdate(oSource)
Dim oShape,tag1
set oShape = oSource.parentnode.parentnode
tag1 = oSource.DataValue("tagname1.cp_pv")
if tag1 = 4 then
oSource.fillColor = vbRed
Else if tag1 <> 4
oSource.fillColor = vbGreen
End if
end sub
In my shape I have one group and within two elements oval and rounded rectangle, I just call sub procedure in event OnUpdate. I am receiving an error in Station:
Line: 132
Char: 1
Error: Type mismatch: Element_Change_State_OnUpdate
Code: 0
Display: test.htm
I can't figure it out where the problem is. I was looking for an answer in my shape configuration but whatever I did, there was no desired result.
I am asking for some help in this matter, is there someone who can give me some advices what I should do? Thank you for help.