I have the following situation, where I am unable to realize this in a method:
For a station, I would like to assign certain parameters for a failure by a method. Therefore a table is prepared containing the name, the pointer to the object, the particular failure profile and in the subtable, the parameters for start, stop, interarrival time interval and duration. The availability / MTTR approach is not sufficient.
I want to use more than one failure profile being parameterised by the table lines. Therefore the easy way to use the easy approach (FailureDuration etc.) is no option.
How can I use the "setParam" command to alter the parametres providing the appropriate path to the attribute from the table of failures as described in the online help? When I try to concatenate the different cells in a row and converting the result to an object, I am failing because of addressing an attribute.
Solved! Go to Solution.
Why is it not possible to answer a single question, but immediately questioning the way someone else is working with PlantSimulation outside of the Siemens playgrounds?
Among a certain amount of other reasons, I found the table not intuitive at all. When providing the approproiate data using "setParam" I was expecting, that a PlantSimulation internal check may point out, if there is a mistake left in the parameterisation. Just concatenating the parameters to a string without any possibility to validate is by far not what I regard as user friendly and effective.
Apparently because you're way didn't work ...
I tested the setparam and it didn't work in the "failure" constellation
so I suggested the settable solution as the best solution.
It is not clear to me , why it is more effective for you
to write parameters into a table and then try to use - in a further step
setparam with concatenated table parameters- to set the failure profiles.
settable does this in one step
So this means, the corresponding description in the helpfile, which I was trying out for the last two days is just rubbish?
I know better ways to waste my time.
There seems to have been a missunderstanding were I / how I tested the setparam (failure level) and
where you expected then to work ( attribute level).
In any case I checked the "help" screen shots and they work. s. attachment
SetParam works exactly as documented in the online help. I do not know what you are doing wrong, because you never showed us your SimTalk code. Maybe you just entered the path to the failure profile instead of the full path to one of the 4 times of the profile (Start, Stop, Interval, Duration).
You could use setTypeAndAttr instead of setParam. This method always expects 2 strings. The first string is the distribution type, and the second string is for the distribution parameters.
SingleProc.Failures.Failure1.Interval.setTypeAndAttr("Negexp", "45:00") SingleProc.Failures.Failure1.Duration.setTypeAndAttr("Erlang", "5:00, 3:30")
Ok, so now it works.
Anyway this brings me back to my original question posted at the beginning: How can I use this or the setParam command if I have everything related to including the path stored in a parametre table (see initial posting).
I wasn't able to properly concatenate the particular command line as provided in the example above using the information from the table cells and couldn't find any hint on this problem in the online help. The recent replies above aren't helping me in any way.
If you have the entire path to the failure profile in a string, the only solution I can think of is to use the execute statement:
var path : string := "SingleProc.Failures.Failure1"
var type : string := "Uniform"
var para : string := "1, 5:00"
execute(to_str(path, ".Duration.setTypeAndAttr(\"", type, "\", \"", para, "\")"))
Thanks, that seems what I was looking for. Gonna check it in near future.
I guess, it's SimTalk 2.0, but it shouldn't be a problem to apply it to SimTalk 1.0.