LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Specific data arrangement in the saved file

Solved!
Go to solution

Hello I got a problem with arranging data in the way I want. I cannot save each type of data in a row. It appears in a column.

 

The things I want to have in the file are; for example,

 

Date/Time

 

[ time           Flow1       Pressure1      Flow2      Pressure3     Flow3    Pressure2

 

12:34:05        4                  5              6                 7               12           14

12:34:06       5                   6             1                   2               5            10

                                               :

                                               :                                                                   ]

 

I also want to limit the user to have only 1 unit for Flow and Pressure for each measurement period till the stop button is pressed and be able to change the unit for the next measurement.

 

Sorry for asking you for a lot of tasks, but hopefully you could help

 

thank you

0 Kudos
Message 1 of 36
(2,783 Views)

This is what I have got. I can't have only one data/time on the top. It comes with every set of data. I also don't know how to arrange data to be in the same lines as the headers.

 

 

0 Kudos
Message 2 of 36
(2,770 Views)

My suggestion is to create some dummy data and debug your VI.

 

Comment out the wavegraph graphing during this process.

 

 

 

 

0 Kudos
Message 3 of 36
(2,767 Views)

Sorry I don't understand what you meant by debugging? I am pretty new to this software. Which function should I use to make the data look like what I want?

0 Kudos
Message 4 of 36
(2,763 Views)

I mean that you have too much going on your VI.

Create a copy and remove everything and just have the file writing part of it.

 

LabVIEW is like any other software. If what you write doesn't work, then you have to simplify it so you understand what you just wrote.

 

When I run your VI and remove the extraneous stuff, the file that is created has text that is row by row. So I don't understand what makes you think it isn't working.

 

 

 

0 Kudos
Message 5 of 36
(2,751 Views)

Do one thing.

Open excel or notepad and create a  report file manually. This file should reflect what exactly should be the format of file you are expecting.

then post it in the thread. it will help us to understand what you want to do, and then i can give you some sample code.

 

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 6 of 36
(2,742 Views)

Here we go.  I attached the notepad file read from my programming file. It doesn't look even closely to what I really want. I really can't figure it out. Could you please give me a code to be able to get the result which I want.

 

In my vi, the problem is only the last loop (saving loop) in order to save in the right format. The loops before this loop (on the left) are just sendind data to the saving loop. Could you please tell me the block functions I should use to get what I want above or give me a simple code or fix my vi?

 

There should be only one Date/time and one unit each measurement or loop like;

 

[  Date/Time                      Flow                   Pressure

 24.03.2012 / 12:25            l/min                     bar             ]

 

time (m/sec)              flow1            flow2           flow3            pressure1            pressure2          pressure3

12:25:35                     3                 3                  2                    4                        5                         6

12:25:36                     8                 2                  1                    6                        10                        4

                                                                                  :

                                                                                  :

 

I don't really know how to do this. I would appreciate if you help. Thank you so much.

 

                                        

 

Download All
0 Kudos
Message 7 of 36
(2,739 Views)

As I wrote before, your original VI works for me in that the rows of data are written one row at a time, so I don't understand what is the problem you are having.

 

 

0 Kudos
Message 8 of 36
(2,735 Views)

As you can see in the saved file, Date/time comes with every row of data. I want it to begin with

 

date/time     Flow      Pressure

.....              (unit)       (unit)                  --------}  only shown one time. not every row

 

then start with

 

time          flow1       flow2       flow3      pressure1       pressure2      pressure3

---             (value)     (value)     (value)     (value)           (value)            (value)

 

 

till I press "stop"

 

then begin with

 

date/time      Flow        Pressure 

...........         (unit)        (unit)

 

then

 

data...

 

Hope you understand. Thank you so much for helps. I am really struggling now

 

 

0 Kudos
Message 9 of 36
(2,729 Views)

Since the text from the file is being read in one row at a time, but you apparently want to create three rows of data from that one row then you need to re-arrange the text to create three lines of text that can be written to a file.

Usually it is best to do this type of processing after you stop your loop.

 

 

0 Kudos
Message 10 of 36
(2,727 Views)