05-02-2019 03:45 PM - edited 05-02-2019 03:47 PM
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
Solved! Go to Solution.
05-03-2019 08:57 AM - edited 05-03-2019 08:59 AM
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.
A corrected example is attached.
Cheers,
Mr. Jim