LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executable 2501 Error

Hello,

 

I am currently attempting to troubleshoot errors with an executable that I have written. I want the executable to start running and log data from a usb 6009 device. 

 

When my script begins running I receive error 2501. When I run my script not as an executable, it runs just fine. can someone help? I have attached my script. 

 

Thanks,

 

Mmoon

0 Kudos
Message 1 of 6
(3,737 Views)

Are you sure it is erro 2501 and not -2501?  Because the negative makes a difference and that error is related to an invalid TDMS file reference.  What kind of error handling are you doing?  I'm guessing a path isn't right and it becomes invalid, but your code tries to use it and generates more errors related to not having a valid reference.  You can try to debug your application using some debugging techniques that show you the block diagram of a VI inside an EXE.  This allows you to probe and find where the error is coming from and why.

 

http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/debug_apps_dlls/

 

Other than that you are going to need to attach some code showing what you are doing.  I'd me most interested in any part of the code relating to path manipulation.

 

EDIT: Oh sorry I didn't see the posted code.  Does the log file get created properly?  Is there a write permission issue with where the log is going to be written to?  Do you know what function generates the error?

0 Kudos
Message 2 of 6
(3,734 Views)

Hey Hooovahh,

 

you are correct that it is error -2501. I haven't really done any error handling, my VI ran perfectly fine when it was not an executable so I wasn't worried about seeing errors. No worries about the code.

 

THe error is generated by the TDMS File viewer VI and the TDMS get properties VI. I am not sure, but there could be an issue with where the log is being written to, im not really sure how to test these problems.

0 Kudos
Message 3 of 6
(3,730 Views)

Hey again Hooovahh,

 

Would it make a difference if I added a shift register to the application directory VI wire? Please let me know.

 

 

0 Kudos
Message 4 of 6
(3,722 Views)

What good do you think the shift register will do for you?  The path that the Application Directory returns doesn't change inside the while loop.  Not sure if you read the help but it has this to say.

 

Spoiler

If you call this VI from a stand-alone application, this VI returns the path to the folder containing the stand-alone application.

 

If you call this VI from the development environment and the VI is loaded in a LabVIEW project file (.lvproj), this VI returns the path to the folder containing the project file. If the project is not saved, this VI returns <Not a Path>.

 

If the top-level VI is not loaded in a project, the VI returns the path to the directory containing the top level VI. If the VI is not saved to disk, this VI returns <Not a Path>.

With this information I'd say you are using it correctly.  BTW you never mentioned if the file is actually being created or not.  If it is not I'd suggest just temporarily replacing that function with a path to a folder you know you can write to like C:\Temp and see if the files get created there.

 

Also I noticed that if there is an error with your TDMS open, or the List contents, then you won't know it, since that Error Out is unwired, it should be wired to the input of the Get Properties (or remove all of this since all you are doing is getting the properties but then doing nothing with it).  If there is an error with opening the file this will tell you, if there is an error with writing the file, I am unsure where that would be seen other than the file isn't created.

 

If I drive my car to work and I didn't get into an accident, that isn't reason to not wear a seat belt.  Similarly if I don't get an error when I run my code one way, it doesn't mean error handling isn't important, it just means I didn't get into an accident yet.

0 Kudos
Message 5 of 6
(3,700 Views)

Not sure what you are doing with File/Directory Info as none of its output node is used.

 

As a easy way debugging, Use the path as indicator and build as an executable, which will provide you the whether the path used during Executable and  code is same or different.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 6
(3,676 Views)