Fix32 v6.1 -> iFIX v5.5 VBA Problem Scripts

JElder

Member
Join Date
Apr 2011
Location
Aberdeen
Posts
23
Good Morning,

This is my first post and my first real exposure to GE and the Fix/iFIX environments so please bear with me.

I am currently in the process of migrating a Fix32 v6.1 system (WinNT) to iFIX v5.5 on Windows 7 32 bit / Professional.

I have converted the database (PDB) over and imported it in to iFIX.

I have changed the driver from ABR to IGS.

I have configured IGS with the IP addresses of the 2x PLC's it will be talking to.

I have converted all the graphics from the old ".odf" format to the new ".grf".

And thanks to the Migration Tool suite I have converted MOST of the VBA script associated with the pictures over to the new iFIX syntax.

However (and there always is a however), there are just a few scripts that need ironing out and I'm hoping this is where the e-Forum will help me
redface.gif



I ran through all 303 graphics to see what code was causing issues and I now have a record of it so here goes. Apologies for the length of this post.: -

--------------------------------------------------------------------------------------------------------
Shell "HTD" + " " + -CG, 1 'RUNTASK HTD -CG "Aeration Blowers"
Exit Sub
ErrorHandler:
HandleError

--------------------------------------------------------------------------------------------------------

Shell "WORDPAD" + " " + "SINGLE", 1 'RUNTASK WORDPAD SINGLE
Exit Sub
ErrorHandler:
HandleError
--------------------------------------------------------------------------------------------------------

'iFIX Global Variable Object Created 'DECLARE #TASK STRING GLOBAL
'
'User.g_varTASK.CurrentValue = ""C:\PROGRAM FILES\VERITAS SOFTWARE\BACKUP EXEC"" '#TASK = "C:\PROGRAM FILES\VERITAS SOFTWARE\BACKUP EXEC"
'
'User.g_varTASK.CurrentValue = User.g_varTASK.CurrentValue + "\SYSTEM\BESTART.EXE" 'STRCAT #TASK "\SYSTEM\BESTART.EXE"
'
Shell User.g_varTASK.CurrentValue + " " + "SINGLE", 1 'RUNTASK #TASK SINGLE
Exit Sub
ErrorHandler:
HandleError

--------------------------------------------------------------------------------------------------------

On Error GoTo ErrorHandler
'DataEntry Type = Numeric
'DataEntry OPRLO = 0.
'WizardName=DataEntry
Dim vntLow As Variant
Dim vntHigh As Variant
Dim intReturn As Integer
Dim blnFetch As Boolean
If blnDataEntryFrmFlag = True Then
Exit Sub
End If
GetFormNumeric
FetchLimits "Fix32.FIX.H3_MD00X_SBYSP_SAI.F_CV", vntHigh, vntLow, intReturn
Numeric.GetTheLimits H:=vntHigh, L:=vntLow
blnFetch = True
Numeric.IsAlpha A:=False
Numeric.GetTheVars A:=1, B:="Fix32.FIX.H3_MD00X_SBYSP_SAI.F_CV"
Numeric.Show 'DataEntry OPRHI = 0.
Exit Sub
ErrorHandler:
HandleError

--------------------------------------------------------------------------------------------------------

'NO CONVERSION CURRENTLY AVAILABLE ---> 'DataEntry Type = MenuItems
'DataEntry MenuItem1 =
'DataEntry MenuItem2 =
'DataEntry MenuItem3 =
'DataEntry MenuItem4 =
Exit Sub
ErrorHandler:
HandleError
--------------------------------------------------------------------------------------------------------
Dim varCHK As Single 'DECLARE #CHK NUMERIC
ConvertRT_CheckRights "SL DRYER SPT ENTRY", CInt(varCHK) 'CHECKRIGHTS "SL DRYER SPT ENTRY" #CHK
If varCHK = 1# Then 'IF #CHK == 1.0
AcknowledgeAllAlarms ' ALARMACKALL
Else 'ELSE
MsgBox "Login As Operator Or Above" ' NOTE "Login As Operator Or Above"
End If 'ENDIF

Exit Sub
ErrorHandler:
HandleError

--------------------------------------------------------------------------------------------------------

Private Sub BUTTON13_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Double, ByVal Y As Double)
On Error GoTo ErrorHandler

'RUN WORDPAD SINGLE
Exit Sub
ErrorHandler:
HandleError
End Sub

--------------------------------------------------------------------------------------------------------

