LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i open every file?

Hi i have a problem,
i want to open some files, this files are different typs, for example a txt- or a pdf- or a dat-file. How can i do this withe one vi?
Ther is one example for dat-file (Read Datalog File Example.vi) but this vi do not open a txt-file right, there are missing some text and ladder on the end.
and with other example (Read from Text File.vi) i only can open txt-files.
I need a vi for oping every file.
is this possible?

THX
0 Kudos
Message 1 of 9
(3,709 Views)
Hello,

Every file is binary, even text files. Use binary file function would enable you to read all files.

Regards,

André
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 9
(3,698 Views)
THX but i can't open it withe LabView 8.0
Have you an older version??

0 Kudos
Message 3 of 9
(3,698 Views)
Hereby a screenshot of the code.

Regards,

André
Regards,
André (CLA, CLED)
0 Kudos
Message 4 of 9
(3,691 Views)
To properly read a file, you need to know how it is structured. The file extension can give you a hint but is not foolproof.
 
You could for example format your data using roman numerals and write it to a text file named binary.pdf and you would be able to read the data back only IF you know how it was written.
 
You can program a more generic tool that autodetects the file by looking at the file extension and the data structure, but this can get very complicated the more general the tool has to be. I am pretty sure that reading and parsing a real pdf file (in the proprietary adobe format) will typically not be possible. However, you could e.g. display a pdf file in a container or programmatically open it with acrobat reader for example.
0 Kudos
Message 5 of 9
(3,663 Views)
THX the code in the screenhot opens realy all data formats, but only small data, when the data becomes too large, LabView say: "Not enough Memory to complite this operation". But I have enough Memory. This appear already by a data-largeness of fwe bytes (maybe more than 10 MB).

Can somebody say waht is wrong?

ThX
0 Kudos
Message 6 of 9
(3,630 Views)


@chefcommander wrote:
THX the code in the screenhot opens realy all data formats, but only small data, when the data becomes too large, LabView say: "Not enough Memory to complite this operation". But I have enough Memory. This appear already by a data-largeness of fwe bytes (maybe more than 10 MB).

A "few bytes" is NOT a large file, and 10MB is neither. Somehing is terribly wrong with your code. Can you attach your program?

How much memory do you have? What is your OS?

0 Kudos
Message 7 of 9
(3,616 Views)
I have 1 Gbyte Memory, also enough, but when i will open a small data with only 10 MByte it say's to me that i have not enough memory.
Ok when i would open a data with more than 1Gbyte, for example a zip-file, i can understand it, but the data are realy not large.
????
0 Kudos
Message 8 of 9
(3,614 Views)
The code is like the screenshot upstairs
0 Kudos
Message 9 of 9
(3,609 Views)