VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Stimulus Profile with Veristand API leads to failing test

Solved!
Go to solution

I wan´t to call a stimulus profile file programmatically. I discovered that there is no VI for that in the LabVIEW VeriStand API (for the legacy stimulus profile editor such a VI exists). But in the Example finder exists a VI which uses the .NET VeriStand API to acomplish this (http://forums.ni.com/t5/NI-VeriStand/Start-Stimulus-Profile-from-LabVIEW/m-p/1789162). Furthermore someone created a Custom Control for the workspace which uses this .NET invoke (http://www.ni.com/example/31335/en/). Both examples work in general but I have one problem which i´m not able to fix:

 

 If I use a "Update Model Parameters From File" step in the stimulus profile to change the parameters of a model the step is going to fail with the error: "Error: -307650. Details: Object reference not set to an instance of an object." This only happens if i use the .NET VeriStand API invoke to call the stimulus profile. If I start the stimulus profile out of the Stimulus Profile Editor this error doesn´t occur and the Model Parameter Update works correctly.

If I delete the "Update Model Parameters From File" step the whole stimulus profile passes just fine.

 

Has anyone an idea how to fix this issue or how to programmatically call a stimulus profile file with the VeriStand API? Thanks for any suggestions in advance and have a nice day.

 

H.

0 Kudos
Message 1 of 3
(5,700 Views)
Solution
Accepted by topic author Felmer

I can reproduce what you are seeing. You can work around this very quickly by making a call to the StimulusProfile method CheckForErrors before starting its execution. This method is called by the Stimulus Profile Editor before it starts execution, and it must have some side-effect that causes the Update Parameters step to work correctly.

Jarrod S.
National Instruments
Message 2 of 3
(5,689 Views)

Thank you for that workaround. It works like a charm.

Is there a recommended way to load a stimulus profile from file and execute it? I think that the depracation of the legacy VI "NI VeriStand - Rum Stimulus Profile.vi" and not building a comparable new VI has an intention in terms of how to use the API or did this happen only by accident?

 

Thanks for the quick help!

H.

0 Kudos
Message 3 of 3
(5,675 Views)