NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

RunState.Engine.FindFile(... any problems known?

Hi all,

I have a problem that surely would be pointless to hand in to support because I'm sure it's not really reproducible. But maybe someone else observed the same behavior.

In TS2016f2 I'm calling

RunState.Engine.FindFile([AbsolutePathToVI], Locals.FoundPath, False, FindFile_PromptDisable, FindFile_AddDirToSrchList_No, False, Nothing)

4 times for 4 different VIs to check if they exist and if I may call them later on.

In my test setup I know that all VIs are at the paths where I expect them and none of the VIs is broken. All paths are custom (not system paths) and access rights are not an issue. All paths contain spaces and underscores.

Three of the VIs return TRUE while one returns FALSE.

If I set FindFile_PromptEnable, give only the VIs name and navigate to the VI then the call returns TRUE and Locals.FoundPath contains the exact path string I originally used. I even tried to copy that string into the first parameter and repeat the call - the result was that the VI couldn't be found.

 

Interestingly: When I then tried this statement

RunState.Engine.FindFile([JustMyVIsNameWithoutPath], Locals.FoundPath, False, FindFile_PromptEnable, FindFile_AddDirToSrchList_No, False, Nothing),
Locals.Local = RunState.Engine.FindFile(Locals.FoundPath, "", False, FindFile_PromptDisable, FindFile_AddDirToSrchList_No, False, Nothing)

the VI was found in the second call after I just had to click it in the prompt during the first call. Again, copying FoundPath manually didn't give me a path that made the call succeed.

 

Is there anything obvious I'm missing?

0 Kudos
Message 1 of 4
(2,237 Views)

Backslash is an escape character.  Could that be your problem?   When you paste a full path it has backslashes.  When you just use the VI name without the path it works?  My guess is you need to escape the backslashes correctly.

 

"C:\\Test\\My.vi" vs "C:\Test\My.vi"  will yield completely different things.

 

My 2 cents,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 4
(2,204 Views)

Thanks, ~jiggawax, for your reply and sorry for my late answer.

Your hint sounds right (as expected I missed something obvious) but I can't check with my office setup until begin of next year.

That is because I'm running the watchdog-task for the new child process in the my.family-object... 😉

0 Kudos
Message 3 of 4
(2,143 Views)

@Bluegraf wrote:

 

That is because I'm running the watchdog-task for the new child process in the my.family-object... 😉


Congrats.  I hope it returns a True for success!!!

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 4
(2,131 Views)