LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read binary file more quickly ?

Solved!
Go to solution

Hello, I have a big database to be read in Labview. This DB size is 200×120,000.

When I try to read all of file at once, we need to wait.

So, I would like to create a program to read the DB per 10,000 rows. When I put "next" button, next 10,000 rows will be read.

I think I should use "count " of "read binary file", but I don't know how to use it.

 

Please support me.

 

mmm21_0-1646381067392.png

 

0 Kudos
Message 1 of 10
(2,585 Views)

If it is a binary file, why are you reading it as a 2D array of strings? That's not a typical datatype for binary files.

 

Your picture does not make it clear at all how things are connected to your subVI.

 

Could you attach your actual VI and typical (but much smaller) sample file?

 

In any case, you can specify how much to read each time. You just need to use a suitable loop. It will know where to continue reading at the next iteration.

0 Kudos
Message 2 of 10
(2,584 Views)

Pardon, I am a beginner of labview and programming. I might mistake the word.

I just would like to read the file of the 2D array string per 10000 row.

 

Please find the attached.

0 Kudos
Message 3 of 10
(2,571 Views)

A binary file is just a long string of characters. There is no concept of rows.

(A "row" assumes a formatted and readable text file with some characters designating row and column delimiters. You don't have that!)

 

You can read it as a string of course, but maybe you can tell us what the binary data represents. What are you going to do with it once it is read?

 

I any case, your file is not a flat binary file, but seems to have some structure (e.g. there are some readable strings and header type information). What software generated this file and is the file structure documented?

 

altenbach_0-1646384218608.png

 

0 Kudos
Message 4 of 10
(2,564 Views)

I would like to create the simple database by labview. Users will search the word per each columns, then they can see the filtered database on the front panel. The file I have attached before was generated by labview with the «create binary file ». The file structure is not documented, since that is created by myself for the purpose of publishing in the internet.

0 Kudos
Message 5 of 10
(2,510 Views)

You should consider using a SQLite file rather then trying to make a simple database yourself.   A bit of a task to learn SQL, but then tasks like this become easy.

0 Kudos
Message 6 of 10
(2,503 Views)

@mmm21 wrote:

The file I have attached before was generated by labview with the «create binary file ». The file structure is not documented, since that is created by myself for the purpose of publishing in the internet.


Well, if you created the binary file with LabVIEW, the "structure" for reading it is exactly the same as the structure you used to write it. So yes, it is "documented", at least for you. 🙂

 

I don't understand the usefulness of publishing something on the internet if nobody can read it. Can you explain?

 

0 Kudos
Message 7 of 10
(2,493 Views)

I have already tried SQLite library in my labview, but the time to read into lab view has not be shorted. Is there any clue to solve my problem ?

0 Kudos
Message 8 of 10
(2,474 Views)

Well I mean I just don’t want to upload our real data on the internet so that every body can see it. It is confidential data. 


Do you mean I need to Do I need to use SQLite or some other database tool for documented ?  

0 Kudos
Message 9 of 10
(2,472 Views)
Solution
Accepted by mmm21

The point of using SQLite is to only pull into LabVIEW the filtered bit that you are displaying to the user, not everything.

0 Kudos
Message 10 of 10
(2,443 Views)