• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Adams
  3. Why doesnt "my" sensor trigger (although expression meets...

Following Cadence Design Systems’ acquisition of the Design & Engineering (D&E) business, the D&E Community Forum on the Nexus Community Center has been migrated in the Cadence Physical System Simulation Community. For more details and if you have any questions, please refer to the FAQ.

Stats

  • State Not Answered
  • Replies 4
  • Subscribers 3
  • Views 1
  • Members are here 0
More Content

Why doesnt "my" sensor trigger (although expression meets value), if its first activated during sim (before expression meets value)? If active right from the beginning of sim sensor does trigger. See simple model attached. Thanks!

BThielem
BThielem over 6 years ago
How can I build a sensor which is "not active" until a certain condition (e.g. time > value) is fulfilled?

Attached Files (1)
MODEL_1.cmd.zip
  • Sign in to reply
  • Cancel
  • Maziar R
    0 Maziar R over 6 years ago
    Hello,
     
    In general, if you need to use any modeling element at any point in the simulation, you need to keep it activate. This is because before any simulation (even IC simulation), the Adams dataset (Adams Solver version of the model) is generated and passed to the solver. Therefore, all modeling elements should be there in this dataset.
     
    Now, if you need to keep a modeling element deactivated at the beginning and then later on activate it, you can simply do this in your simulation script. For instance in your sample model, you need to
    1. activate sensor_1 from the model browser;
    2. deactivate it in your script before the first stimulation line
     
    entity attributes entity_name=.MODEL_1.SENSOR_1 active=off dependents_active=off
    simulation single_run transient type=auto_select initial_static=no end_time=0.1 number_of_steps=800 model_name=.MODEL_1
    entity attributes entity_name=.MODEL_1.SENSOR_1 active=on dependents_active=on
    simulation single_run transient type=auto_select initial_static=no duration=0.1 number_of_steps=800 model_name=.MODEL_1
    entity attributes entity_name=.MODEL_1.SENSOR_1 active=off dependents_active=off
     
    The problem with the above script is that such sensor only works with Solver scripts. Therefore, you would need to use the equivalent of this script in Adams Solver language, which is also simpler to write and debug if needed:
     
    DEACTIVATE/SENSOR, ID=1
    SIMULATE/TRANSIENT, END=0.1, STEPS=800
    ACTIVATE/SENSOR, ID=1
    SIMULATE/TRANSIENT, DUR=0.1, STEPS=800
    DEACTIVATE/SENSOR, ID=1
     
    Thank you,
    Maziar Rostamian
    MSC Software
     
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • BThielem
    0 BThielem over 6 years ago
    Hello Maziar,
     
    thanks for your answer.
     
    From your explanation I now better understand that deactivated modeling elements are NOT included when the Adams dataset is generated.
     
    I also can follow your suggestions for fixing the discussed problem.
     
    In following step 1 and 2 the model works in my intention if I
    - use the Adams View Commands exactly like youve suggested (did you intentionally write "active=on dependents_active=off" in line 1 ?)
    - use the Adams Solver Commands with changing END to DURATION in line 4.
     
    One lack of clarity has come up for me:
     
    If I change the Adams View Command in line 1 to "active=off dependents_active=off" the model does not work in my intention any more.
    This stands in contrast to the Adams Solver Commands, where also the sensor is (completely) deactivated in line 1.
    Why is this?
    Do the Adams View Commands only work because of having NOT deactivated the sensor in line 1?
    When does the process of generating the Adams dataset exactly take place?
    Do I get it right when I think this is for the Adams View Commands at line 2 (simulation) and for the Adams Solver Commands before line 1?
     
    See also attached model (where the different simulation scripts are included).
     
    Regards
     
    Bruno

    Attached Files (1)
    MODEL_1_fixed_maziar.cmd.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • BThielem
    0 BThielem over 6 years ago
    Hello,
     
    another possibility of keeping a sensor "sleeping" until a certain condition (e.g. time > value) is fulfilled is (to keep it technically active all the time but)
    to combine the event definition of the sensor (here: DZ) with the event evaluation (e. g. expression = 1 when time > value) of an upstream sensor.
     
    DZ -> DZ * SENVAL(upstream sensor)
     
    See also attached model (where the upstream sensor is included).
     
    Regards
    Bruno

    Attached Files (1)
    MODEL_1_fixed_via_2nd_sensor.cmd.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Maziar R
    0 Maziar R over 6 years ago
    Hi Bruno,
     
    I have updated my original email to reflect the correct commands in the View and Solver scripts. I have also added why an Adams View script cannot be used for your purpose.
     
    HTH,
    Maziar
     
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information