Problem of CVI Working Directory

I am runing a program compiled in the CVI 8.5 which gives me a random problem.

The function GetDir (gExecFolder) does not return the same value all the time, which causes an error when accessing the files that do not have a full path.

for example, MyFunction ("FileName.ext");

The error is file not found.

Please take a look at these 2 images showing the different outputs of the GetDir (gExecFolder).

Good performance:

Bad output:

Note that I stopped running after this executed line.

Thanks for your help.

I personally resolved to set the paths to the extent possible, as the current working directory is not always constant throughout the life of the application. For example, it is changed when you browse the PC with FileSelectPopup or DirSelectPopup: I normally have a timer or a secondary thread that periodically records status running the disk while it is running even when the popup is on and I get errors for non-existent file in the working directory changed.

An alternative to GetDir is to use GetProjectDir which returns the directory EXE (or PRJ) in all conditions.

Tags: NI Software

Similar Questions

  • Impossible to change the working directory

    I'm trying to change the working of a computer virtual directory so that snapshots are stored in a different data store.

    I used the following two articles for instruction:

    "Create snapshots in a different virtual directory default location"

    http://KB.VMware.com/selfservice/microsites/search.do?cmd=displayKC & docType = kc & docTypeID = DT_KB_1_1 & externalId = 1002929

    "Record or adding a virtual machine to inventory".

    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 1006160

    I recorded my VM.  I added the following line to my .vmx:

    workingDir = "/ vmfs/volumes/4cb6d8b0-45f1b122-3a3a-d48564535eca/vm-snapshots.

    This has been copied directly from management.  The only thing I changed was the part of the path that identifies my data store.

    Note: I also tried to use 'vmsnapshots' to ensure that the hyphen was not my problem, but I got the same error message.

    I recorded my VM.  I have no problem adding the .vmx inventory.  When I right click on my VM and go change the settings > Options, the workplace of VM looks OK.  4cb6d8b0-45f1b122-3a3a-d48564535eca translated correctly to the identifier for the data store (it looks like this: [DL360G7DS1] vm-snapshots /).  I turned on my virtual computer.  I get the following error message:

    "This virtual machine cannot be turned on because its working directory is invalid. Use the configuration editor to define a valid working directory and then try again. »

    I didn't know if the "vm-pictures" directory would be created automatically or if I have to create it, so I tried both ways.  There is no space in my path name or a folder.  I had not changed anything else in my .vmx and when I remove the line workingDir, VM powers on without problem.

    There is a good chance I'm missing something simple here.  The path seems to be accepted and pointing in the right direction.  I don't know what I have to do to "vm-shots" to make it valid.  The instructions didn't about the requirements for this directory.

    Any advice would be greatly appreciated.  Please let me know if I does not provide enough information or if the rest of my .vmx file should be displayed.

    I would just put the hard in the home folder of the new virtual machine after I have it create?

    From what I understand so far, there is not enough free disk space on the data store "2MB" to host the virtual machine! If there is enough free space on the disk so you can just migrate the virtual machine in this data store using vCenter Server. If there is not enough disk space, you can create a new virtual machine on the data store "2MB" and leave the virtual disks on the data store '1 MB' for now. Just make sure that you document it (for example in the annotations of the virtual machine) If you don't accidentally delete the old folder with the the.vmdk file.

    André

  • Problems to prolong working

    Hi guys,.

    I am completely new to the consistency and I have a few problems to prolong working
    with the config 'out of the box.

    I created coherence and run the examples in Java etc. on one of my PC, but wanted to run the same test of
    the other PC - connection to the cache running on the first machine.

    I wanted to keep things simple - so just use the standard installation that comes 'out of the box' (again) (ie. the example of Mycache).

    I read the doco etc, but to be honest, it's not so clear to me.
    I took the example of "Cluster-side Cache Configuration" in the Guide to the developer as a base to try to get this to work - but keep
    Get the error:

    Failed to load the configuration-file even if the file exists in the directory I specified.

    At this point, I don't know if its an error with the file or the file is simply not to be seen.

    Any help would be greatly appreciated. :)

    BTW: apart from the Oracle Doco, is there a good book out there about consistency?
    The doco is also unclear in places.

    Thank you very much

    Adrian.

    Hi Adrian

    The configuration file can be specified when starting the JVM as shown below

    -Dtangosol.Coherence.CacheConfig=/dir1/dir2/config-file. XML

    Paul

  • Anyone having problems with iOS 9.2.1? Storage problems, apps not working?

    Anyone having problems with iOS 9.2.1? Storage problems, apps not working?

    No, not at all. Maybe if your were to describe the issues a little more in detail, someone might be able to help.

  • Change the working directory of the MathScript node in the working directory of the VI in which the node is added

    Hello

    I want to automatically change the working directory of the node Mathscript in a VI in the working directory of the VI, while I don't have to specify every time where is my file ".m", as most likely, it will be in the same folder as the VI.

    Thank you

    Walid F. van

    Hi Wade,

    The following picture illustrates how to add the directory to your VI to MathScript search paths.

  • Some virtual machines have intermittent network connectivity problems and rest work correctly.

    Some virtual machines have intermittent network connectivity problems and rest work correctly. The VMs are in the same group of port and on a 4-node cluster. Physical network interface cards are appearing in vsphere client

    Please confirm if the issue has been resolved after you complete the steps.

  • Muse said that my file is damaged... I don't have a backup! In any case, I can solve the problem? I work on a mac! Please help me!

    Muse said that my file is damaged... I don't have a backup! In any case, I can solve the problem? I work on a mac! Please help me!

    I'm really sorry. Given all that's left is 4 k, is there anything I can do to recreate the 37Mb of your site.

    At the file never stored in a folder of synchronized cloud (i.e. Dropbox, Cloud Files, iDrive, OneDrive, GoogleDrive creative folder, etc.)? If so, these services provide generally access to all previous versions for a certain number of days, so you can recover the file in this way...

  • File snapshot working directory / Suspend?

    I use Fusion 3.0 and I have one of my virtual machine stored on a NAS.  I have access to the content of the image of the virtual machine on the network.  When I suspend the virtual machine, I get the following warning:

    "The snapshot file / suspend is stored on a remote file system."  You will get better performance if you specify a directory on a local file system for this file. You can specify a directory for your snapshot file / suspend setting the working directory in the Virtual Machine configuration Options.  Click OK to continue, Cancel to abort. »

    However, I find no setting anywhere we will tell me the location of the file snapshot/suspend.  Can somone tell me where this setting is to?

    You can separate the VHD in management of VM files.  First of all, you should shut down your virtual machine and remove any instant assets via the Snapshot Manager to suspend the machine.  Go to Virtual Machines > settings and delete your virtual hard disk.  Merge you will be asked if you want to move the virtual disk in the trash, answer NO (or the disc may be removed).

    Then, open the package of virtual machine on your NAS and exit the virtual disks to a common location.  If the disc is in split format, you need to move all parties, for example disk.vmdk, s001.vmdk - disk, disk-s002, vmdk, and al. set.

    Return the rest of the VM package to your local Mac, i.e. Documents > Virtual Machines.  This should be a small, fast, copy before everything, including the .vmx virtual machine configuration file.  Open the package VM in Documents > Virtual Machine.  Go to the Virtual Machine > settings and add your virtual drive on the NAS with + (add the hard drive).  Use the open dialog box to locate the virtual disk on the NAS.  If requested, do not choose the option to copy the ramdisk (defeats the purpose), but the share of the choose option disc.

    In this configuration, your files of disruption/recovery will be local, but the virtual disk (99%) of the space of your VM's on the NAS.

  • uninstaller application, created with Labwindows CVI, work of doesn´t after the upgrade to version 2010

    Hello

    I worked with Labwindows CVI 2009 without problem, but after the upgrade to the 2010 version, I have the following problem:

    When I m going to run the unistaller, Panel configuration Windows or directly from the icon uninst.exe, it doesn´t work. The PC thought for a few seconds and does nothing, and it happens with all applications that I build with Labwindows CVi 2010.

    Thank you

    Asier

    Hello-

    You install these distributions on a non-English system?  If so, the first thing to try is the workaround solution listed on this known issue.

    The known problem lists only the Italian OSs because inconvenient BONE, but in fact, it can happen on of many different non - English OSs. I will update the text accordingly the next time I update the list of known issues.

    NickB

    National Instruments

  • Writing in the app-storage inside the worker directory

    Hello

    In my Adobe AIR (desktop) application, I wrote a class FileDownloader using insternally an instance of FileStream to write remote files in the application storage directory

    The problem is that the user interface crashes during the download process (even if I open the local file asynchronously)

    As a solution, I thought it might be a good idea to use a worker to download these files, but when I try to write to the directory of storage app of my worker thread

    the worker, he writes in this folder: %appdata%\[Worker].null\Local Store

    As you can see, app storage directory is inside this folder named ".null [worker]" instead of being in my true app-storage dir (named by my ID app)

    A solution I found to write downloaded files in a tmp file, then, in the main Worker Thread, use moveToAsync to move the file to my app-storage directory, but it's not very clean... and moveToAsync takes time with large files...

    Has anyone experienced this problem?

    This is the normal behavior or is it a bug? I think that the worker should have the same app as application storage directory that integrate it (especially when you set giveAppPrivileges = true in the createWorker method)

    Thank you

    (and sorry for my English)

    Hello

    Having worked with several workers on my own project, I had the same behavior.

    The solution I found was to set a property that is shared on the worker and the native path of the application.

    So, on the key worker, you get the native path of applicationStorageDirectory and then set the property shared on the worker.

    It will be useful.

    Kind regards

    Leo

  • Access/working directory of the script path?

    Hi all

    Came across an interesting behaviour regarding the path of working within AE scripts directory.  When a range of the object / global, directories are compared to the DDT in the script itself.  However, within the scope of an eventHandler... in my case onClick function... directories are related/Volumes /.  In the code:

    File1 var = new File ("tmp");

    Alert (file1.fsName) is translated by "/ Applications/Adobe After Effects CS6/Scripts/ScriptUI Panels/tmp".

    button.onClick = function() {}

    File2 var = new File ("tmp");

    Alert (file2.fsName) is translated by "/ Volumes/tmp".

    }

    I'm curious to know why the DDT changes in this situation.  I know I can get the pwd via. Filename $ and as the file name.  Is there another way to determine the DDT? A way to ensure that the DDT will be the directory of the script within the eventHandler?

    I can work around this problem, but want to understand as much as I can to see if there are other options and best practices.


    Thank you!

    Calvin

    Featured is released without having to analyze the path of the file manually.  Pretty simple/straightforward...can't believe that I don't think that this earlier...

    var path = (new File($.fileName)) .path;

    Welp... who puts that to bed!

  • problem with the work only half of the extended keyboard

    have had 2 keyboards with the same problem. They both lost the use of the middle of the keyboard section.

    I would like to test the 2 keyboard in another computer, it doesn't have to be a mac, that a windows box works very well with the mac keyboard

  • Problem with adblocker working on reboot & recording is not some prefs.

    First issue: Adblocker works fine when first installed. Then if FF is closed and reopened it SAYS it is enabled, but it does nothing. I have to go to the addon menu to disable and enable it to make it work again, when it works fine. It's really annoying, having to do that. Some comes with FF not anti-ad.

    Second: FF won't save preferences involving a "do not show this message again" ticking box, i.e. with the closure of several tabs, browsers private, etc. All other prefs to record properly. And Yes, I read the FF won't save prefs section and tried all this; l it does not work.

    If you don't keep changes after a reboot then see:

    Create a new profile as a test to see if your profile is the source of the problems.

    See "create a profile":

    If the new profile works then you can transfer files from a profile in the new profile, but make sure not to copy corrupted files.

  • address bar problem - doesn't work does not correctly!

    pressing enter does not work when entered a site address, you must manually, click the 'go '. also select address drop down bookmark updates only the address of the site in the address bar and you have to press 'go' to get the site to load. If I use the bookmark button in the toolbar, it opens the list and I can click on a bookmark and it will load as usual. Help, please!

    This problem may be caused by an extension of AVG (AVG Safe Search).

  • My Imac of USA in Australia with any problem going to work?

    Please let me know if I have enough new Imac Desktop of USA works without any problem in Australia?    Thank you all

    It works perfectly in any country with electricity. Just a simple form of adaptation.

Maybe you are looking for