05-23-2016 10:07 AM - edited 05-23-2016 10:10 AM
Bon jour, ML.
Thank you for including BB. Now I think I can understand the nature of your questions and problems.
However, first I need to ask if you tried to run my Demo "as is", and if it seemed to produce a BS Demo.xlsx file for you, with three separate "Excel Tables" and a Graph. If it did, then you definitely have the RGT, and we can concentrate on making the RGT work for you.
This Demo does a lot of things, and that might have been what confused you. I wrote it to show that you could use the RGT to put multiple Excel tables on a WorkSheet, along with a Graph, and could organize the Worksheet as you wanted.
It might be best to "simplify" this Demo. Start with Block 3 -- this organizes the data to be placed (all at once) into an Excel Worksheet (in the Demo Output, this is the Time/Temp1/Temp2/Temp3 table with multiple rows of data). For now, let's ignore (and delete) the code for Date/Time/Operator and Test/Humidity/Pressure (they are just distractions for "getting started"). Make a copy of the Demo, delete the code involving Operator, Test, Humidity, and Pressure (near Steps 1 and 2), and also delete the code for Steps 7, 8, 9, and 10. In Step 11, you will need to connect the Report Object Wire coming out of New Report (Step 6), and can leave unwired the Start input for Excel Easy Table (Step 11), as we'll use the Default "Upper Left Corner", (0, 0). Also get rid of the Graph, Step 12.
Now run this simplified Demo. It should produced an Excel file with 41 rows (Header + 40 data rows) of Time and Temperature readings. Right?
OK, so where to put this in your own code? Well, you know your code better than I. Somewhere you are producing data (Temps, Vitesse, Top DAB, Accelerometre 1, etc). How are they organized? Are they a 2D Array of "something"? Note that you do not necessarily need to convert Dbls to Strings (as I did) -- Excel Easy Table will be happy to accept Dbl data.
Can I make a suggestion? Once you get the Simplified Demo described above to work, create a Control on the Front Panel and populate it with a dozen or so "example" values of Temps, Vitesse, Top DAB, etc. I don't know how you have organized your code (I didn't look at all of your VIs) -- two possibilities (but there may be more!) is as a 2D array whose rows are the individual readings and whose columns are (respectively) Temps, Vitesse, Top DAB, etc. Alternatively, you might have made a "Result Cluster" with elements Temps, Vitesse, Top DAB, etc., and collected your results as a 1D Array of this Result Cluster.
Either way, put a "Results" Control on the Front Panel and put some numbers or other values in it (you only need to do 2-3 rows, this is just a Demo). Once you've filled in the Array with sample values, go to the Edit menu, do Select All, and click "Make Current Values Default" (this lets you save the VI without losing your sample values). Replace Steps 3 and 4 with a loop that opens Results and creates a 2D Array (of strings or Dbls, your choice). Be sure to change the input to Step 11 to the Header you used inside your Project (with the labels Temps, Vitesse, Top DAB, etc.).
Run this new revised Demo. Does it give you what you want? [It should ...]
Now you have a working sub-VI that takes an array of Results (however you organized the Results Control on this Demo) and writes it to Excel (as BS Demo.xlsx). Add one more Control to pass in the File Name you really want to use, and you are finished. [Note that you can pass in the Filename as a full Path variable, allowing you to skip Step 13.]
Bon chance. Let me know if you hit any snags.
Bob Schor
P.S. -- I think I didn't see your post where you attached updated code, but my comments still (probably) apply -- they just make you do a little more of the work, but that's also a Good Thing, because you know your code much better than I do.
BS
05-24-2016 01:59 AM
Hi Bob_Schor 🙂
Yes I ran your demo "as is" and I saw the BS Demo graph, etc. So it looks ok for this. In my last post you could see that I changed column names, operator, etc. So I tried to understand by myself how does it works and which consequences could I see If I change something.
Yes It's really a lot of thing but it is exactly what I need ! 🙂
The Date, Operator, everything can be useful for me I just tried to delete the pressure, temperature and humiditycause I don't need it but as you can see in my last post, I didn't find how x)
I invite you to see my last post if you still didn't run it 🙂 Maybe that it can be useful I don't know ahah ^^
But indeed, this way looks like the best way for me to solve my "quest". in example I would like a graph beetween the column 4 and 5. I found how could I had column (I did 15 column and I gave them a name).
About my code : Time is just... time 😄 so the test on my system is during 0,6s, and the acquisition is running when the system go ahead the sensor top DAB. The vitesse (speed) is just a VI which calculate this data still thanks to sensor so it is just a numeric data which is on a VI. It is the same with the accelerometer (a strenght gives with 2 others sensors -> VI mesures accelerometre) About DAB 1/2/3, it is just a resistance measure (Still give in a VI). So as you understand, And as I tried, my bigger problem was to link the out of a data to catch the information.
For the next... I read all your message obviously. I didn't understand everything for now... So I will work in this way and try to do everything 🙂 If I got some problem or missunderstanding I'll come back here (again I know, i'm sorry ^^) I'll do it step by step and give you details of my progress 🙂
Thank you a lot again ! You really are giving to me lot's of advice. I really appreciate a lot !
You probably have to be patient cause I talk a lot and probably with lot's of mistake in my english 😄
Anyway, i'll start to work 🙂
Regards,
Maxime
05-24-2016 02:58 AM
Hi Bob 🙂
Well I tried to do something according to your advice. I deleted every part which were useless for now. And I chose to create an arraw links with a dozen of numeric data as you suggested. But now I got a problem to convert this data and put them in the part number 3 to see what are the consequences in the excel file.
I join a copy in this message to show you what I ever did. Maybe could you explain what have I to do for the next step ? :s I give you only the Excel Demo. I didn't use my others data for now, as you said i have to understand basics things before 🙂
I hope that I didn't make mistakes already. If I did try to explain me what's wrong please :3
Thank you !
Maxime
05-24-2016 04:18 AM
Ok !!
Well it works 🙂 I got something 🙂 but I really didn't use cluster finally, I just build an array and linked with build array (third step 🙂 )
So now I have to work with my really input 😉
It gonna be an hard part too probably but now it's my job, as you said, I know probably much better my code (I hope anyway ahahah !! ) I'll show you what I did if you want 🙂 Maybe have I something wrong and it was just luck ... but I followed what you say so I don't think so 🙂
If this part is resolve, maybe could you give me details now about the data that I deleted to do this example ? The famous operator/date/ etc. It can be very useful and it's always more estetic 🙂
05-24-2016 06:35 AM
If I want to do a graph only beetween the column 4 and 5. What have I to do ? 🙂
It will be my next problem in my opinion 🙂
05-24-2016 09:13 AM
Congratulations on your progress -- you did it by yourself, so I hope you have a better "feel" for how this works. At least you know how to take a set of data and write it in an organized way to an Excel Worksheet.
Now, as I understand it, you want to write a few other "sets of data" to the same Excel Worksheet. You'll basically do the same thing that you did already. Let me step back a bit and summarize (in words) what you've already done:
Now you want to do Step 2 several times, with different Data, and possibly with different kinds of output (Tables and Excel Graphs). Recall that we have the Excel Report Object linking Steps 1, 2, and 3 in sequence -- if we want to add more data to the Report by repeating Step 2, we just need to duplicate those functions (with the appropriate Input data and Headers) and tell Excel where to put the Table, either in "absolute" terms (such as "Top row, 4th column") or "relative" terms ("two rows below the end of the previous Table). To do this, we need to wire something into the Start input. This is a Cluster of Row and Column offset, with 0, 0 being the upper left corner, which Excel calls A1. Now, think about the Excel naming Scheme -- A is the first letter, and 1 is the first number, so we immediately have the "offset 0 vs offset 1" issue. Also, note that A is the column address, so where LabVIEW uses row, column (zero offset), Excel uses column, row (1 offset). Fortunately, there are a pair of functions under Excel Specific/Excel Advanced that handle conversion between LabVIEW and "A1" addressing (in case you look at your Worksheet and say "I want to start this in Cell BA24").
Excel Easy Table not only has a Start input, it has two "End" outputs, one that lets you put the next chunk of data below what you just wrote (so it uses the same column, but increments the row) or to the right (uses the same starting row, but the next free column). If you go back to my original Demo, you'll see some code where I use this "End" data, maybe manipulating Row or Column to get extra space.
Graphs work the same way as far as placement goes.
With these hints and my old demo, I'm confident that you'll be able to do most of this yourself. However, if you get stuck, come back and ask a question (please provide enough data, possibly your evolving VI, to understand the problem).
Bob Schor
05-24-2016 09:52 AM
Thank you again for this answer : )
I progressed a little and tried to put several data in my array but without success. I meet a problem with an old VI and I hope that I will fix it tomorrow. it's just harder than I thought cause I got condition on my VIs to run them and then the datas didn't work as I wish for this excel file. I have to work in this.
Anyway I will do everything you told me in your last message 🙂 I still can try with example as I did in early. I think that the problem with my VI is my problem and I don't want to disturb you with that 🙂 Except If I really don't find a solution and that I think that's a problem which can be understand by you 🙂
I'll do it tomorrow only I don't have enough time before.
Obviously, I will still post my program with the most details ! 🙂 don't worry about this 🙂
Thank you again,
Regards,
Maxime.
05-25-2016 03:55 AM
Hi Bob 🙂
I didn't try what you told me in your last message, i'm still trying to fix my problem before 🙂
Well I tried to link VI and sub VI in the array to catch data and put them in the excel file. But I meet a problem. This data aren't right. In my opinion, the mainly problem is that I don't have way to run the VI when I want... Let me explain.
In my project, every VI are run thanks to a condition (mainly because of sensor).
And according to my last tests. When I link my others VIs (accelerometer, speed, ...) in the excel VI, it's wrong. I don't know if it's just that i can't use this kind of VI ? Or If I have to add a condition in the excel Vi to success this test.
I hope that you understand my problem... I will not doing next step if I didn't solve this problem for now. I don't want to do several things in the same time 😕
I join my projec tif you could check is something looks totaly strange or just wrong.
Thank you in advance.
Maxime
05-25-2016 04:05 AM
I would like to observe with this excel file, the test in real time not just the end. In exemple the speed. During the test, she isn't the same at the beginning and at the end, so I would like to see thanks to excel, these values.
It is the same thing for the accelerometer in example.
05-25-2016 04:10 AM
Ah yes and I got a last thing which is strange !
Why have I these strange unity in the excel table ?
I always got at least 6 number, sometimes 9 or 10 and according to me if I got in excel 1 000 000 it looks like just 1.
It is the same for all my values :s
Do you have an explanation ? 😕
Thank you in advance 🙂
ML