';Script for While Down follows
';HINT: Use timer events for WhileDown functionality
'
varUP001 = 1 '#UP001 = 1
'NO CONVERSION CURRENTLY AVAILABLE ---> 'CRITICAL
Dim varSTORE As Single 'DECLARE #STORE NUMERIC SCRIPT
Dim varHIGHL As Single 'DECLARE #HIGHL NUMERIC SCRIPT
Dim varLOWL As Single 'DECLARE #LOWL NUMERIC SCRIPT
Dim varCOUNT As Single 'DECLARE #COUNT NUMERIC SCRIPT
Dim varSTEP As Single 'DECLARE #STEP NUMERIC SCRIPT
varCOUNT = 0 '#COUNT = 0
varSTORE = ReadValue("Fix32.FIX.G-MIT700-SETPOINT.F_CV") 'GETVAL FIX:G-MIT700-SETPOINT.F_CV #STORE
varHIGHL = 8# '#HIGHL = 8.00
varLOWL = 0# '#LOWL = 0.00
varSTEP = 0.01 '#STEP = 0.01
L1: '&L1
If varCOUNT < 10 Then 'IF #COUNT < 10
If varSTORE + varSTEP <= varHIGHL Then ' IF #STORE + #STEP <= #HIGHL
varSTORE = varSTORE + varSTEP ' #STORE = #STORE + #STEP
Else ' ELSE
varSTORE = varHIGHL ' #STORE = #HIGHL
End If ' ENDIF
Else 'ELSE
If varCOUNT < 19 Then ' IF #COUNT <19
If varSTORE + (varSTEP * 10) <= varHIGHL Then ' IF #STORE + (#STEP * 10) <= #HIGHL
varSTORE = varSTORE + (varSTEP * 10) ' #STORE = #STORE + (#STEP * 10)
Else ' ELSE
varSTORE = varHIGHL ' #STORE = #HIGHL
End If ' ENDIF
Else ' ELSE
If varCOUNT < 28 Then ' IF #COUNT <28
If varSTORE + (varSTEP * 100) <= varHIGHL Then ' IF #STORE + (#STEP * 100) <= #HIGHL
varSTORE = varSTORE + (varSTEP * 100) ' #STORE = #STORE + (#STEP * 100)
Else ' ELSE
varSTORE = varHIGHL ' #STORE = #HIGHL
End If ' ENDIF
Else ' ELSE
If varSTORE + (varSTEP * 1000) <= varHIGHL Then ' IF #STORE + (#STEP * 1000) <= #HIGHL
varSTORE = varSTORE + (varSTEP * 1000) ' #STORE = #STORE + (#STEP * 1000)
Else ' ELSE
varSTORE = varHIGHL ' #STORE = #HIGHL
End If ' ENDIF
End If ' ENDIF
End If ' ENDIF
End If 'ENDIF
varCOUNT = varCOUNT + 1 '#COUNT = #COUNT + 1
Call WriteValue(CStr(varSTORE), "Fix32.FIX.G-MIT700-SETPOINT.F_CV") 'SETVAL FIX:G-MIT700-SETPOINT.F_CV #STORE
'NO CONVERSION CURRENTLY AVAILABLE ---> 'ENDCRITICAL
'Goto L1 'GOTO L1
';On Down Script; DECLARE #UP001 NUMERIC PICTURE
varUP001 = 0 '#UP001 = 0
Exit Sub
ErrorHandler:
HandleError
--------------------------------------------------------------------------------------------------------
CloseDigitalPoint varNAME_S 'CLOSEDIG #NAME_S
ClosePicture "DM_YESNO"
Exit Sub
ErrorHandler:
HandleError

--------------------------------------------------------------------------------------------------------

Shell "HTD.EXE" + " " + "-cg 'CHART8'", 1 'RUNTASK HTD.EXE "-cg 'CHART8'"
Exit Sub
ErrorHandler:
HandleError

--------------------------------------------------------------------------------------------------------

ClosePicture "PC_33" 'CLOSEPIC PC-33
ClosePicture "CC_33" 'CLOSEPIC CC-33
Dim varCHK As Single 'DECLARE #CHK NUMERIC
ConvertRT_CheckRights "SL DRYER SPT ENTRY", CInt(varCHK) 'CHECKRIGHTS "SL DRYER SPT ENTRY" #CHK
If varCHK = 1# Then 'IF #CHK == 1.0
OpenPicture "CC_33" ' OPENPIC CC-33
Else 'ELSE
OpenPicture "PC_33" ' OPENPIC PC-33
End If 'ENDIF
Exit Sub
ErrorHandler:
HandleError

