iFix Number Comparison

mehsham

Member
Join Date
Sep 2016
Location
Toronto
Posts
11
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
 
Last edited:
Here is something else I tried but problem is the .F_CV value gets updated. Your help is greatly appreciated.

Dim Setp_err As Boolean
Setp_err = False

If (readvalue("Fix32.COLPSN02.COL-MTI-G-2001-WSP.F_CV", 0) <> "---") Then
If readvalue("Fix32.COLPSN02.COL-MTI-G-2001-DSP.F_CV") < readvalue("Fix32.COLPSN02.COL-MTI-G-2001-WSP.F_CV") Then
MsgBox "Invalid Entry! Open Gate value should be greater than Close Gate Value", vbExclamation
Setp_err = True
End If
End If

'If Setp_err = False Then 'If Open Value is greater than Close Value then update filed with current Value
'Dim HighEGU As String
' HighEGU = readvalue("Fix32.COLPSN02.COL-MTI-G-2001-DSP.A_EHI")
'WRITEVALUE HighEGU, "Fix32.COLPSN02.COL-MTI-G-2001-DSP.F_CV", 2
'End If
 

Similar Topics

Dear all, I am beginer in ifix hmi programming. I have 2 ifix 6.0 pc with license FiX and client.. Can some one tell me how to configure sample...
Replies
0
Views
146
Hello, I have to deal with iFix again and am looking at the most efficient way to create alarms to display in iFix, i.e. not creating an...
Replies
0
Views
155
Hi everyone. I'm beginner with Ifix. I'm appreciate if you share me some document to understand how to play with Ifix 6.0. By the way, I have some...
Replies
11
Views
707
Hi everyone. Ifix scada is new for me. Please help help me to clarify is it possible to open Ifix scada runtime on dual monitor and how to do? Thanks
Replies
1
Views
440
Hi team! I'm starting some iFIX application migrations and some of them are being developed with the high performance library. Some objects that...
Replies
4
Views
811
Back
Top Bottom