Showing results 1 to 5 of 5

Thread: Archives (RT) - Read batch information

  1. #1
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    880

    Default Archives (RT) - Read batch information

    With zenOn 6.22 SP0 a new method has been implemented for read out batch infomration which are stored in the batch index file (.ari).

    The method Archive.BatchIndex returns for each batch following information in a String-Array:
    ARX-FileName;Batchname;Starttime in seconds;Endtime in seconds
    Below you can find an example how to use this method
    Option Explicit
    
    Sub GetBatches_Click()
    
    Dim obArchives As Archives
    Dim obArchive As Archive
    Dim iArchives As Integer
    
    Dim strArray
    Dim iArray As Integer
    Dim strArrayBatch
    Dim iArrayBatch As Integer
    
        Set obArchives = thisProject.Archives
        
        If obArchives.count = 0 Then
            MsgBox "No archives configured!"
            Exit Sub
        End If
        
        Debug.Print ("Count Archives: " & obArchives.count)
        
        For iArchives = 0 To obArchives.count - 1
            
            'get the single archive
            Set obArchive = obArchives.Item(iArchives)
            If obArchive Is Nothing Then
                MsgBox "Error getting archive " & obArchives.Item(iArchives)
                Exit Sub
            End If
            
            Debug.Print ("Archive: " & obArchive.Name)
            
            'get the complete batchindex
            strArray = obArchive.BatchIndex
            Debug.Print ("Count Batches: " & UBound(strArray))
            
            'split up the string array (list of batches)
            For iArray = 0 To UBound(strArray)
                'get the single batches and split it up
                strArrayBatch = Split(strArray(iArray), ";")
                'write the each single batch string to the listbox (in seperate columns)
                For iArrayBatch = 0 To UBound(strArrayBatch)
                    'structure of array:
                    '0=ARX-FileName; 1=Batchname; 2=Starttime in seconds; 3=Endtime in seconds
                    Debug.Print "-> " & strArrayBatch(iArrayBatch)
                Next iArrayBatch
            Next iArray
            Debug.Print ""
        Next iArchives
    End Sub


    In the attachment you can find a VBA Form which reads out the batch information into a Listbox (seperate columns).

    Regards,
    Herbert
    Attached Files Attached Files

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    880

    Default Re: Archives (RT) - Read batch information

    In the attachment you can find a modified version with following enhancements:
    - consider "mixed" archives (batch archives and non batch archives)
    - conversion of the UTC time (i.e startTime in seconds) into system time

    FYI: for the time conversion it is necessary to import the attached class clsTimeConvert

    Regards,
    Herbert
    Attached Files Attached Files

  3. #3
    Join Date
    06.05.2011
    Posts
    41

    Default AW: Archives (RT) - Read batch information

    Hello,

    I`ve got a problem with the BatchIndex. I have 21 *.arx files in my folder. I call the function "Archiv indizieren" and after that I open a Msgbox with all entries in the *.ari file. The problem is, that the last *.arx file is not listed in the *.ari file. There are only 20 entries in the file. Why?

    I`m also happy about german answers

  4. #4
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    880

    Default Re: Archives (RT) - Read batch information

    Are those 21 archive files all closed or did you count also the current running archive?
    -> already closed archives do have the timestamp in the filename
    -> the currently running archive does only have the short name of the archive (i.e. A1.arx)

    Please also tell us which zenon version (incl. ServicePack/BuildVersion) you are using.

    Regards,
    Herbert

  5. #5
    Join Date
    06.05.2011
    Posts
    41

    Default AW: Archives (RT) - Read batch information

    I've found another solution an now it works.
    But perhaps thre is a problem with the zenon function "Archiv indizieren". The archiv was closed an I see the 21 fils with the timestep in the project folder. So I don`t know??
    I use 6.51 SP0 Build 4.

    Thank`s for the answer.

Similar Threads

  1. Information Unlimited 16 - Sample
    By robertf in forum VBA
    Replies: 0
    Last Post: 28th November 2008, 13:34
  2. We need further information about web server on zenOn...
    By nuno_duarte in forum zenon Network
    Replies: 4
    Last Post: 18th March 2008, 18:05
  3. Read dBase does not work
    By bjoerndavid in forum zenon Supervisor
    Replies: 3
    Last Post: 26th November 2007, 13:15
  4. Condensed (following) archives
    By markclemens in forum zenon Supervisor
    Replies: 0
    Last Post: 14th September 2007, 07:30
  5. How does the batch archive gets its name?
    By bernhards in forum zenon Pharma Edition
    Replies: 0
    Last Post: 21st August 2007, 08:59

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •