11-07-2011 01:36 AM
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
Solved! Go to Solution.
11-07-2011 07:33 AM
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
11-07-2011 07:55 AM
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
11-07-2011 08:45 AM
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.
11-07-2011 08:51 AM
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.
11-07-2011 08:54 AM
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
11-08-2011 06:11 AM
Hi again,
I tried your solution Jarrod and it works perfectly!
Exactly what I was looking for, thanks a lot!
/Johan