ASAM XIL Steps for NI TestStand 设置/读取 Inport 或 Outport 数组数据类型报错

更新 Oct 24, 2023

适用于

软件

  • VeriStand
  • TestStand
  • ASAM XIL TestStand Steps

问题详述

我在 VeriStand 中创建了模型,其中包含 inport 和 outport 的数组数据类型。

TestStand 能够使用Framework Set/Get Variable Values step 识别数组数据类型,并且 check expression 显示没有错误。

但是,当我执行 TestStand sequence 时,它显示错误,如下所示:
----------------------------------------
Details:

Error executing substep 'Post'.
Could not write the variable Targets/Controller/Simulation Models/Models/Model 2/Inports/Inport. Vendor Description: 
Stack Trace:
   at ASAM.XIL.Implementation.VeriStand.TestBench.MAPort.NIVSMAPort.Write(String variableName, IBaseValue value)
   at ASAM.XIL.Implementation.XILSupportLibrary.Framework.Variables.FloatVectorVariable.Write(IList`1 value)
   at NationalInstruments.AsamXilSteps.AsamXilPlugin.StepWrappers.FrameworkSetVariableValuesStepWrapper.Execute(SequenceContext sequenceContext)
   at NationalInstruments.AsamXilSteps.Core.RuntimeManager.DoExecute(StepWrapperBase stepWrapper, SequenceContext sequenceContext)
   at NationalInstruments.AsamXilSteps.Core.RuntimeManager.ExecuteStep(SequenceContext thisContext, String stepWrapperId)

Inner exception:
This DataArray does not represent a scalar double.
Stack Trace:
   at NationalInstruments.VeriStand.DataArray.ToDouble()
   at ASAM.XIL.Implementation.VeriStand.TestBench.GatewayBindingManager.SetChannelValue(String channel, IBaseValue newValue, Boolean synchronous)
   at ASAM.XIL.Implementation.VeriStand.TestBench.MAPort.NIVSMAPort.Write(String variableName, IBaseValue value)


----------------------------------------
Error Code:

0; User-defined error code.
----------------------------------------
Location:

Step 'Framework Set Variable Values' of sequence 'MainSequence' in 'Sequence File - Model 2.seq'
----------------------------------------

解决方案

ASAM XIL Steps for NI TestStand 仅支持将 inport 和 outport 作为Segment into scalar channels,当设置为 Maintain as vector channel 时,会弹出错误。

请确保 Vector port specification 配置为 Segment into scalar channels。

相关信息

仅模型中的 parameter 支持设置为Segment into scalar channels 和 Maintain as vector channel 。