LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write a binary file per day // show the samples only 1 in 1 minute

Solved!
Go to solution

I forgot this:

 

To learn more about LabVIEW, I suggest you try looking at some of these tutorials.

Message 11 of 59
(1,847 Views)

Thanks Ray.R

 

The sample is 3600 per second... and if I understand right, you said to write a file, and in the next day start in the same file from where it stoped? I really appreciate your help and what you wrote, but I didn't understand very well.

 

If you have some free time at night, I would appreciate if you can do an example showing me how to do this! But if you can't, don't worry I know you guys do it without any profit... so I only have to say Thanks for the help you are giving to me!

 

My program is working fine for what i want to do... I only need to put a code to write a binary file with the values for the day, and I need to know how can i show to the Client the values only in a period of time... like i will show the values from each minute.. so i know i have to integrate those samples of 60sec and send only one data with the average value. Am I right on that?

 

Thanks

 

Edit: and yes, for sure in my free time i'm studying labview in some tutorials and some manuals i downloaded from internet! =D

Message Edited by EduU on 09-14-2009 11:49 AM
0 Kudos
Message 12 of 59
(1,846 Views)

EduU wrote:

Thanks Ray.R

 

The sample is 3600 per second... and if I understand right, you said to write a file, and in the next day start in the same file from where it stoped? I really appreciate your help and what you wrote, but I didn't understand very well.

 


Euh.....  no..

You didn't understand correctly...  Let me try to explain (sometime Itry to write faster and my fingers don't keep up with my train of thoughts 😉  )

 

There are 2 things:

 

1.  When to change the filename:  This would occur as soon as the date changes, which is midnight.  It would look at the current time/date and determine that the current date is not equal to the date in the filename, so it would create a new filename and you would start writing to that one.  You may need to put the filename in a shift register to compare.

 

2.  Writing to the file starting from the location immediately after the last write is done at every time / writing interval, which is every 1 minute in this case.  That allows you to write to a given position within the file (at end) without having to read the entire file, append the new data and write the entire content of the file at every 1 minute interval.  People who did this had a nasty surprise when the time interval was not enough to read/append/write the file.  Since you would know where the location of the end position of the file is, you have the added benefit of keeping track of it in an array which would allow you to easily search and access a block of data by knowing it's index.  To make life even easier, you could store the time index within the same array (2D) and could do a search for the timestamp and you'dimmediately get the index for the starting location of the block within your file.  Your boss would be impressed that you have a search engine built within your code..  😄

 

Hope the above clarified the info.


R

Message 13 of 59
(1,839 Views)

oh Thanks Ray.R

Now I understand it perfectly!

 

and yes, I wanna do it in my program!

I hope when I go home

i have enough time to read it carrefully and try to figure it out!

 

Now I only need an example if you have a time for that!

but i know you already give me the solution, i only need to know how to do it! 

 

Thanks!

0 Kudos
Message 14 of 59
(1,833 Views)

Glad you understood it.

 

No promisses, but if I do have time tonight, (or tomorrow) I will prepare a short example.

 

Which LV version are you using?

Message 15 of 59
(1,827 Views)

i'm using the LabVIEW 8.6 atm!

 

And i'm glad if you can make an example for me!

0 Kudos
Message 16 of 59
(1,813 Views)

Okay..

 

I'll see what I can do tonight.

 

R

Message 17 of 59
(1,800 Views)

I just wrote this example really quickly and didn't test it..

 

I just wanted to illustrate what I described.

 

There's no broken arrow, so something must be okay  😄

 

I'll check it out again tomorrow nite.  I was a long day today.

 

 

Message 18 of 59
(1,773 Views)

By the way, if it does work, then simply replace the dice with your own data.  And I placed a .dat extension.  You can change it.

 

R

Message 19 of 59
(1,772 Views)

Well Ray.R sorry for the delay

I only had time to see it today, but thanks it works nice

I already change it to .BIN

and now i have to implement it on my program!

 

Thank You!

Message Edited by EduU on 09-21-2009 06:28 AM
0 Kudos
Message 20 of 59
(1,747 Views)