02-22-2016 11:42 AM
I have written a .NET C# application that generates a TestStand Sequence file automatically using the API. FWIW I am using TestStand 2013 and LabVIEW 2013.
When I generate a new Step that calls a LabVIEW module am using code like this, sorry if you don't understand C# but it's pretty much the same in any language, the cyan strings are testStand API classes:
Step step = engine.NewStep(AdapterKeyNames.FlexLVAdapterKeyName,
StepTypes.StepType_S500NumericMeasurement);
// The Module is really a LabVIEWModule.
LabVIEWModule lvModule = step.Module as LabVIEWModule;
// Specify the VI to use.
lvModule.VIPath = viPath;
// Load the prototype for the module so that TestStand can map the IO terminals.
try
{
module.LoadPrototype(); // this opens the VI into the LabVIEW Runtime Engine
}
catch (COMException ex)
{
<snip>: handle the error
}
// Get the IO terminals:
LabVIEWParameters parameters = lvModule.Parameters;
I then go on to set the module parameters which are now available in 'parameters'. This all works fine except it is very slow because every time I call module.LoadPrototype() the TestStand engine painfully reloads all the dependent VIs even when I am using exactly the same VI as specified in 'viPath'. So the question is, does anyone know a way to make it cache the VI prototype?
02-23-2016 05:50 AM
I guess if I could tell LoadPrototype to ignore VI dependencies that would be a way around it, but I can't find a way to do that either - any other ideas anyone?