You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old March 6th, 2012, 03:49 AM   #1
JElder
Member
Scotland

JElder is offline
 
Join Date: Apr 2011
Location: Aberdeen
Posts: 23
Fix32 v6.1 -> iFIX v5.5 VBA Problem Scripts

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


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

--------------------------------------------------------------------------------------------------------
  Reply With Quote
Old March 6th, 2012, 03:49 AM   #2
JElder
Member
Scotland

JElder is offline
 
Join Date: Apr 2011
Location: Aberdeen
Posts: 23
--------------------------------------------------------------------------------------------------------
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
  Reply With Quote
Old March 6th, 2012, 09:39 AM   #3
RussB
Lifetime Supporting Member
United States

RussB is offline
 
RussB's Avatar
 
Join Date: Oct 2003
Location: Michigan
Posts: 2,910
If you do not get an answer here, try this forum: http://forums.ge-ip.com/

Also there is quit-a-bit on migrating Fix - iFix here: http://support.ge-ip.com/
__________________
LEARN something today so you can TEACH something tomorrow.
DETAIL in your question promotes DETAIL in my answer.
Dominus Vobiscum <))>(
"Where is the wisdom that we have lost in knowledge?" T.S. Elliot


  Reply With Quote
Old March 6th, 2012, 09:41 AM   #4
JElder
Member
Scotland

JElder is offline
 
Join Date: Apr 2011
Location: Aberdeen
Posts: 23
Thank you Russ, I have created a thread on GE forums as well.

I have been sent a large document "Writing Scripts" by GE Support, so need to have a good read through that first.
  Reply With Quote
Old March 7th, 2012, 08:26 AM   #5
JElder
Member
Scotland

JElder is offline
 
Join Date: Apr 2011
Location: Aberdeen
Posts: 23
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?
  Reply With Quote
Old March 7th, 2012, 11:10 AM   #6
JElder
Member
Scotland

JElder is offline
 
Join Date: Apr 2011
Location: Aberdeen
Posts: 23
*edit*

With regard to the above ConverRT script, I followed this KB article and it seems to have solved the issue with the ConverRT commands.
  Reply With Quote
Old March 8th, 2012, 07:12 AM   #7
JElder
Member
Scotland

JElder is offline
 
Join Date: Apr 2011
Location: Aberdeen
Posts: 23
*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?
  Reply With Quote
Old March 9th, 2012, 08:31 AM   #8
JElder
Member
Scotland

JElder is offline
 
Join Date: Apr 2011
Location: Aberdeen
Posts: 23
Quote:
Originally Posted by JElder View Post
*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?
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
iFix IGS & ControlLogix rounding problem BarbaMan LIVE PLC Questions And Answers 10 April 24th, 2018 03:46 AM
Problem about Tag Browser in FactoryTalk SE View V6.1 alpine LIVE PLC Questions And Answers 4 December 27th, 2011 10:52 AM
VBA Scripts on RSView SE sephiroth LIVE PLC Questions And Answers 2 January 28th, 2009 07:07 AM
Fix32 Ver 6.X to iFix curlyandshemp LIVE PLC Questions And Answers 7 August 9th, 2007 10:29 AM
Problem setting RSLinx OPC UpdateRate with VBA SoggyFisherman LIVE PLC Questions And Answers 3 September 1st, 2005 09:31 AM


All times are GMT -5. The time now is 01:29 PM.


.