How to change? VBA code -> c# code

How to change? VBA code -> c# code

VBA Sample code
but You don't know what this is clsTimeConvert
C # How can I use?
VBA code to C # code i want to change.
Sub zenOn_ArchiveFilter()
'Declarations
Dim zArchive As Archive
Dim zArvFilter As ArchiveFilter
Dim zArvVars As ArchiveFilterVariables
Dim zTimeConvert As clsTimeConvert
Dim dTime As Double
Dim i As Integer

'Initialize zArchive with the first available archive
Set zArchive = thisProject.Archives.Item(0)

'If no archive is availabe, then ...
If zArchive Is Nothing Then
'... inform the user
MsgBox ("No archive available!")

Else
'Initialize zArvFilter by creating a new archive filter
Set zArvFilter = zArchive.ArchiveFilters.CreateArchiveFilter

'Every archive variable within the collection...
For i = 0 To zArchive.ArchiveVariables.Count - 1
'... will be added to the archive filter
zArvFilter.AddArchiveVariable zArchive.ArchiveVariables.Item(i)
Next i

'Initialize zTimeConvert by creating a new instance of the zenOn "clsTimeConvert" macro
Set zTimeConvert = New clsTimeConvert

'Set dTime by converting the desired system time into the zenOn compatible UTC time
dTime = zTimeConvert.System2zenOn(CDbl(CDate("30.07.2007 14:00:00")))
'Set the converted time as the start time for the filter
zArvFilter.StartTime = dTime

'Set dTime by converting the desired system time into the zenOn compatible UTC time
dTime = zTimeConvert.System2zenOn(CDbl(CDate("31.07.2007 11:15:00")))
'Set the converted time as the end time for the filter
zArvFilter.EndTime = dTime

'All I-BIT and HWERT bits
zArvFilter.StatusMask = &H41000 'Check only I-BIT + HWERT
zArvFilter.StatusBit = &H41000 'Return data if one of those bits are TRUE or both

'Initialize zArvVars by initiating a new filter query
Set zArvVars = zArvFilter.Query

'For every filtered variable within the result...
For i = 0 To zArvVars.Count - 1
With zArvVars.Item(i)
'... output the name of the variable ...
Debug.Print "Variable: " & .ArchiveVariable.Name
'... and the amount of I-BIT and HWERT bits within the specified time range
Debug.Print vbTab & "I-BIT + HWERT: " & .ArchiveValues.Count & vbNewLine
End With
Next i
End If
End Sub

This is a migrated post! Originally posted on 22.03.2016 by user backjahyun. Please be aware that information can be outdated.

    Disclaimer

    This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.

    The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.

    Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.

    Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.

    COPA-DATA reserves the right to change this document from time to time at own discretion.


    Ing. Punzenberger COPA-DATA GmbH
    Karolingerstraße 7b · 5020 Salzburg · Austria
    www.copadata.com