VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Ramping faulted parameter in Stimulus profile editor.

Solved!
Go to solution

Hi,

I'm trying to get grips with the new Stimulus profile editor and are having a problem that I don't know how to solve.

I have a parameter driven by a model. In one of my testcases I want to do a fault on this parameter and the fault should ramp the value exactly like the ramp function.

Can I do this within the Stimulus profile editor itself or how do I do it?

 

/Johan

0 Kudos
Message 1 of 7
(6,056 Views)

Howdy Johan,

 

Of course, You can. You can find the ramp up function under Real time sequence library in the Sequences panel.  All you need to do is to assign the parameter, Initial value, final value and the Ramp duration. In case, if you are using a Sequence file u need to create a Parameter(either int or double) variable and assign the model parameter to the variable. In case of Fault insertion I suggest to use the CSV format profile, Where u need to assign the headers for fault insertion. You can find enough details under Using CSV Files to Stimulate, Fault, and Evaluate Channels topic in Help File.

 

-SID

0 Kudos
Message 2 of 7
(6,051 Views)

Hi Siddhu and thanks for the advice.

I have alredy used the ramp function with success, but in this case I first want to override (fault) the a modeI which is mapped to that parameter and always has a "correct" behaviour and test a "not correct" behaviour.

I have seen that you could do as much with the CSV format but I had hoped that you could do this inside the .nivsseq file directly.

Also it seems that in the csv case I have to specify every value that I want the parameter to get and at which point. In the ramp case I only have to specify start,stop and duration which I prefer because it saves me time when doing long ramps.

So is it possible to make a ramp on a faulty parameter inside the .nivsseq file or do I have to go the hard way through the csv way and specify every sample?

/Johan

0 Kudos
Message 3 of 7
(6,048 Views)
Solution
Accepted by topic author JohanS

You can do this with a custom real-time sequence. The easiest way would be to make a copy of the built-in Ramp sequence and modify it slightly to do a fault of the output parameter instead of a simple assignment. You can open this sequence simply by double clicking it in the sequences palette. If you open the Ramp real-time sequence in the standard library, you'll see the line where it assigns the current ramp value to the output parameter:

 

RampOut = (i * Increment) + InitialValue

 

All you have to do to change this from a standard assignment to a fault assignment as follows:

 

fault(RampOut, (i * Increment) + InitialValue)

 

Note there is a bug in the real-time sequence virtual machine that might not completely fault a channel in the system unless another channel is currently faulted. The easy workaround is to create a dummy User Channel and fault it from the Channel Fault Manager dialog for the duration of your test.

Jarrod S.
National Instruments
0 Kudos
Message 4 of 7
(6,039 Views)

As a follow-up, don't forget to clear the fault in your sequence as your test requires. To do that, you'll need to call the clearfault function on the parameter that was originally faulted. Depending on your test requirements, this could take place in your modified Ramp sequence or the caller of the modified ramp sequence. Or you might just leave the channel faulted throughout the sequence execution and then clear the fault later from the Channel Fault Manager dialog. That will work, too.

Jarrod S.
National Instruments
0 Kudos
Message 5 of 7
(6,033 Views)

Thanks Jarrod,

This was exactly what I was looking for. I will try it out and let you know how it works out.

Thanks

/Johan

0 Kudos
Message 6 of 7
(6,029 Views)

Hi again,

I tried your solution Jarrod and it works perfectly!

Exactly what I was looking for, thanks a lot!

 

/Johan

Message 7 of 7
(6,014 Views)