LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arrays und Excel

Hallo,

ich benutze u.a. ein 2-D Array, über welches ich Messwerte von meinen 1 bis 8 Kanälen in eine Tabelle bzw. Excel-Tabelle auslese. Wenn ich nun beispielsweise nur an einem Kanal messe, dann bekomme ich an den anderen sieben Kanälen INF, NaN oder Null angezeigt, obwohl ich von "vorne" gar keine Daten mehr schicke. Also wenn ich acht Anschlüsse am Block "Array erstellen" habe, dann kommt hinten auch ein ensprechend großes angehängtes Array hinaus, selbst wenn keine Daten kommen?
Was kann ich da machen?
Vielen Dank schon mal.

Gruß, Tosi
0 Kudos
Message 1 of 12
(4,202 Views)
I can probably help if this can be translated to English.
0 Kudos
Message 2 of 12
(4,192 Views)
Please attach your program, or a picture of your code.
0 Kudos
Message 3 of 12
(4,184 Views)
I will try it - hope it works.
0 Kudos
Message 4 of 12
(4,170 Views)
I only have 7.0 right now. If you respost it in this version I will take a look.
0 Kudos
Message 5 of 12
(4,150 Views)
0 Kudos
Message 6 of 12
(4,146 Views)
I saw what you were trying to do. I have attached some files for you on how I do it. test.vi is the main example program for you.

Basically I modified the Insert Into table.vi that ships with the report generation. It is a polymorphic .vi (included) that accepts any type of 2d data. To insert a 1D array, just use another polymorphic .vi (included) to convert the 1D to 2D for this purpose. To insert a single element; build the single element into a 1D array and then convert to a 2D array using the .vi. This is all shown in the example. I know this sounds a bit convoluted; but I had problems with this in the past which is why I developed this solution. Hope it helps!
0 Kudos
Message 7 of 12
(4,133 Views)
I cannot test all your DAQ stuff, because I don't have drivers installed. We need to narrow down the problem to what really matters.

The problem must be how you generate your DBL array as a function of the number of signals. All the excel stuff works just fine as a function of how many cells are filled in the table. (see attached extract, LabVIEW 7.1)

Some troubleshooting suggestions:
Create an indicator at the DBL array right before you make the table. Run the program with various channel counts and after each run, click on that indicator and select "create constant". Give the constant an unique name, then place it on the attached VI. Collect a few of those, then post the VI.

It seems to me that as a quick&dirty fix you could just trim the array to the correct size.

(Also notice that you can eliminate one of your transpose operations. Remove both, then insert one right before the table indicator.)
0 Kudos
Message 8 of 12
(4,130 Views)
I'm not sure, if you understand what I mean. My Problem is not to read the data out in Excel - this works fine. I made an exampleVI (with two "chanels") to show my Problem. When I read out both "chanels" in the Table (in my application in the Excelsheet) it's okay. If I deactivate one with the relais(in the example), in the second collum is Inf or NaN or something. Is there a Solution without "say to the array: hey, there are x channels!" ;-)) sorry for my english.
0 Kudos
Message 9 of 12
(4,117 Views)
I am sorry if I do not understand you exactly. However, if you build a 2D array out of all of the channels that you do have (using empty arrays for the ones you do not have) and then write to the table in Excel, this should work without NaN or Inf data appearing. Otherwise, build the 2D array as prescribed and then write a sub-vi to remove the unneccessary parts. Then write this to excel.
0 Kudos
Message 10 of 12
(3,914 Views)