STD transition time as variable

Moderator: Moderators

STD transition time as variable

Postby james.e.hopper@leidos.com » Thu Oct 11, 2018 7:15 pm

All the examples i can find for a time transition in an STD use numerical time in the "after(1 second)" transition definition (for example). What i want is to store in the block that this STD is part of a variable that contains the time so that in the STD i can do "after(timeDelay)" or something like that and it will transition after the number of seconds defined in "timeDelay". The result i get is that it seems to transition pretty much immediately. I thought perhaps it didn't know what units i was storing the time in, so i added the unit seconds to the value parameter "timeDelay" in the block. This did not help. To test my theory that it was using units of milliseconds i set timeDelay=6000. Now i get a 6 second delay, which verifies my theory. When I do "after(timeDelay)". If I do "after(timeDelay seconds)" the simulation locks up.
james.e.hopper@leidos.com
Forum Beginner
Forum Beginner
 
Posts: 26
Posts Rating:1
Joined: Thu Apr 13, 2017 11:02 am

Re: STD transition time as variable

Postby chanon_s » Tue Oct 16, 2018 1:45 am

Dear James

What CST version are you using? If it is 18.5 or below, you need to use the abbreviations of time units. For example, ms for milliseconds, s for seconds, etc. So, in your case, please use

Code: Select all
timeDelay s


In addition, the default time time unit is millisecond if there is no postfix time unit.

However, the time units are fully supported since CST 19.0. In such version and later, you can use s, sec, second, or seconds for the second time unit.

Sincerely

Chanon S.
No Magic Customer Support
chanon_s
Customer Support
Customer Support
 
Posts: 91
Posts Rating:7
Joined: Thu Dec 04, 2014 2:21 am

Re: STD transition time as variable

Postby david.f.dickie@collins.com » Mon Feb 25, 2019 3:36 pm

Hello,

I'm currently using version 19.0 SP1, and I can get a state diagram to transition using a variable as the transition trigger, i.e. after( timedelay s). However, with my model I have a system block with composition relationship to blocks A, B, and C, each block has its own independent state machine as the classifier behavior. My execution target for my simulation is my system block. In this scenario, if I hard code the time event transition trigger in each of the lower level state machines (A,B,C) the simulation runs as expected with the transitions happening as coded. When I attempt to use a variable for the time event transition, the event is never triggered. Any ideas?
david.f.dickie@collins.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:1
Joined: Tue Jan 22, 2019 12:05 pm

Re: STD transition time as variable

Postby chanon_s » Tue Feb 26, 2019 12:36 am

Dear James

Could you please send us the sample project you are working with to see what you would like to do?

Sincerely

Chanon S.
No Magic Customer Support
chanon_s
Customer Support
Customer Support
 
Posts: 91
Posts Rating:7
Joined: Thu Dec 04, 2014 2:21 am

Re: STD transition time as variable

Postby david.f.dickie@collins.com » Tue Feb 26, 2019 8:11 am

Hello Chanon,

Just a note, I'm not James, I tacked onto his post since I felt it was related.

I've uploaded a sample of what I'm trying to do. The model has two simulation configurations, one for the full system and the other for the individual block (subsystem). If you run them both you'll see that the subsystem block executes properly with the transition trigger using the block property for the interval. The system simulation does not execute using variables for the transition triggers, however, if they are swapped out for hard coded variables the simulation runs as expected.

David
You do not have the required permissions to view the files attached to this post.
david.f.dickie@collins.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:1
Joined: Tue Jan 22, 2019 12:05 pm

Re: STD transition time as variable

Postby chanon_s » Wed Feb 27, 2019 2:12 am

Dear David

I am sorry for replying to the wrong name, I did not notice that the post came from you.

Thank you for sending us the sample project. After the investigation, It seems to be an issue in our plugin. We have registered this issue into our bug tracking system and will have it fixed into the near release.

However, please consider adding an additional state after the initial node in each state machine diagram, as a work around, as displayed in the image below:

workaround.png


We are sorry for the inconvenience this issue has caused.

Sincerely

Chanon S.
No Magic Customer Support
You do not have the required permissions to view the files attached to this post.
chanon_s
Customer Support
Customer Support
 
Posts: 91
Posts Rating:7
Joined: Thu Dec 04, 2014 2:21 am


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests