iFix 3.5 Historian H24 files to CSV

asterof

Member
Join Date
May 2007
Location
Califonia
Posts
554
Any one know of a way to take the historian files created
by iFix 3.5 and parse and export those to a csv file
Appreciate it
 
I spent a little time trying to reverse engineer them, but gave up as I hadn't controlled the data collection to understand what values were in each files but it seemed doable.

In the end, I decided to just create an iFix trend page and download a bit of code from GE's website to export to CSV. The results weren't what I intended so I modified it a bit and got this:

Private Sub CommandButton26_Click()
'Dim objDumpStuff As clsPenData, br
'Dim objAllPensInfo As Object
Dim lNumPts As Long
Dim vVal As Variant
Dim vDate As Variant
Dim vQual As Variant
Dim DatafromPens As Variant
Dim ColCnt As Integer
Dim cnt As Integer
Dim TagNames As Collection
Dim TagDescription As Collection
Dim Pen As Object
Dim Results() As Variant


' Export file name
Dim filetemp As String
Dim FileName As String

filetemp = CStr(Now)
' 21/07/2017 21:00:23 = filename
filetemp = Replace(filetemp, "/", "_", 1, -1, vbTextCompare)
filetemp = Replace(filetemp, ":", "_", 1, -1, vbTextCompare)
FileName = System.FixPath(App_Path) + "\" + filetemp + ".csv"

' can't do a new in VBA, so this property is a proxy to a new object
'Set objDumpStuff = objPenDataClass
' get all pens info
'Set objAllPensInfo = objDumpStuff.GetPensInfo(Chart1)


' export the information to the Dynamics\App directory "\ChartOutput.CSV"
'objDumpStuff.ExportPensInfoToCSV objAllPensInfo, filename, True

ColCount = 1 ' reset the count

For Each Pen In Chart1.Pens ' for each pen

DatafromPens = Pen.GetPenDataArray(lNumPts, vVal, vDate, vQual)
' Only need to redimension the matrix once.
If ColCount = 1 Then
ReDim Results(lNumPts + 2, Chart1.Pens.Count)
End If
For cnt = 0 To lNumPts - 1
Results(cnt + 2, ColCount) = vVal(cnt)
Next cnt
Results(0, ColCount) = Pen.Source
Results(1, ColCount) = Pen.PenDescription
ColCount = ColCount + 1 ' increment counter.

Next Pen
' set the date and time
For cnt = 0 To lNumPts - 1
Results(cnt + 2, 0) = vDate(cnt)
Next cnt
' set the header
Results(0, 0) = "Date"
Results(1, 0) = "Time"
' At this stage we have all we need in a Result Matrix. Now we need to put it in a file.
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(FileName, True)

For cnt = 0 To UBound(Results, 1) ' lines
For ColCount = 0 To UBound(Results, 2) ' columns
a.Write (Results(cnt, ColCount))
a.Write (";")

Next ColCount
a.WriteLine

Next cnt
a.Close
MsgBox "Files Exported to " + FileName, vbInformation, "Pen Export"


End Sub
 
IFix Historian comes with an add-in instruction for Excel. Open a blank copy of Excel and if it was installed when IFix was installed it will be under the add in tab. If the add in is not there, you will need to install it from the installation disc. Use this add-in to get data out of Historian.
 
IFix Historian comes with an add-in instruction for Excel. Open a blank copy of Excel and if it was installed when IFix was installed it will be under the add in tab. If the add in is not there, you will need to install it from the installation disc. Use this add-in to get data out of Historian.

Sadly I have classic Historian which does not support Excel... or money to get an Excel license either.
 
IFix Historian comes with an add-in instruction for Excel. Open a blank copy of Excel and if it was installed when IFix was installed it will be under the add in tab. If the add in is not there, you will need to install it from the installation disc. Use this add-in to get data out of Historian.

This is 3.5 builtin historian
no excel installed
 

Similar Topics

Has anyone successfully migrated an older Proficy/ iFix Historian database into a new FactoryTalk Historian server? Trying to eliminate having two...
Replies
5
Views
1,089
Has anyone ever heard of migrating data from an iFix Historian into a FactoryTalk Historian? I am betting the easiest thing to do is to just keep...
Replies
5
Views
1,440
In the past, we were using old Intellution Fix and we allowed the user to backup historical data by just copying the HTRDATA folder to a disk with...
Replies
0
Views
2,341
Hi, Using 1 Digital Register Tag I can read 16 digital tags from PLC in iFix SCADA. My doubt is can I store this 16 Digital tags in iHistorian or...
Replies
0
Views
2,565
Hello all, I am trying to establish the connection with iFix and iHistorian, I can retrive all my data from iFix to iHistorian, but I am not...
Replies
1
Views
31,787
Back
Top Bottom