Why Can't I Read/Write Files When I Put My Executable on my FieldPoint Controller? Primary Software: LabVIEW Development Systems>>Full Development SystemPrimary Software Version: 8.5 Primary Software Fixed Version: N/A Secondary Software: N/A Hardware: FieldPoint>>Controllers/Network Modules
Problem: When I choose my FieldPoint controller as my execution target, I can successfully read and write files. When I build my VI into an executable and put the EXE on the FieldPoint controller (e.g., a startup executable), I cannot read or write files. What am I doing wrong? Solution: One of the most common causes of an executable not functioning properly is a problem with incorrect file paths. For example, if you are using the Current VI's Path followed by a Strip Path function to obtain the folder where the program resides, this behaves differently when running the program is an executable versus a VI. Let's say that myApp.vi is located at C:/temp/myApp.vi. The Current VI's Path is C:/temp/myApp.vi, just as you would expect. However, if you build that VI into an executable called myEXE.exe, then the Current VI's Path will be C:/temp/myEXE.exe/myApp.vi. In order to get the path to the folder where the EXE resides, you must Strip Path twice. ![]() Alternatively, the path of the EXE folder can be obtained by using Open Application Reference property node, as seen below. Related Links: KnowledgeBase 2QMEG8KT: Memory Definitions for FP-20xx: Nonvolatile, CompactFlash, DRAM, User Accessible KnowledgeBase 18RDJ60O: Why Does My Executable Not Work When Using the Current VI's Path Constant? Attachments:
Report Date: 03/18/2005 Last Updated: 08/08/2007 Document ID: 3JHBALPH |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

