09-21-2012 10:13 AM
Here's a quick question, I am using the LabVIEW file path control icon, when you hit the little file browser up pops the window where one can browse and select a file. Once they are happy they can hit the OK button. I am trying to embed this as a part of another program which I want to wait until the OK button is pressed. Where is the property node for the "OK" button? I can't seem to find it.
09-21-2012 10:16 AM
It doesn't exist. LabVIEW is actually calling the Windows file dialog.
Maybe what you need is an event structure with a case set to Path->Value Change.
09-21-2012 10:57 AM
@adamsdaq wrote:
Here's a quick question, I am using the LabVIEW file path control icon, when you hit the little file browser up pops the window where one can browse and select a file. Once they are happy they can hit the OK button. I am trying to embed this as a part of another program which I want to wait until the OK button is pressed. Where is the property node for the "OK" button? I can't seem to find it.
I am just trying to understand what you mean by this?. Do you want to wait in the program you are running or in the browse window?.
09-21-2012 10:58 AM
While that may work in most situations, what if the user selects the same path? I am suprised there is no way to do this.
09-21-2012 11:01 AM
I want to wait in the program I am running. The real issue is I have the individual instance of this VI working great, however when I go to run it as a subVI embedded in a higher level program, if the path control is empty or has the wrong value the progam is not giving the operator the time to change it. Thus it would be very nice if some how I could use the operator acknowledging the correct path as a precursor to continuing with the program. I must admit I have very little experience programming in LabVIEW.
09-21-2012 11:02 AM
@adamsdaq wrote:
While that may work in most situations, what if the user selects the same path? I am suprised there is no way to do this.
What do you mean by same path? So you have another option similar to this where the user selects the path. Please make it clear
09-21-2012 11:06 AM
@adamsdaq wrote:
I want to wait in the program I am running. The real issue is I have the individual instance of this VI working great, however when I go to run it as a subVI embedded in a higher level program, if the path control is empty or has the wrong value the progam is not giving the operator the time to change it. Thus it would be very nice if some how I could use the operator acknowledging the correct path as a precursor to continuing with the program. I must admit I have very little experience programming in LabVIEW.
Good now its clear. What you can do is you can use a file dialog function (Available in advanced file functions) after the path control and keep it inside a case structure. Check the path control is empty or not if empty pass the path through the file dialog case or else just past it through the other. It all depends how you handle the sub vi from the top level and how you feed the path to it programatically.
09-21-2012 11:08 AM - edited 09-21-2012 11:11 AM
@adamsdaq wrote:
I want to wait in the program I am running. The real issue is I have the individual instance of this VI working great, however when I go to run it as a subVI embedded in a higher level program, if the path control is empty or has the wrong value the progam is not giving the operator the time to change it. Thus it would be very nice if some how I could use the operator acknowledging the correct path as a precursor to continuing with the program. I must admit I have very little experience programming in LabVIEW.
You can check the validity of the path, and if it is not suitable, call a file dialog function. Check the new path and also if the dialog go canceled and proceed as needed (ignore error, ask again, etc.)
Expection handling and such really needs to be done in code and LabVIEW has a rich selection of options. Is the path received from a connector to the subVI? Under what conditions is it empty?
09-21-2012 11:19 AM
@altenbach wrote:
@adamsdaq wrote:
I want to wait in the program I am running. The real issue is I have the individual instance of this VI working great, however when I go to run it as a subVI embedded in a higher level program, if the path control is empty or has the wrong value the progam is not giving the operator the time to change it. Thus it would be very nice if some how I could use the operator acknowledging the correct path as a precursor to continuing with the program. I must admit I have very little experience programming in LabVIEW.
You can check the validity of the path, and if it is not suitable, call a file dialog function. Check the new path and also if the dialog go canceled and proceed as needed (ignore error, ask again, etc.)
Expection handling and such really needs to be done in code and LabVIEW has a rich selection of options. Is the path received from a connector to the subVI? Under what conditions is it empty?
I agree. I also feel it is far better to prevent the user from doing something wrong than it is to let them do it and then try to recover from it. For instance, I'd keep the "OK" button grayed out until a valid path was entered. That way you avoid having to recover from "bad path was chosen after pressing 'OK'."
09-21-2012 11:41 AM
Hi everyone thanks for the help here, actually the way I wound up doing it was as others suggested to use the File Dialog express VI. I am not sure if it is the most elegant but now it pops up and only sends the value when selected, and since it pauses the program until selected it is a suitable work around.