LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load path names into next path?

Solved!
Go to solution

Attached vi is a routine that is supposed to act as follows:

1) Open a file for manipulation and conversion.

2) Perform calculations to derive velocity and accel values from displacement (this part not shown for simplicity).

3) Open a new file path dialog box that is preloaded with the path as well as default filename (taken from the input file name).

4) Allow the option of changing or adding to the output filename (this made possible by using a 2nd dialog box).

5) Add the proper extensions to the filename and save 3 separate files.

 

What I have is a vi that asks for an input filename then automatically without user intervention, changes the extensions and saves the output files.

I need to be able to edit the base filname (without extension) before adding the correct extensions but my program does not produce a dialog box at save time.

I'm confident that I need to create another single dialog box for the output file and wire it to all three output file writes. I can't figure out a way to load the default filename into the dialog box or to even install a dialog box that will automatically pop up but not be shown on the screen. This whole vi has to be run as a sub vi and be invisible to the user

except the open file dialog which is a control that is passed to the sub. I think this has something to do with  property nodes but I just can't get my hands around it. Could someone help me with this?

Please forgive the style as this is my first LV program.

 

Labview 8.5
Meas Studio 2008
0 Kudos
Message 1 of 12
(4,851 Views)

Can you please attach your VI too.

 

Meanwhile from your description here is what you can do. Most open/Create file VIs don't pop up a dialog box if a valid path is wired to them. In order to change the last part of a path, you have two options. You can convert the path into a string. Then using the string manipulation tools like mid and concatenate you can attach the new extension. A more elegant way to do it is to use the path tools called strip path, and then build path. Look up the LabVIEW help for these functions. If you press Ctrl+H when you are in the block diagram and move over a placed SuB-VI it pops up a context help that explains what a sub VI does.

 

Please post your findings.

 

All the best

 

Amit

0 Kudos
Message 2 of 12
(4,845 Views)

Very sorry. Forgot to attach.

 

Labview 8.5
Meas Studio 2008
Download All
0 Kudos
Message 3 of 12
(4,843 Views)

Thanks. I use context help. I have some string functions in the vi already. I can biuld the string I want but I don't know how to force the dialog screen. I sort of need it to work like an unwired path so it will pop up automatically. I don't know how to get inside this "nonexistant" control to attach a property node. So you see I need some behavior of a wired control and some behavior of an unwired control.

 

Labview 8.5
Meas Studio 2008
0 Kudos
Message 4 of 12
(4,841 Views)

walter-donovan wrote:

...

figure out a way to load the default filename into the dialog box or to even install a dialog box that will automatically pop up but not be shown on the screen. This whole vi has to be run as a sub vi and be invisible to the user

 


 

How can you have a popup that will not be shown on the screen? That's a completely contradictory requirement.

 

If you want a file dialog, use the the File Dialog function.It's on the File I/O>Advanced File I/O palette.

 

p.s. You also need a while loop around your event structure.
0 Kudos
Message 5 of 12
(4,834 Views)

Forgive my wording. I don't want the popup to be invisible. I mean that I don't want a separate, visible control on my front panel.

And yes, I know about puting the code into a loop. It is in a nested loop in the actual application.

Did you run my example? If you do you can see that no dialog box opens at the invocation of the save routines. What I want is to

have a dialog box open, already loaded with a default filename. If I add a control  to the panel, I will manually have to click on it

to open it. I want it automatically opened since this sub vi is called and should execute to completion without intervention (with

the exception of dealing with the automatically opened dialog box).

 

 

Labview 8.5
Meas Studio 2008
0 Kudos
Message 6 of 12
(4,818 Views)
Of course no dialog appears when you call the Write to Spreadsheet functions. The File Dialog function that are called by it are disabled by you providing a valid path. Have you tried my suggestion of directly calling the File Dialog function? Put it on your block diagram and call it. It's just that simple.
0 Kudos
Message 7 of 12
(4,810 Views)

I tried it again, at least what I interpret that you are saying. I put a control on the front panel (I don't think I can put it in the block diagram). Here is the revised vi. It now opens my first input dialog box, processes the info and opens the newly added output file dialog box three times. Each time it is blank. Apparently I misunderstand you.

 

Using the file I provided, I run the pgm, select the input file dialog box and select "Input Data.txt"

After processing I want one single dialog box to appear with the default file "Input Data.txt". The method I used here invokes the dialog 3 times and there is no defualt name.

 

 

Labview 8.5
Meas Studio 2008
Download All
0 Kudos
Message 8 of 12
(4,807 Views)
Solution
Accepted by topic author walter-donovan

I don't understand why you are finding it so difficult and how you could possibly interpret my suggestion for a function on a palette for a front panel control. If you want a single dialog box to appear, call the File Dialog box function I mentioned twice. A front panel control is not a dialog. It's a control. A dialog box is exactly the function on the File I/O>Advanced File Functions palette. If you don't want to use this dialog box, create your own. If you don't want to use a dialog box, stop saying that you do.

 

Here is the dialog box function:

 

 

Message Edited by Dennis Knutson on 02-07-2009 05:47 PM
0 Kudos
Message 9 of 12
(4,789 Views)

Thank you for the diagram. Apparently I misread your first post and I was looking for a file path dialog control. Like I said I am very new to LV and don't know every function and control available to me. I assume that this dialog is what I would use if I want to do file ops from a runtime menu?

 

Labview 8.5
Meas Studio 2008
0 Kudos
Message 10 of 12
(4,765 Views)