NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find Configuration file in teststand using FindFile() Function

I am trying to search configuration file from teststand. When I execute the sequence it is showing me error as shown below. How to resolve this error? Error in call to TestStand API member 'IEngine.FindFile'. Specified value does not have the expected type.[Error Code: -17308, Specified value does not have the expected type. ]  

0 Kudos
Message 1 of 6
(2,725 Views)

Probably one of the parameters of the FindFile function is not correct, can you show us how you use the function?

0 Kudos
Message 2 of 6
(2,723 Views)

Thanks for reply..

 

I used function as below:

Locals.FileFound =RunState.Engine.FindFile ( "154M2-105-0_02.csv", Locals.absolutePath, Locals.userCancelled, FindFile_PromptHonorUserPreference,  FindFile_AddDirToSrchList_Ask, False, "154M2-105-0.seq")

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

The last parameter is wrong it must be a Sequence File object, try RunState.SequenceFile instead of "154M2-105-0.seq".

0 Kudos
Message 4 of 6
(2,702 Views)

Hi,

 

I used below syntax for FindFile() function and it worked fine

 

Syntax:

Boolean FindFile(String fileToFind, Boolean useCurSeqFileDir = True, [String PathToFile], Number promptFlag = 1, Number searchFlag = 1, [Out] [Boolean canceled], Boolean isCommand = False)

 

Expression used :

FindFile ("154M2-108-0_02.csv",True, FileGlobals.absolutePath,1, 1, FileGlobals.userCancelled,    False )

 

 

Thanks for the help....

 

 

Sanket

0 Kudos
Message 5 of 6
(2,695 Views)

Yes that will work as well because the parameter is optional. See http://zone.ni.com/reference/en-XX/help/370052M-01/tsapiref/reftopics/engine_findfile_m/ for details about FindFile

 

0 Kudos
Message 6 of 6
(2,667 Views)