07-24-2011 12:46 PM
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.
Solved! Go to Solution.
07-24-2011 01:52 PM
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
07-24-2011 01:59 PM
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?
07-24-2011 02:35 PM
07-24-2011 04:21 PM
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.
07-24-2011 04:37 PM
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.
07-25-2011 01:41 AM
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.
07-25-2011 03:31 AM
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
07-25-2011 03:42 AM
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:
07-27-2011 02:09 AM
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?