Archiv Werte importieren

Archiv Werte importieren

Moin,
wir sind gerade dabei per VSTA ein Markro zu programmieren, welches automatisch Werte für einen bestimmten Zeitraum in ein ausgewähltes Archiv importiert. Hierfür verwenden wir eine CSV-Datei, in der die Daten aufgelistet sind. Das Archiv speichert im Normalfall Werte bei der Umschaltung einer Triggervariable von 0 -> 1.
Für den ersten Test schaue wir uns die Anzahl der Werte im Archiv vor und nachdem Import an. Wenn ich nun zum Beispiel 3 Werte importiere:
vorher: 7
nachher: 10
Bei einem erneuten Import sind aber wieder nur 7 Werte in dem Archiv. Mir kommt es so vor, als ob die Werte nicht gespeichert werden. Anbei ein kleiner Ausschnitt aus dem Quellcode.
[VBNET] zArvValues = zArvFilterVar.ArchiveValues
MsgBox(zArvValues.Count)
If MsgBox("Wollen Sie Werte Importieren?", MsgBoxStyle.YesNo, "Test") = MsgBoxResult.Yes Then
Dim Zeile() As String = System.IO.File.ReadAllLines("...\Test.CSV")
Dim Data() As String
Dim Speicherzeit As DateTime
For i = 1 To Zeile.Length - 1
Data = Zeile(i).Split(";")
For j = 0 To Data.Length - 1 Step 4
' Neue Werte im Archiv speichern
zArvValue = zArvValues.CreateArchiveValue
zArvValue.Status = &H1000
Speicherzeit = Data(j + 1) & " " & Data(j + 2)
'Set the time when the value was entered
zArvValue.Time = Zeit.System2Zenon(Speicherzeit)
'Set the milliseconds, in addition to the time
zArvValue.TimeMilliSec = 0
'Set the desired value
zArvValue.Value = Data(j + 3) * 10
zArvValue.SetModified()
Next
Next
MsgBox(zArvValues.Count)
For i = 0 To zArvValues.Count - 1
MsgBox(Zeit.Zenon2System(zArvValues.Item(i).Time))
MsgBox(zArvValues.Item(i).Value)
Next
End If[/VBNET]
Es wäre nett wenn mir jemand einen Tipp geben kann.
Vielen Dank

This is a migrated post! Originally posted on 13.05.2015 by user and12121. 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