Page 1 of 1

Passing a parameter to a transition with a operation

PostPosted: Fri May 21, 2021 12:35 pm
by redgatornm
I have a simple model Cameo 19 Sp2 that triggers a transition on a second object state machine using an operation and a callevent.

When I add a parameter to the operation, the operation no longer triggers the transition.

I'm trying to emulate a bus operation, with a parameterized event that might trigger a specific recipient and not others.

I'm probably just making too much use of my white cane...

Re: Passing a parameter to a transition with a operation

PostPosted: Fri May 21, 2021 12:48 pm
by saulius_p

Good to talk to you! Could you attach small sample and indicate what you execute and what is not working?


Re: Passing a parameter to a transition with a operation

PostPosted: Sun May 23, 2021 8:31 am
by redgatornm
First, thank you.

I've love to, but my Cameo is behind a firewall and it is almost impossible to export anything. On top of that, anything I build or import gets polluted with corporate proprietary stuff I couldn't share if I wanted to.

However, it's not hard to demonstrate. In fact, I started with SignalEvent and moved on to try CallEvent, and both demonstrate this behavior, so I'll go back to SignalEvent.

Take the sample simulation "FlashingLight.mdzip". Add an attribute to the "start" signal. I generally add an Integer attribute with the name "slot" and a default value of 23.

The simulation will no longer operate, stalling at the point where the "start" signal should be triggering the transition in TImer from Off to Ticking.

If you remove the attribute, the simulation will then operate again. So the attribute is toxic. No errors, no nothing, and no operation.

If I understand the use of attributes, I should think I can decide to trigger on a signal if the attribute is matched. This would be the "bus" emulation: a signal "command" sent to a number of blocks which will only trigger certain blocks.

It's like the logic is "if signal happens and the signal has no attributes then trigger" and "if the signal happens and the signal has attributes and we don't know how to deal with the attributes, don't trigger". I don't find this behavior described in the documentation. Neither do I find an example that shows how to make use of attributes.

Modified to use a CallEvent, if you have no Parameter on the Operation, the simulation operates. If you add a Parameter to the Operation, the simulation stalls at the CallEvent with the Parameter defined (but not otherwise used).

And no errors produced in either case (as far as I've been able to tell).

They've promised training, but the training is not soon or certain, and they are expecting us to make use of this tool.

Re: Passing a parameter to a transition with a operation

PostPosted: Mon May 24, 2021 12:44 pm
by saulius_p

Please find working flashlight sample with signal parameter and video attached.

Here are also videos displaying other attached samples:

Let us know if you have any more questions or issues.

Kind regards,

Re: Passing a parameter to a transition with a operation

PostPosted: Tue May 25, 2021 7:17 am
by redgatornm
Most excellent! I will post back when I've had a chance to work through these...

Update: Using "flashlight with parameter" as the exemplar - OK, my simpler-than-flashlight CallEvent case actually continues past the parameter definition now by adding an opaque action to define the value. That's very interesting how a defined parameter with an undefined value makes a CallEvent no longer a functioning CallEvent.

Update: OK, my simpler-than-flashlight SignalEvent case actually continues past the attribute definition now by adding an opaque action to define the value. A default value defined is not adequate to make the SignalEvent a valid SignalEvent, there must be an opaque action (or, I would hope, some other information source to define "slot") to make the SignalEvent trigger the transition.

I think I attempted to use an OpaqueAction before, but did not populate the Body (tried something, not remembering now...) and it had no effect...

Update: it is only necessary to define an OpaqueAction with an output pin and attach it to the SendSignalAction input pin; nothing has to be defined inside the OpaqueAction for the signal to trigger the transition.

Examining "send signal with property 2", you used a ValueSpecificationAction to feed a value to the SendSignalAction. THIS is what I attempted to use and could not remember. However, it did not work for me...

And I attempt to apply the ValueSpecificationAction in the place of the OpaqueAction, and it lies there like a dead fish... the only difference is that I'm sending the signal over a Port and your example does not.

This is feeling like playing a game of FizzBin... is it Tuesday yet?

It's a ROYAL FIZZBIN! Apparently trying things leaves little turds around that quietly make the simulation stall. Kinda like leaving a semicolon out. Sometimes. I cleaned up the turds, and I now have a flashlight simulation where I have BOTH a ValueSpecificationAction and an QpaqueAction in the same activity - and I can connect either one to the SendSignalAction and the simulation will run...

Yeah! ... ripts+APIs ALH.getvalue($signal$, "value") - get the value "value" from "The last signal Instance in an Event pool of a specified object." - not clear how the object has been "specified" - is this a contextual thing?

BEST AND FINAL - WOOPIE! And now I've cranked what you've taught me back into my IPMI bus model addressing multiple blocks with a single parameterized signal and only the addressed block is responding.

Guard on Transition: ALH.getValue($signal$, "slot") == 9 && ALH.getValue($signal$, "command") == "activate"

Now I have to learn how to create classes and parameterize model components - which is what I think you've provided in the third example "sending signal with multiple parameters"...

Thank you very much!

labai ačiū!

Re: Passing a parameter to a transition with a operation

PostPosted: Tue May 25, 2021 12:25 pm
by saulius_p

Thank you for the feedback. Sorry for the challenges you see. We do have Simulation 5 days training which would be very very helpful but it is for 12 people class. Let us know if this is of interest.

Between there is good samples on parametric diagram in samples provided with tool and online at:

and more in MBSE Execution channel on Youtube.