Open file in Sub VI and close in Main VI

Hi,
Question:
I am opening a file using a Sub-VI, but i am unable to close it in my main VI. Is there a way of passing the refnum between Sub-VI's ?
Or is there a cleaner way of doing this ?
Thanks
GM

Although this can be done, it is not good programming practice to do so.  You should open files in one vi, read/write to them in the same vi or in subvi's, and close the file at the level where it was opened.  This is proper modular programming.  Then you would not need references.  You could just wire the file refnum into your subvi.  Of course this is a general statement.  You could have a very good reason why you are doing it your way.
- tbob
Inventor of the WORM Global

Similar Messages

  • How to call sub VI and close the main VI in while loop and sequence condition

    Hiya,
    I have a problem with the while loop and the sequential condition in placed together i.e while loop as Global and sequential condition as local (i.e inside the Global loop). For example,when calling the sub vi from the main vi (main vi as main menu and sub vi as sub menu.)My problem is I can't run my sub menu when the particular icon is pressed through the main menu and only the front panel appears. My concerned was if possible the sub menu is activated in few second then jump back to the main menu again (analyze through the diagram).So, I don't know what should I need to do. If possible, please advice me how to encountered that particular problem.
    Thanks!

    Go to your block diagram of your main menu, then click on the "Hightlight Execution" it is something like a bulb. then you execute your vi. then LV will show you all your data flow.
    When you feel sad, laugh

  • I want to edit properties of the interface windows opened while "Open File", "Save Page As" and interface opened during Downloading of any file.

    I am doing a small project on dedicated web client where in user automatically logs in non-root user and Firefox automatically starts.
    I am using Fedora 14 kernel 2.6.35.12-88.fc14.i686 and Firefox 3.6.16.
    I have installed only Gnome in my computer with no Nautilus or other file browser on it.
    I want to edit properties of the interface windows opened while "Open File", "Save Page As" and interface opened during Downloading of any file.
    Please guide me for this.

    First, I sent an email to the author of PhotoME to inform him of the serious issues his addon caused with Firefox latest versions.
    Now, for those of you who do not have the PhotoME addon and yet experience the same problem that I had and that I described above, I suggest the following strategy.
    As PhotoME did cause these problems with Firefox latest versions, I am pretty covinved other addons probably might cause these problems too. Therefore, adopt the following method.
    Test one addon at a time to see if this particular addon is behind your Firefox issues like the ones I had.
    So, disable one addon only at a time. Then close your Firefox and restart it from scratch and see if you still have your Firefox problems. You must restart the Firefox browser from scratch. If you still have these Firefox problems, re-enable the disabled addon, restart your Firefox (again!) and repeat the same method for every single addon that you have.
    Try to be selective by choosing first addons that are more likely to cause your Firefox problems such as not very well-known or not very popular addons (like it was the case for the PhotoME addon).
    If this method works or if it does not work, report it on this web page so that others can be helped with your comments.
    I hope this method will help you because I was really upset that I had these Firefox problems and I first thought it was the fault of Firefox, only to discover later that this PhotoME addon was the culprit and had caused me such upset.

  • HELP. ............Hi folks hope some one can help me please.Having a problem in Bridge I open my images in ACR,  as I open files in a folder and lets say they are labeled in yellow  they are all going back to  the camera raw default , in other words no ma

    HELP. ............Hi folks hope some one can help me please.Having a problem in Bridge I open my images in ACR,  as I open files in a folder and lets say they are labeled in yellow  they are all going back to  the camera raw default , in other words no matter what work I have done, inc cropping they  all go back to ,as they came out of camera. What on earth is happening? I am on PS CS6. I might point out everything was working normally up to  yesterday, when this first started.
    I recently changed computer to 64bit from 32bit, not sure if this causing  the problem or not. Any help would be appreciated.

    Robert,
    Would you be so kind to rephrase your question with concise, precise information and without any "let's say that" hypotheticals?  Sorry, I can't quite follow you.
    Also please give exact versions of Photoshop CS6 (13.what.what), of Bridge and of your OS.
    Thanks.
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand, such as your platform (Mac or Win), exact versions of your OS, of Photoshop and of Bridge, machine specs, what troubleshooting steps you have taken so far, what error message(s) you receive, if having issues opening raw files also the exact camera make and model that generated them, etc., someone may be able to help you.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • FF31: When I only have one tab open, even a blank one, and close the tab the window closes.

    FF31: When I only have one tab open, even a blank one, and close the tab the window closes.

    Type '''about:config''' in the Location bar and hit '''''Enter'''''.
    ''Accept the warning.''
    '''browser.tabs.closeWindowWithLastTab'''
    double-click to toggle to '''false''' and then restart Firefox.
    Now if you close the last tab the window (or Firefox) won't close, but a New Tab will be there.

  • When i open pixel bender, photoshop crashes and closes

    hi, i really need help, i been spending hours trying to fix it
    When i open pixel bender, photoshop crashes and closes. I went to edit>preferances> performace and looked at the gpu setting, it gives a small message at the bottom but i dont know what it means. I cant also click on advanced settings as photoshop would also crash
    Please help

    Post your win7 reliability history crash reports for your Photoshop CC crashes

  • IO6 battery discharges quickly and every time I open an application, it crashes and closes

    I upgraded to iOS 6 and since then the phone battery discharges quickly and every time I open an application, it crashes and closes. And finally, back to the home screen. I can not send messages, listen to music. And when my friends call me, the link is silent and then back to normal again and then is silent. Can anyone help me? I have an Iphone 4.

    Restore your phone as a NEW device, not from backup.

  • The books are all in my library but when I try to open them the app glitches and closes out.

    I have an iPod 4g and I had deleted the ibooks app but downloaded it again. The books are all in my library but when I try to open them the app glitches and closes out. Before the app update (ios 7) and after the update it hadn't worked (for the past week).

    I think I have found an answer on another page! If anyone else wants to know just do this:
    Hold down the home and sleep button (if the turn off button comes up just ignore it) and when you see the apple logo release the buttons and let it wake up!
    It worked for me and seem to work for a lot of people. Hope this helps!!

  • I have opened files in photo shop and illustrator and in previously saved files only the last tool u

    I have opened files in photo shop and illustrator and in previously saved files only the last tool used can be used even though I have changed the tool in the tool bar. In new files onyly the pencil with the strike thru is available even though I  try other tools and create new layers.

    xyz33 wrote:
    I have opened pdf files from the web in ibooks and so have presumably saved them on the ipad. 
    If you see the PDF files in iBooks, then you have saved them. If you don't see them in iBooks, they are not on the iPad.
    Try transferring purchases before you sync with iTunes. Bit follow this with a sync, if iTunes does not sync on it's own.
    Transfer purchase.
    http://support.apple.com/kb/HT1848

  • My safari opens with a blank page and closes back. What should I do?

    My safari opens with a blank page and closes back. What should I do

    Hi there,
    I would recommed trying this: force close the Safari application and then reset the iPhone.
    -Griff W.

  • When I am open file with adobe Pro and reader the resolution in my computer failing, change the resolution from 1920x1200 to 800x600. my video card is nvidia quadro 2000. w7 & 32 bits

    when I am open file with adobe Pro and reader the resolution in my computer failing, change the resolution from 1920x1200 to 800x600. my video card is nvidia quadro 2000. w7 & 32 bits

    Hi fabiangs,
    I'm not sure that I follow. Are you saying that when you open a PDF file in Acrobat or Reader, that the display resolution changes automatically on your system?
    What version of Acrobat/Reader are you using? Do you see this same issue in other files/applications?
    I look forward to hearing back from you.
    Best,
    Sara

  • Keep getting corrupted temp save file when I save and close.

    When I save and close a numbers spreadsheet, about 20% of the time I will be left with the normal file and a weird temporary file with a "~" on the end of the file name.  I can't delete the file or do anything with it.  It will let me open it, but even when I save it still says I cant delete because the file is in use.
    Example-
    Work on spreadsheet1.  Hit save and then close.
    In finder I am left with-
    spreadsheet1
    spreadsheet1~
    "spreadsheet1" is the correct file and it works and functions normally, but "spreadsheet1~" is corrupt and I cant seem to delete it.  I always get "The operation can’t be completed because the item “spreadsheet1~” is in use.
    What is causing this and how can I get rid of those files?

    I think I would ignore the files and not worry about them.  Are you experiencing any undesirable effects of these files-- aside from seeing them there?

  • How to systematically open file in a folder and process them with a program

    Hello,
    For my second question of the night.
    I am wondering if there is a way to open every file in a folder, run them through a vi, and then append the output to an array or spreadsheet? This would save me lots of time and my wrists.
    Thanks
    Solved!
    Go to Solution.

    Hi,
    Yes you can open a file in the folder by using 'List folder' function (Programming>File I/O>Advvanced File Function>List Folder) which lists all the files and folders in the given path. From that you can build the path and give to 'Open File' function.
    Hope this helps you. Let us know this solves your issue

  • "Can't open file clip; skipping it and continuing" problem

    Dear People,
    Opening an approx. 30 min. project that I had worked with many times before over the past year, I am now confronted with this message "Cant open file clip; skipping it..." for each and every single file in the project.
    I click "OK" because I can't even get out of the project until I reach the end of these prompts.
    I backed up project -saving media- to a few DVDs but when I try to open the project from the re-imported project, the same thing happens.
    I am ready to accept the lost project and can always start from scratch by reimporting clips but I'd like to avoid both and particularly the latter if possible.
    Thanks for your help

    Hi Alexander - I would have to say that it sounds a bit like the dreaded corrupt project syndrome. Have you by chance emptied your iMovie trash? That action does not always cause disaster, but it CAN do, so is strongly advised against.
    The only other cause I can think of is that you saved the project to an external drive that was wrongly formatted - it should be Mac OS Extended.
    G5 Dual 2.0 ghz   Mac OS X (10.4.3)   1.5 GB RAM; VidCam: Sony DCR TRV80E

  • Help! Whenever I try to open one important file on icloud pages it says 'can't open file' - on my computer and ipod, too! Can I retrieve it?

    I have a very important document and it is saved only o the icloud (which I thought would be fine). Only now, whenever I try to open it it gives me the message 'can't open file'. I'm a PhD student, and that file represents a lot of work for me. I did it on the ipad because I had to travel, and now I'm kicking myself. I need that file! Is there any way to get it back?

    Thanks for your suggestion - I have tried that like 50 times (I was feeling the desperation and thought if I reset enough times it would do it), and I have also tried turning off and on the cloud, adding .pages to the filenames, downloading (didn't work) emailing to myself (did work, wouldn't open). When I looked at the package contents of the file, it did not have a file for content in it - or not one I can find. I'm afraid that it's lost the content within the file (though I don't now how it could!).
    I've not had any joy with anything else I have read online. I think it's a more knotty problem than a simple off/on again job!

Maybe you are looking for