From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-12-2016 09:35 AM
Hallo zusammen,
ich versuche gerade ein Excel DataPlugin zu schreiben das eine Excel Datei einliest bei dem die Kanaldaten zeilenweise und nicht wie sonst meist üblich spaltenweise abgelegt wurden.
Gbt es einen Methode die GetCellBlock entsprich, di daten aber zeilenweise einliest damit ich die Daten folgendermassen einlesen kann?
For i = oCurrSheet.MinPosition.Row to oCurrSheet.MaxPosition.Row Name = oCurrSheet.GetCellValue(i,1) Unit = oCurrSheet.GetCellValue(i,2) Set oNewChannel = oCellBlock.Channels.Add(Name) Set DAChannel = oChnGroup.Channels.AddDirectAccessChannel(oNewChannel) Call DAChannel.Properties.Add("unit_string",Unit) Next
Die Exceltabelle sieht folgendermassen aus:
Grüsse,
Elmar
02-15-2016 03:40 AM
Hallo Elmar,
solch eine Funktion gibt es meines Wissens nach nicht.
Aber kann die Tabelle nicht einfach vor dem Import transponiert werden?
Transponieren (Vertauschen) von Daten aus Spalten in Zeilen oder umgekehrt
Ich hoffe das hilft dir.
Grüße
Tenshinhan
02-15-2016 11:48 AM
Hi Elmar,
How long are these horizontal channels? The only option you have with DIAdem 2015 and earlier is to create an empty channel and assign the channel values one at a time in a VBScript loop in the DataPlugin. If there aren't too many values in each channel, this will proceed quickly-- the spreadsheet ready already loads all cell values from the whole workbook into RAM when the DataPlugin starts.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
02-18-2016 06:42 AM
Hi Brad,
these files have 300-600 channels (Rows) with with thousands of measurement points (normally not more than about 30,000). I think this is to much to read it cell by cell in a loop.
I think I'll try to transpose the files by a matlab script, as suggested by Tenshinhan before we copy it to the DataFinder server.
Best regards,
Elmar
02-18-2016 01:51 PM
Hi Elmar,
I agree. That would indeed load very slowly.
Brad Turpin
DIAdem Product Support Engineer
National Instruments