--------------------------------------------------------------------------------------------------------
 
--------------------------------------------------------------------------------------------------------
On Error GoTo ErrorHandler
';Script for While Down follows
';HINT: Use timer events for WhileDown functionality
'
'NO CONVERSION CURRENTLY AVAILABLE ---> 'CRITICAL
Dim varVAR1 As Single 'DECLARE #VAR1 NUMERIC SCRIPT
varVAR1 = ReadValue("Fix32.FIX.A-SETPOINT-GRIT-TIMER4.F_CV") 'GETVAL FIX:A-SETPOINT-GRIT-TIMER4.F_CV #VAR1
If varVAR1 < 10 Then 'IF #VAR1 < 10
varVAR1 = varVAR1 + 1 ' #VAR1 = #VAR1 + 1
Call WriteValue(CStr(varVAR1), "Fix32.FIX.A-SETPOINT-GRIT-TIMER4.F_CV") ' SETVAL FIX:A-SETPOINT-GRIT-TIMER4.F_CV #VAR1
End If 'ENDIF
ConvertRT_Pause 0.5 'WARNING: Please check the definition of ConvertRT_Pause in ScriptConvertRT.bas, which should be imported into Project_User, for important guidance. 'PAUSE 0.5
'NO CONVERSION CURRENTLY AVAILABLE ---> 'ENDCRITICAL
GoTo 4 'GOTO 4
Exit Sub
ErrorHandler:
HandleError

--------------------------------------------------------------------------------------------------------

Private Sub BITMAP1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Double, ByVal Y As Double)
On Error GoTo ErrorHandler
';Script for While Down follows
';HINT: Use timer events for WhileDown functionality
'
varUP000 = 1 '#UP000 = 1
'NO CONVERSION CURRENTLY AVAILABLE ---> 'CRITICAL
Dim varSTORE As Single 'DECLARE #STORE NUMERIC SCRIPT
Dim varHIGHL As Single 'DECLARE #HIGHL NUMERIC SCRIPT
Dim varLOWL As Single 'DECLARE #LOWL NUMERIC SCRIPT
Dim varCOUNT As Single 'DECLARE #COUNT NUMERIC SCRIPT
Dim varSTEP As Single 'DECLARE #STEP NUMERIC SCRIPT
varCOUNT = 0 '#COUNT = 0
varSTORE = ReadValue("Fix32.FIX.G-SOUNDER-TIME.F_CV") 'GETVAL FIX:G-SOUNDER-TIME.F_CV #STORE
varHIGHL = 30 '#HIGHL = 30
varLOWL = 0 '#LOWL = 0
varSTEP = 0.1 '#STEP = 0.1
L1: '&L1
If varCOUNT < 10 Then 'IF #COUNT < 10
If varSTORE + varSTEP <= varHIGHL Then ' IF #STORE + #STEP <= #HIGHL
varSTORE = varSTORE + varSTEP ' #STORE = #STORE + #STEP
Else ' ELSE
varSTORE = varHIGHL ' #STORE = #HIGHL
End If ' ENDIF
Else 'ELSE
If varCOUNT < 19 Then ' IF #COUNT <19
If varSTORE + (varSTEP * 10) <= varHIGHL Then ' IF #STORE + (#STEP * 10) <= #HIGHL
varSTORE = varSTORE + (varSTEP * 10) ' #STORE = #STORE + (#STEP * 10)
Else ' ELSE
varSTORE = varHIGHL ' #STORE = #HIGHL
End If ' ENDIF
Else ' ELSE
If varCOUNT < 28 Then ' IF #COUNT <28
If varSTORE + (varSTEP * 100) <= varHIGHL Then ' IF #STORE + (#STEP * 100) <= #HIGHL
varSTORE = varSTORE + (varSTEP * 100) ' #STORE = #STORE + (#STEP * 100)
Else ' ELSE
varSTORE = varHIGHL ' #STORE = #HIGHL
End If ' ENDIF
Else ' ELSE
If varSTORE + (varSTEP * 1000) <= varHIGHL Then ' IF #STORE + (#STEP * 1000) <= #HIGHL
varSTORE = varSTORE + (varSTEP * 1000) ' #STORE = #STORE + (#STEP * 1000)
Else ' ELSE
varSTORE = varHIGHL ' #STORE = #HIGHL
End If ' ENDIF
End If ' ENDIF
End If ' ENDIF
End If 'ENDIF
varCOUNT = varCOUNT + 1 '#COUNT = #COUNT + 1
Call WriteValue(CStr(varSTORE), "Fix32.FIX.G-SOUNDER-TIME.F_CV") 'SETVAL FIX:G-SOUNDER-TIME.F_CV #STORE
'NO CONVERSION CURRENTLY AVAILABLE ---> 'ENDCRITICAL
'Goto L1 'GOTO L1
';On Down Script; DECLARE #UP000 NUMERIC PICTURE
varUP000 = 0 '#UP000 = 0
Exit Sub
ErrorHandler:
HandleError
--------------------------------------------------------------------------------------------------------

