06-23-2015 07:00 AM
Whats wrong?
I would to SafeDate in CSV with a Chanellist
The Datas are all Chanels in Group Minutenwert_VZS ant the Chanel Tageszeit4 in the Group Zeiten
the Script:
'-------------------------------------------------------------------------------
'-- VBS-Script-Datei
'-- Neu erstellt am 23.06.2015 06:16:01
'-- Ersteller:
'-- Kommentar:
'-------------------------------------------------------------------------------
Option Explicit 'Erzwingt die explizite Deklaration aller Variablen in einem Script.
Dim Pfad,Datum,x,KanallisteVZ,KanallisteA4,DatumTxt
Pfad=ChnPropValGet("Zufluss VZ/[1]", "sourcedatafilepath")
Datum=ChnPropValGet("Zufluss VZ/[1]", "wf_start_time")
DatumTxt=Rtt (Datum,"#DD.MM.YYYY")
Set KanallisteVZ = Data.GetChannels("[13]/*")
Call KanallisteVZ.Add(Data.GetChannel("[12]/Tageszeit4"))
Set KanallisteA4 = Data.GetChannels("[14]/*")
Call KanallisteA4.Add(Data.GetChannel("[12]/Tageszeit4"))
msgboxdisp(Pfad)
Call DataFileSaveSel((Pfad+"\CSV_Dateien\"+"Bagflussmessung VZ vom "+DatumTxt), "CSV", KanallisteVZ)
Call DataFileSaveSel((Pfad+"\CSV_Dateien\"+"Bagflussmessung A4 vom "+DatumTxt), "CSV", KanallisteA4)
06-23-2015 09:11 AM
i have see that not all text is insert:
The Problem is it does not append the the Chanel "add " with Tageszeit
only export the Group
06-23-2015 10:56 AM
Hi Thomas,
The CSV Export only works on the channels of one group. It looks like from your code that you're not actually adding the time channel to the group, you're trying to build a virtual group with a channel collection-- I don't think the CSV DataPlugin will accept that.
One other thing you should fix, though, is to remove the leading "\" character when building the output file paths, since the "sourcedatafilepath" property always returns a trailing "\" character-- you don't need to add another one to it. I also highly recommend you use the unambiguous "&" operator for string concatenation, as opposed to the overloaded "+" operator.
Dim Pfad,Datum,x,DatumTxt,GroupZeit,GroupVZ,GroupA4,ZeitChannel Pfad=ChnPropValGet("Zufluss VZ/[1]", "sourcedatafilepath") Datum=ChnPropValGet("Zufluss VZ/[1]", "wf_start_time") DatumTxt=Rtt (Datum,"#DD.MM.YYYY") Set GroupZeit = Data.Root.ChannelGroups(12) Set GroupVZ = Data.Root.ChannelGroups(13) Set GroupA4 = Data.Root.ChannelGroups(14) Set ZeitChannel = GroupZeit.Channels("Tageszeit4") Call GroupVZ.Channels.AddChannel(ZeitChannel) Call GroupA4.Channels.AddChannel(ZeitChannel) msgboxdisp(Pfad) Call DataFileSaveSel(Pfad & "CSV_Dateien\" & "Bagflussmessung VZ vom " & DatumTxt, "CSV", GroupVZ.Channels) Call DataFileSaveSel(Pfad & "CSV_Dateien\" & "Bagflussmessung A4 vom " & DatumTxt, "CSV", GroupA4.Channels)
Brad Turpin
DIAdem Product Support Engineer
National Instruments