LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Someone can help me please

Hi everyone, i nid help ! Sry ,im new to labview programming. Just started learning. ^^"

 

Now my program is getting the data of the wind speed for every seconds once i pressed RUN and stop at the time once i pressed stop and save the data into a text file.

 

But i nid to modify to let the program run for 24 hours and get the data in every 1 minute. Example:start from 12.00 am , and end at 23.59 pm. And record down all the data every minute. And save it to a text files.

 

How do i set a starting time(Start at 12.00 am) , and let the program run for 24 hours, and reset it at 23.59pm. and save it into a text file in the end. 

 

Note:Im currently using a Data Acquisition System(CompactRIO) made by National Instruments for control system, installed with a anemometer to record down the wind speed. Using National instruments Labview 2011, version 11(32-bits) 

Download All
0 Kudos
Message 1 of 18
(3,611 Views)

Sry i accidently posted 2 times, my apologize, really new to here...

0 Kudos
Message 2 of 18
(3,604 Views)

very simplistic idea:

 

timetest.png

 

starting on crio, means the vi runs until you turn off power

it should aquire every minute (depending on drift, there might be corner-cases)

 

hope that helps a little.

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 3 of 18
(3,557 Views)

thank you very much. will go and try ! Appreciate it =)

0 Kudos
Message 4 of 18
(3,547 Views)

one little suggestion. please try to use a more descriptive title next time.

almost every thread is help-seeking 😉

 

good luck


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 18
(3,538 Views)

Unlike some languages, LabVIEW treats time very seriously.  Not only does it have Time and Wait functions, but the LabVIEW Data Acquisition hardware has really reliable clocks, so that if you want to sample for exactly 24 hours, it is much more efficient and precise to set the sampling rate to once per minute and then take exactly 24*60 samples (24 hours times 60 minutes/hour).

 

Here is an outline of what I would do.  Note the use of the Error Line (always recommended as a LabVIEW Best Practice, if for no other reason than to provide a sense of serial ordering of the program).

Sample starting at midnight.png

Note the first "Wait for Midnight" loop.  All it does is every 30 seconds (or 30,000 milliseconds), it "wakes up", gets the current time as a string, and sees if it is 12:00 AM.  If so, it exits the Wait loop and starts the 24-hour sample-every-minute loop.  I show writing all of the data after the loop exits, but since you have a whole minute to write out one piece of data, you might as well put it into the loop.  Note that if you need the current time, you can easily use the same Get Date/Time String function (with no input wired, it gives you the current date/time) to get the current date and time, as well.

 

Bob Schor

Message 6 of 18
(3,509 Views)

Thanks Mr bob schor, it works ! sry i just back from my holidays.

 

Now i able to start is at 00.00 hours (12:00 AM) and get every data after 1 min untill the 23:59 hours (11:59 PM) and it stop and save the data into a text file.

But i need it to run continues for the other day. Re-run the program at 00:00 hours ( 12:00 AM ) again. and stop at 11:59 PM (23:59 hours). And the program will never end. After one day, reset and run. The otherday repeat the same.

 

How could i get a reset and let the program re-run from the beginning again ? And is it possible to make it auto save to a text file and the file will named as according to the date of the day after 24 hours ? because my program now is i choose a file path manually and key in the file name manually and the data acquire every minute will save it into the file at the end of the day. I nid it save automatically after 24 hours, because i cant change the date and time everyday , nid to let it run continues to the other day.

 

im currently using 2011's labview version.

 

Could anyone gv me some tips how to do it ? Really appreaciate it !!!

 

Download All
0 Kudos
Message 7 of 18
(3,370 Views)

So you understand my earlier program?

  1. Wait until Midnight.
  2. Take exactly 1 day's worth of data and save it in a file.

Now you want to do almost the same thing.

  1. Wait until Midnight.
  2. Take exactly 1 day's worth of data and save it to a file.
  3. Repeat Step 2 until some "Stop condition" is met.

Have you ever encounter repetitions?  Does the term "loop" mean something to you?

 

Your other question involved naming the Text file, with the name reflecting the date.  Have you looked at the Time functions?  Can you figure out how to get a Date from the Time functions?  Do you know how to create a Path and how to use the Path to open a Named File?

 

If the answer to any of these questions is "No", go back and find the on-line LabVIEW Tutorials and spend a few hours learning.

 

Bob Schor

 

 

Message 8 of 18
(3,358 Views)

Ok dear bob, thx for the info. I'm read the Labview tutorials now. WIll solve the problems mentioned by you. Really appreaciate it !!

0 Kudos
Message 9 of 18
(3,343 Views)

Mr bob, may i ask u something about re-run my whole program again after 24 hours. Now im able to start it at 12.00 AM and get data every 1 min and end it at 11.59pm and im able to set a path to create a new file which named as the date of the day by using get date/time string. Could i re-run the whole program again ? 

 

I found a link in labview that teach me how to do tat, but it does not work for me.

http://digital.ni.com/public.nsf/allkb/08E7DDAE66A7D02C86256DDA00630E75

 

Everytime i finish the program, i have to press "Run" button to start it. I need the "run" button maintain "running" status all the time. Does the link alot me to do tis ? 

0 Kudos
Message 10 of 18
(3,287 Views)