Many thanks,

JElder
 
Ok, a bit more information on this matter and hopefully some progress.

Regarding this script: -

"Shell "HTD" + " " + -CG, 1 'RUNTASK HTD -CG "Aeration Blowers"
Exit Sub
ErrorHandler:
HandleError"

As Classic Historian is no longer in use, I will have to establish an alternative using Proficy Historian.

As for this one: -

"Shell "WORDPAD" + " " + "SINGLE", 1 'RUNTASK WORDPAD SINGLE
Exit Sub
ErrorHandler:
HandleError"

I can easily modify that to open Wordpad but I don't see what purpose that would serve, unless opening a log file to which data was being continually written.

Finally I believe this script is checking the user's rights:-

Dim varCHK As Single 'DECLARE #CHK NUMERIC
ConvertRT_CheckRights "SL DRYER SPT ENTRY", CInt(varCHK) 'CHECKRIGHTS "SL DRYER SPT ENTRY" #CHK
If varCHK = 1# Then 'IF #CHK == 1.0
AcknowledgeAllAlarms ' ALARMACKALL
Else 'ELSE
MsgBox "Login As Operator Or Above" ' NOTE "Login As Operator Or Above"
End If 'ENDIF

Exit Sub
ErrorHandler:
HandleError

I think the equivalent in iFIX would be: -

Public Sub SecurityGetUser()
Dim Result As Integer
Dim UserID As String
Dim GroupName As String
Dim UsreInfo As String
System.FixGetUserInfo UserID, Username, GroupName
MsgBox "Login Name; " & UserID & vbCr & "Full Name; " & UserName &vbCr & "Clearance Level; " & GroupName
End Sub

How am I doing so far?
 
*update*

I have managed to get WordPad to execute using this KB article from GE. However, whenever I click the button to execute that script, I get an error message pop up box which says "WorkSpace Application - Error Number : 0 (0)".

WordPad still opens fine and there are no errors showing up in VB.

Any ideas as to what is causing this?
 
*update*

I have managed to get WordPad to execute using this KB article from GE. However, whenever I click the button to execute that script, I get an error message pop up box which says "WorkSpace Application - Error Number : 0 (0)".

WordPad still opens fine and there are no errors showing up in VB.

Any ideas as to what is causing this?

Solved.

There was a missing "Exit Sub" statement šŸ™ƒ

All that remains now is to setup Historian but I can't seem to convert any of the old .H04 files as I'm missing the executable "HGRPexp.exe". I wish to use the Historical Pen Group Export Utility followed by the Historical Pen Group Convert Utility, however I am missing the executable "HGRPexp.exe".

Why would this be when the other Migration Tools function correctly?

How do I then configure Proficy Historian to record data as it was before in the Fix32 system?
 

Similar Topics

Good day folks, i have a question, maybe have someone the installation for LNI drivers (lonworks network interface) for fix32 i need it for an...
Replies
0
Views
1,025
We were just quoted $7000CAD to upgrade a Fix32 Ver 6.X to V7.0 then to iFix. This price seems more like the cost of the iFix package rather than...
Replies
2
Views
3,790
I am involved with a plant move from one location to another. Company A sold an old process to Company B . Company B is now discovering all the...
Replies
7
Views
7,097
Hi guys. I have a problem regarding remote node database. There is a remote node and its datbase available in PDB folder with node name as name...
Replies
0
Views
6,048
I have a a PLC-5 system that is connected to a Windows 2k PC that is running Fix32. I was called to reload the program onto the PLC-5 and I did...
Replies
3
Views
1,272
Back
Top Bottom