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: 25
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: 89
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