04-06-2018 01:45 AM
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. ]
04-06-2018 01:53 AM
Probably one of the parameters of the FindFile function is not correct, can you show us how you use the function?
04-06-2018 02:07 AM
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")
04-06-2018 05:31 AM
The last parameter is wrong it must be a Sequence File object, try RunState.SequenceFile instead of "154M2-105-0.seq".
04-06-2018 09:08 AM
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
04-09-2018 01:45 AM
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