From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Property loader and translator

Solved!
Go to solution

Hi all,

I'm using a translator to convert xlsx to seq format. And it's working perfectly.

But I'm trying to use Property loader feature. When I launch the tool, I get an error( see below the call stack)

The property loader calls "CanTranslate" function of my translator (ExcelTranslator.dll) by passing argument file name : "C:\Program Files (x86)\National Instruments\TestStand 2019\Components\PropertyLoader\DocumentFormat.OpenXml.dll"

My translator returns False because it can't translate this file.

So the property loader generates an exception

So, do I have to modify my translator, or is it a bug in TS?

Thanks for your help

 

 

An exception occurred inside the call to .NET member 'LaunchImportExportTool':
System.Runtime.InteropServices.COMException (0xFFFFBD34): An error occurred attempting to translate the file 'C:\Program Files (x86)\National Instruments\TestStand 2019\Components\PropertyLoader\DocumentFormat.OpenXml.dll' to a TestStand Sequence File.

The 'CanTranslate' callback in 'C:\Users\Public\Documents\National Instruments\TestStand 2019 (32-bit)\Components\Translators\ExcelTranslator.dll' returned the following error:
This file's format is not supported or you don't specify a correct format.
à NationalInstruments.TestStand.Interop.API.FileInformation.get_IsDotNetAssembly()
à NationalInstruments.TestStand.PropertyLoader.ManagedPluginDiscoverer.GetPluginModulesInDirectory(String directory)
à NationalInstruments.TestStand.PropertyLoader.PluginModules.RePopulatePlugins()
à NationalInstruments.TestStand.PropertyLoader.EntryPointsForStepSettingsPane.GetPluginsInformation(SequenceContext sequenceContext, Boolean forcePluginDiscover)
à NationalInstruments.TestStand.PropertyLoader.ImportExportTool.ImportExportTool..ctor(Engine engine, SequenceFile selectedSequenceFile, Sequence selectedSequence)
à NationalInstruments.TestStand.PropertyLoader.ImportExportTool.ImportExportTool.LaunchImportExportTool(SequenceContext context, SequenceFile selectedSequenceFile, Sequence selectedSequence)

0 Kudos
Message 1 of 3
(791 Views)

Hi, 

Can you post your implementation for "CanTranslate" API from ytour translator plugin?

 

If your implementation looks something like this,

try {
    *translationIndex = 0;
     return 1;
}
catch(...)
try to change it to check for the specific extension that you support. So something like:
try {
    if (std::string(extension) == std::string("xlsx ")) {
        *translationIndex = 0;
        return  1;
}
return 0;
}
catch(...)

 

Hope this helps, 

 

Regards, 

Anand Jain

NI

0 Kudos
Message 2 of 3
(759 Views)
Solution
Accepted by topic author maxmont

Hi,

I 've found my mistake.

I returned an error as string description.

In fact, NI recommand not returning an error just 0 as status.

 

Thanks

0 Kudos
Message 3 of 3
(753 Views)