Please see code below----
Hey guys! My programming skills is very poor and hence which is why I need your input. Basically I am making sure that the Open Value(DSP tag) is greater than Close Value(WSP tag) and if that is not the case then throw an error message. At the moment DSP tag placeholder accepts the value even if its less than WSP. I know that this can be easily handled by a PLC but our client wants to do it virtually as they don't want us to touch there PLC program. Write is enabled so I can write into this tag. So instead of accepting the value it should instead throw an Error.
Thanks for your help.
Faisal
Private Sub Dev1StopLevel8_Click()
Dim OPENVAL As Double
Dim CLOSEVAL As Double
OPENVAL = READVALUE("Fix32.COLPSN02.COL-MTI-G-2001-DSP.F_CV")
CLOSEVAL = READVALUE("Fix32.COLPSN02.COL-MTI-G-2001-WSP.F_CV")
If OPENVAL < CLOSEVAL Then
MsgBox "error"
Else
MsgBox "GOOD"
End If
End Sub
Hey guys! My programming skills is very poor and hence which is why I need your input. Basically I am making sure that the Open Value(DSP tag) is greater than Close Value(WSP tag) and if that is not the case then throw an error message. At the moment DSP tag placeholder accepts the value even if its less than WSP. I know that this can be easily handled by a PLC but our client wants to do it virtually as they don't want us to touch there PLC program. Write is enabled so I can write into this tag. So instead of accepting the value it should instead throw an Error.
Thanks for your help.
Faisal
Private Sub Dev1StopLevel8_Click()
Dim OPENVAL As Double
Dim CLOSEVAL As Double
OPENVAL = READVALUE("Fix32.COLPSN02.COL-MTI-G-2001-DSP.F_CV")
CLOSEVAL = READVALUE("Fix32.COLPSN02.COL-MTI-G-2001-WSP.F_CV")
If OPENVAL < CLOSEVAL Then
MsgBox "error"
Else
MsgBox "GOOD"
End If
End Sub
Last edited: