06-20-2016 04:41 AM
Hi everyone 🙂
I'm a beginner on LabVIEW and I have to work on a project this year. My project consist in a new acquisition data. I have to end this project for the next month.
For now, every data are linked and looks good. But now I have to save them in an Excel's measure file.
For now I got several datas : Accelerometer 1 and 2, 3 resistance's measure, and 3 numeric sensor to know when it's 1 or 0.
I already posted a message one weeks ago cause I had a problem to use my 3 acquisition modules in the same time. This problem looks solved. But know I got an other one. It's probably easy but I don't find the solution -_-.
I created a VI that i'll attach to this post obviously 🙂 The VI Bilan Excel Final.
In this VI you'll see that I got 3 assistant DAQ (one for resistance, accelerometers and the last for the numeric data) and I linked them with a measure file. I created a condition (probably the source of my problem ? I don't know...
And everything is in a While Loop.
My idea was take every data each... 0,01seconds in example (the acquisition data is during 0,6s each test) and then in an Excel File I could have every data in "real time" I'll see when the system is behind a sensor or not in example. I really have to follow a sensor : like 0 or 1.
But actually, with this program, the problem is that after 10s (probably because of my DAQ assistant properties) only if I got a sensor = 1, then it will be write on an excel file but only one data is writing from the line 1 to 10 000.
I want to see a different value each line obviously if you understood my project...
So... where is my problem ? what's wrong with my loop or condition ? I hope that you understood my problem and if you have any question i'll be glad to answer them 😕 I hope that you will help me, i'm late with the project...
Thank you in advance !
Regards.
PS : sorry about my english, i'm doing my best, really ><
06-20-2016 01:47 PM
In the VI_Accel.vi where you write to file, there is an input labeled 'append to file? (F). If you want to add data to a file, then set that to TRUE.
06-21-2016 02:15 AM
Hi Randall, and thank you !
You are right, I forgot this constant. But I don't understand how it can be a consequence in my VI "Bilan Excel Final" It's 2 different VI nop ? 😕
Regards,
Maxime L.
06-21-2016 03:05 AM
XFly,
I'm not sure I fully understand your problem, but I will offer some comments and some code.
> My idea was take every data each... 0,01seconds in example (the acquisition data is during 0,6s each test)
> and then in an Excel File I could have every data in "real time" I'll see when the system is behind a sensor or
> not in example. I really have to follow a sensor : like 0 or 1.
Your DAQ Assistants are set for 10K samples at 1 KHz (0.001ms sample rate).
This explains why it takes 10 seconds to complete one loop.
(Generally, you don't want to hold up the User Interface this long, so consider that.)
The Elapsed Time vi in your program does nothing. It is set for 0.10 sec. Each time through the While loop,
it waits 0.1 sec and then outputs a true. The case (log) structure has to wait for the Dynamic Data (10 secs) to
read the timer state - which will of course still be true. Then the while loop repeats. The code would work the
same with or without the Timer.
What was the intended goal of the Timer?
I see you are using the DWDT Index Channel and DWDT Digital to Analog vis to convert your sensor data to something
you can send to an Excel file. I played with these for the first time and did not find it easy to just get 0s and 1s out of them.
Here is a snippet that might work for you. (Just save it to your PC, then drag it onto your block diagram.)
Remove the input constant and the output indicator, then place it between the DAQ Assistant3 output and the
Merge Signals node. This will save all available channels.
steve
06-21-2016 03:24 AM
Hi stevem,
Yeah, about my DAQ assistants settings (10K samples at 1KHz) it was to let me enough time to move and test with my own hand contrary to use the system everytime 🙂 But I understand that It can be a source of my problem. Maybe should I try with the real system after 🙂
About the Elapsed time, I didn't understand how it works >< I would like a column with "time" in Excel and I thought that this elapsed time could be a solution, it looks not effectivly, was a bad idea ><. I understand a little more how it works thanks to you now, thank you ^^ The goal was really catch the time and display the time in the excel file to see when I have each datas 😕 I don't know how it's possible :s
Your snippet looks a little hard to understand for me. i'll think about this and try, today and tomorrow (if I don't have more solution soon 🙂 ).
I'll try this fastly, and I'll give you some news, and ask you if something is wrong, or if I missunderstood an important point. In fact, you saving every data in an array, and then this array is put in a measure file ? This is my inderstanding with juste a first look. I'll try 🙂
Thank you again ! I'll come back very soon 🙂 And if someone got others information, obviously i'll try everything ! 🙂
Regards.
06-21-2016 04:43 AM
Try this:
Open the Write to Measurement Express vi (double click).
See the X Value (Time) Columns section?
Select the one that fits your needs (usually One Column Only)
(Right now you have the Empty time column set so it won't have a time column.)
steve
06-21-2016 04:56 AM
Randall,
I added the constant "True" in my VI named VI_Accel. Unfortunately I don't find a difference. When I run the VI_Accel, my file is still created, like before, and nothing looks different, maybe am I wrong ? Did I miss a detail ? :s
When I run my VI Bilan Excel Final, I still got the same thing too, always one value is display and paste in the file...
Maybe something was wrong with my manipulation ? I don't know...
I'll try the next solution now, I already read it, it looks hard x). Let's see ^^
If you have an other solution Randall, or complet this one, don't hesitate :3
Thanks again !
XFly
06-21-2016 05:00 AM
Thank you stevem,
I tried your way, unfortunately I only got ####### each line onto the first column :'( Maybe it's a problem with Excel and not with Labview ? The name of this column is good : Time
But I only got these #.
Maybe do you have a solution ? 🙂
Regards.
Maxime L.
06-21-2016 05:09 AM - edited 06-21-2016 05:15 AM
Excel shows the ##### when there is not enough room in the column.
Click on the vertical line betweeen columns A and B (Top Row)
Or drag the right edge of the column A header to the right.
steve
06-21-2016 06:14 AM
Thank you stevem !
It works 🙂 it was easy, i really just didn't think about this. I don't really know many things on Excel. (Yes I don't know many things at all about everything xD)
So now, at least I got time ahah ! I have to work with the others datas now... I still don't find solutions, I'll try the others interesting answers that I received about my project and hope that it will help me 🙂
Thank you again,
Maxime L.