SysML State Machine: Using Time as a Variable

In this tutorial, we address a subscriber question on how to make time a variable in a SysML state machine simulation. We walk through: ✅ Attempting to replace fixed times (e.g., 4s → 2s) with a time variable ✅ Why variables don’t update as expected in transitions ✅ Using guards, simTime, and change events to test different timing logic ✅ Limitations of guard evaluation and simulation context ✅ A recommended solution with a do behavior action + counter logic to handle different timing conditions By the end, you’ll see how to model a state machine that waits 4 seconds on the first transition, and 2 seconds on subsequent transitions — while understanding the pros and cons of different approaches in Cameo Systems Modeler. 🔔 Subscribe for more SysML & MBSE tutorials! 📂 Project Files: https://cameomagic.com/project-files/ 📘 Certification Prep: https://cameomagic.com/training-certi... 💼 Consulting: [email protected] 0:00 Intro & Subscriber Question 0:17 State Machine Setup & Timing Problem 1:18 Attempting to Use a Time Variable 2:40 Linking Variables to Transitions 3:16 Simulation Limitations with Variables 4:13 Exploring Alternative State Machine Approaches 5:12 Using simtime & Guards 7:01 When Conditions & Change Events 9:02 Guard Evaluation Limitations 10:26 Running with Context Explained 11:14 Recommended Solution: Do Behavior Action 11:48 Simulation Demo with Counter Logic 12:39 Closing Thoughts & Recommended Approach