VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Veristand API - System.AccessViolation

Spoiler
I'm using the Veristand API (python) to programmatically create a system definition file. Whenever I try to add a model with a model path that points to a .so file, I get the following error:

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at NationalInstruments.VeriStand.Internal.MdlWrapInternal._InitializeModel(Int32 library, Double finalTime, Void* timeStep, Void* numberOfInports, Void* numberOfOutports, Void* numberOfTasks)
   at NationalInstruments.VeriStand.Internal.MdlWrapInternal.InitializeModel(Int32 library, Double finalTime, Double& timestep, Int32& numberOfInports, Int32& numberOfOutports, Int32& numberOfTasks)
   at NationalInstruments.VeriStand.SystemDefinitionAPI.ModelSupport.MITModelLoader.InitializeModel(Double finalTime, Double& timeStep, Int32& numInports, Int32& numOutports, Int32& numTasks)
   at NationalInstruments.VeriStand.SystemDefinitionAPI.Model.LoadModelAndSetProperties(String ModelPath)
   at NationalInstruments.VeriStand.SystemDefinitionAPI.Model.ImportModelInformation(String ModelName, String ModelPath, UInt16 InitialState, Boolean ImportParameters, String ParameterRegularExpression, GlobalParameterScopes GlobalParameterScope, Boolean ImportSignals, String SignalRegularExpression, Boolean ImportOnlyNamedSignals, Error& error)
   at NationalInstruments.VeriStand.SystemDefinitionAPI.Model..ctor(String Name, String Description, String ModelPath, Int32 Processor, Int32 Decimation, UInt16 InitialState, Boolean SegmentVectors, Boolean ImportParameters, String ParameterRegularExpression, GlobalParameterScopes GlobalParameterScope, Boolean ImportSignals, String SignalRegularExpression, Boolean ImportOnlyNamedSignals, UInt32 NIVeriStandServerPort)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Python.Runtime.MethodBinder.Invoke(BorrowedReference inst, BorrowedReference args, BorrowedReference kw, MethodBase info, MethodBase[] methodinfo)
   at Python.Runtime.MethodObject.Invoke(BorrowedReference target, BorrowedReference args, BorrowedReference kw, MethodBase info)
   at Python.Runtime.MethodBinding.tp_call(BorrowedReference ob, BorrowedReference args, BorrowedReference kw)
   at Python.Runtime.Runtime.PyObject_Call(BorrowedReference pointer, BorrowedReference args, BorrowedReference kw)
   at Python.Runtime.ManagedType.Init(BorrowedReference obj, BorrowedReference args, BorrowedReference kw)
   at Python.Runtime.ClassBase.Init(BorrowedReference obj, BorrowedReference args, BorrowedReference kw)
   at Python.Runtime.MetaType.tp_call(BorrowedReference tp, BorrowedReference args, BorrowedReference kw)​

There is no problem when importing the model(s) in Veristand itself, only when using the API. I'm running Windows 11, but that hasn't been an issue otherwise when using Veristand.

Has anyone run into this?

 

0 Kudos
Message 1 of 1
(96 Views)