NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling SearchFiles Method From LabVIEW - "Incorrect Function"

Solved!
Go to solution

Hi there,

I'm trying to build a search tool for developers within my organization, and one of the major components of this tool is the ability to search directories of TestStand sequences.

 

I'm calling the IEngine method, "SearchFiles" from LabVIEW, but no matter what I do I get error 1, "Incorrect Function".  I've attached my code.

 

I'm trying to use the most basic set of options, but I can't seem to get this off the ground.

I know that I'm getting the variant encoded properly, since my variant format matches the one that is created using a TestStand file dialog call, and I've used that code before successfully.

 

Is there something I need to do with the Engine to get it into a state whereby it is able to run this method?

 

(FYI - code is in LabVIEW 2017 and is using the TS 2017 API)

 

Thanks very much,

Mr. Jim

0 Kudos
Message 1 of 2
(2,614 Views)
Solution
Accepted by topic author Mr._Jim

Ah, I figured it out. When providing null inputs to the variants, the variants must be of proper type.

I created an empty string array and an empty reference array and then casted them to variants, and it worked.

 

I also learned that in this instance it's not necessary to natively encode variants for TestStand. They seem to translate just fine from a LabVIEW variant.  (This is not always the case in my experience.)

 

"Incorrect Function" is not a very informative message, though. Smiley Wink

 

A corrected example is attached.

 

Cheers,

Mr. Jim

0 Kudos
Message 2 of 2
(2,586 Views)