LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a file with labview

Solved!
Go to solution

Suppose I have four numeric controls. Whenever a button is pressed, the values from the controls are being displayed on the numeric indicators and along with that a file is created where there is a heading of say:  DATE  TIME  A  B  C  D and below the individual columns there will be system date, system time and the four values.  Only the first time the file will be created, after that whenever the button will be pressed, the data will be logged into that file only under the respective columns. How to do this? I am using LabVIEW 8.5.

0 Kudos
Message 1 of 15
(3,984 Views)

This is pretty elementary.  What have you tried?  Are you new to LabVIEW?  If so, have you worked through the on-line tutorials.  That is the best place to start.

 

Is this a school assignment?

 

You will be looking at a while loop, a case structure or an event structure or both, a shift register, some number to string formatting functions, and a write to file function.

 

Lynn

0 Kudos
Message 2 of 15
(3,978 Views)

Ya I have just started working with labview. I have already used spreadsheet file option. But I am getting all binary values. Can you please give me some link where I can get a suitable example?

0 Kudos
Message 3 of 15
(3,976 Views)

hw2.png

Richard






Message 4 of 15
(3,967 Views)

I have written a small program with three controls and three indicators. Whenever the run_test button is pressed, the data in the controls get displayed in the indicators and the data is also imported to the file. Here in the obtained lvm file I am getting the loop time in the first column whereas I want the system time to be displayed in the 1st column and I want a specific header name for each column. I am attaching the program, the screenshot of the obtained lvm file and the desired text file that I want.

 

 

Please have a look at the attached files. And please guide me to get me the desired lvm file.

Download All
0 Kudos
Message 5 of 15
(3,945 Views)

This is pretty basic.  I would advise doing the research.  There are plenty of examples and tutorials on NIs website as well as within LabView.  I don't believe you have exhausted all resourses, if any.  I use the discussion forum only as a last resort, because I have found that through research, I end up learning much more than just the question I started with.  Research and discovering solutions is part of the fun. But that's just me.Smiley Wink

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 6 of 15
(3,939 Views)

I totally agree with MoReese.

 

I give you a couple of hints:

 

- You should disable view as Icon for the Controls/Indicators as it makes a much sleeker appearance

- You should look into the "Write to spreadsheet file", "Write to text file" or the report generation Tools. Depending on how sofisticated your Output should be.



Remember Cunningham's Law
0 Kudos
Message 7 of 15
(3,907 Views)

I have tried finding examples where there will be date and time stamp but have not find one. The program was written in haste, hence didnt disable the icons. Generally whenever I write a program I disable the icons. If you have know any suitable example then please send me the link.

 

Regards

0 Kudos
Message 8 of 15
(3,896 Views)

You can generally disable icon via:

Tools >> Options >> Block Diagram >> General >> Place front panel terminals as icons

(it's the first one)

 

I honestly think you should look into the problem by yourself as it helps you further than me supplying a working vi. As I already said there are several methods of doing this, It always depends on what you want to do and how sophisticated your output file should be (or sometimes: appear).

 

As for an example:

 



Remember Cunningham's Law
0 Kudos
Message 9 of 15
(3,891 Views)

Hello Jak888, thanks for your reply. I was unable to see the attached VI as I am using Labview 9. Anyways I have tried to merge the date and time signals  from get date/time strings and then converting it into number. But they are not coming. Say, the date is 27th july, 2011 and the time is 12:12pm, it is coming as 7.0000 and 2.0000. Can you please help me in getting this?

0 Kudos
Message 10 of 15
(3,844 Views)