LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

opening a binary file with the right extension

Solved!
Go to solution

Hi everyone,

I developed a real simple VI that enables me to read the first five bytes of a binary file to get its signature (ASCII) and verify if its signature matches with the expected extensions. If yes, another VI is called, and if not a 2 button message error is displayed : if the User chooses OK, then a new dialog box opens up to pick another file ; and if the user chooses Cancel, the same dialog box opens up rather than escaping the VI.

It is due to the while loop (VI below) but i don't see how I can handle this without it. Till the user hasn't chosen the right extension, it can't escape which is a problem! The true case consists in calling another VI, and the first step of the stacked sequence consists in displaying a two button error message.

If you have any ideas, I'm a bit new! Thanks !!

ced_vi.JPG

0 Kudos
Message 1 of 13
(3,007 Views)

Hi christoph...,

i can't see the dialog function. Can you please upload your vi?

 

Mike

0 Kudos
Message 2 of 13
(2,999 Views)

Sure Mike!

 

I didn't preview...

Download All
0 Kudos
Message 3 of 13
(2,994 Views)

Why is it so hard to just upload a VITFR30E.gif

Use the File Dialog Express VI Owning Palette: Advanced File VIs and Functions. Then you just vire the string *.ptm;*.ptw to the pattern label  input

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 13
(2,982 Views)

It would be easier to help if you had attached the actual VI rather than screenshots.

 

I think you have an issue by using a stacked sequence structure (both frames will execute no matter what you do).

 

Take a look at this thread where the original poster was trying to do a similar activity with choosing and rechoosing filenames.

http://forums.ni.com/ni/board/message?board.id=170&thread.id=416757

0 Kudos
Message 5 of 13
(2,980 Views)

Hi christoph...,

you should connect the negatived output of the msg dialog to your while condition.

 

Mike

0 Kudos
Message 6 of 13
(2,976 Views)

Thanks for your replies!

 

I have tried your solution CoqRouge, filtering the extensions. But it seems that you can choose between different filters when the dialog box opens up, and then choose any kind of extensions.

 

@RavensFan : I cannot load the VIs attached in this thread because I am using an older version of Labview

 

@MikeS81 : Which negative ouput?

 

 

 

 

0 Kudos
Message 7 of 13
(2,964 Views)
Solution
Accepted by topic author christophe69000

Hi christoph...,

see the attached image.

 

The false case contains only a true constant connected to the while condition.

 

Mike

Message Edited by MikeS81 on 06-17-2009 05:17 PM
Message 8 of 13
(2,955 Views)

It is just a tip. Go help help in toolbar then select find examples and search for listbox. Select the "Listbox for File Explorer Demo.vi" By modifying this VI you can have better control with the selectable file types. Just remember to use the save as option then saving after modifying



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 9 of 13
(2,947 Views)

christophe69000 wrote:

 

RavensFan : I cannot load the VIs attached in this thread because I am using an older version of Labview

 

 


Here is that file from the link saved for LV8.0

0 Kudos
Message 10 of 13
(2,943 Views)