LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File read/write organized by key value of (Date and Time)

Hello all. I am a beginner at LabVIEW. My version is 8.5. Here is what I want to be able to do: I want to be able to select a date and time and then write some information to a file using that date and time as my "Index". So I want to be able to write data(Possibly several pieces of data and several different writes) to this file and later be able to read the data from a specified date and time. I already have a working calendar that allows a user to select the date and I'm sure I can figure out how they can select a time but the real question is about the read/write into the data storage file. Read speed will be important but functionality is the most important. I am not sure at all how to get this done. If you fine people could help me figure out what is the best type of structure/file would be best to use and how to implement it I will really appreciate it. Any information is welcomed and very helpful. thanks in advance.
0 Kudos
Message 1 of 11
(4,625 Views)

If I might, I'd like to suggest a slightly different tack. The problem you're going to run into with the way you are thinking about the task right now is that writing the data will be easy but getting the data you want out will be a major pain because you will have to implement the search and selection logic yourself. What I would propose would be to save your data in a small database. The necessary software is built into Windows and you can find a good set of drivers as well as a very good example here. Getting the data in is just as easy, and the search algorithm for getting the data out is implemented in the database so it's very easy from the LV world too.

 

This approach will require you to learn a bit, but in the long run it will be faster and much easier that doing it with text files - and the performance will be much better too.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 11
(4,611 Views)

 This is actually a reply to the first reply, sorry I am new at this forum.  Not really sure how to reply to a reply.  Maybe I have to be signed in.  Anyways

 

The only problem I have with using something like Microsoft Access is that this software may be used in a commercial device at some point in the future.  If I have to add Microsoft access to each device I'm sure that the individual unit price would go up exponentially.  Are there any free database programs that you know of that would do the same job?   Or is there any other ideas?  At worst we may have to do as described but I'd like more input.  Thanks a lot for the help and quick response either way.

 

P.S. To all that are reading this.  One of my team mates mentioned that he thought when I said "you fine people" that it might have sounded condescending.  That was certainly not my intension and I wanted to make sure that you all knew that.  I just think anyone who is taking their time to read and/or reply is a very nice person indeed.  Thanks to all.

0 Kudos
Message 3 of 11
(4,560 Views)

You don't have to add Access to each machine and the reason is that Access isn't really a database. Rather its an application development environment that by default utilizes a DBMS (called Jet) that is built into all modern versions of Windows. Hence, you do not have to have Access installed to run the examples that I posted in the other thread. Try it.

 

In terms of other database solutions, Oracle and Microsoft both offer free versions of their enterprise-level products, in addition there are various open-source options like Firebird and Postgres. I have used Firebird before and it is very good. Postgres was until recently a Unix-based product, but it also runs on Windows now. I haven't used it, but have heard some good things about it.

 

Mike.


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 11
(4,554 Views)
Wow, I'll look into this.  Thanks so much.
0 Kudos
Message 5 of 11
(4,547 Views)

errors1.bmp

 

errors2.bmp

 

The pictures above are the errors that we get when I try to transfer a Database Query VI to the "LCD device".  Any ideas on whether or not Windows CE can handle this type of application?   There are a bunch of Wire errors that occur.  They happen on all of the wires that connect field data.  The VI's run great on our PC but can not transfer to the device because of the errors.  I'm not sure that I can tell you much more, because I don't know much more.  Let me know if any of you have an idea of what the problem might be.  Also the LCD device does not have labview on it.  We are transfering executable code to it and have successfully transfered other VI's.

 

0 Kudos
Message 6 of 11
(4,487 Views)

Hmmm, it looks like the pictures did not work. Let me try a different way

 

 

error 1

0 Kudos
Message 7 of 11
(4,486 Views)

Ok, I'm not sure how to get a picture on here.  Some of the errors include:

 

  Current VI's Path:  Function not supported for current target

  Wire: Type not supported in current target  (Lots of these)

  Front Panel Terminal: Type not supported in current target

  Loop Tunnel: Type not supported in current target

 

It seems obvious that it does not like the database functions.  What can I do to fix that?

Thanks for any replies.  If you need more info, let me know what to get and I will get it ASAP

0 Kudos
Message 8 of 11
(4,483 Views)

Bolsun,

 

You can't insert an image that is located on your harddrive.  No one else but you can see it.  You need to post the image file (prefably .png)  as an attachment to your message.  Note that you cannot upload .bmp files.  They are restricted because bitmap images are too large and take much longer to download.  Once you submit the message, then you go back and edit the message and insert the image (as long as its not too big) based on the link to the image as it resides on the NI forums website.

 

0 Kudos
Message 9 of 11
(4,473 Views)

Just read your first message and I had a different idea.  I would be interested in what everybody else thought on this too.

 

How about a TDMS file using the time stamp as either the group name or channel name?  That should make retrieval pretty easy.

 

-Matt

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 10 of 11
(4,471 Views)