{"id":8158,"date":"2022-03-07T08:39:25","date_gmt":"2022-03-07T08:39:25","guid":{"rendered":"http:\/\/fastbitlab.com\/?p=8158"},"modified":"2023-08-24T11:31:10","modified_gmt":"2023-08-24T06:01:10","slug":"fsm-lecture-drawing-an-hsm-hierarchical-state-machine","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/","title":{"rendered":"FSM Lecture 61: Exercise-007 Drawing an HSM"},"content":{"rendered":"<div class=\"boldgrid-section\" style=\"background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"container\">\n<div class=\"row\" style=\"padding-top: 35px; padding-bottom: 0px; background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"col-md-1 col-sm-12 col-xs-12 col-lg-1\">\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"col-md-10 col-sm-12 col-xs-12 col-lg-10\">\n<h1 class=\"\" style=\"text-align: center; font-size: 30px; border-width: 0px; line-height: 50px;\"><span style=\"color: #000080;\"><strong>Exercise-007 Drawing an HSM<\/strong><\/span><\/h1>\n<div class=\"row bg-editor-hr-wrap\" style=\"border-width: 0px; margin-top: -25px;\">\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\n<div>\n<p>&nbsp;<\/p>\n<div class=\"bg-hr bg-hr-10 color2-color\" style=\"border-style: solid; border-width: 0px 0px 3px;\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"\" style=\"border-width: 0px; font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In the exercise 007ClockAlarm, let&#8217;s create a new folder and call it &#8216;qm.&#8217; Now, we have to keep the new model file, which we will create using the &#8216;qm&#8217; tool. Let&#8217;s launch the qm tool.&nbsp;<\/span><\/p>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Go to File and click on New model.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Select Framework is \u2018qpn&#8217; \u2192 Model template is None \u2192 Name for your project or model; let&#8217;s call this <\/span><b>ClockAlarm<\/b><span style=\"font-weight: 400;\">. And provide the path of the &#8216;qm&#8217; folder. I will open that in the File Explorer to copy this path. Just open that location and select &#8216;qm,&#8217; and click OK. <\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/li>\n<\/ol>\n<figure id=\"attachment_8161\" aria-describedby=\"caption-attachment-8161\" style=\"width: 1215px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-8161\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-1-14.png\" alt=\"Figure 1. Creating a New model file\" width=\"1215\" height=\"639\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14.png 1215w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-300x158.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-768x404.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-1024x539.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-600x316.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-120x63.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-500x263.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-200x105.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-400x210.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-800x421.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-1-14-1200x631.png 1200w\" sizes=\"(max-width: 1215px) 100vw, 1215px\" \/><figcaption id=\"caption-attachment-8161\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Creating a New model file<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">You must see &#8216;qpn&#8217; as shown in Figure 2.<\/span><\/p>\n<figure id=\"attachment_8162\" aria-describedby=\"caption-attachment-8162\" style=\"width: 591px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-8162\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-2-10.png\" alt=\"Figure 2. qpn framework\" width=\"591\" height=\"369\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-2-10.png 591w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-2-10-300x187.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-2-10-320x200.png 320w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-2-10-120x75.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-2-10-500x312.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-2-10-200x125.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-2-10-400x250.png 400w\" sizes=\"(max-width: 591px) 100vw, 591px\" \/><figcaption id=\"caption-attachment-8162\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. qpn framework<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">After that, before creating a state machine model, you must create a package. Right-click over the project ClockAlarm and select Add Package, as shown in Figure 3.<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<figure id=\"attachment_8163\" aria-describedby=\"caption-attachment-8163\" style=\"width: 504px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-8163\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-3-10.png\" alt=\"Figure 3. Creating a package\" width=\"504\" height=\"425\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-3-10.png 504w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-3-10-300x253.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-3-10-120x101.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-3-10-500x422.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-3-10-200x169.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-3-10-400x337.png 400w\" sizes=\"(max-width: 504px) 100vw, 504px\" \/><figcaption id=\"caption-attachment-8163\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 3. Creating a package<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">&#8216;Package&#8217; is nothing but it&#8217;s a group of different elements, and by means of a package, you can provide a namespace. The project may have different packages. The project may contain any number of packages. And if you have any plan to reuse certain variable names, attribute names, or function names in different packages, you can assign a different namespace.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">You can get more information about packages in the <\/span><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.state-machine.com\/qm\/bm_package.html\"><span style=\"color: #0000ff; text-decoration: underline;\"><span style=\"font-weight: 400;\">Working with Packages &#8211; QM<\/span>&nbsp;<\/span><\/a><\/span><span style=\"font-weight: 400; color: #000000;\"> user manual, shown in Figure 4.<\/span><\/p>\n<figure id=\"attachment_8164\" aria-describedby=\"caption-attachment-8164\" style=\"width: 1805px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-8164\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-4-9.png\" alt=\"Figure 4. User manual of package\" width=\"1805\" height=\"947\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9.png 1805w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-300x157.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-768x403.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-1024x537.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-600x315.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-120x63.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-500x262.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-200x105.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-400x210.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-800x420.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-4-9-1200x630.png 1200w\" sizes=\"(max-width: 1805px) 100vw, 1805px\" \/><figcaption id=\"caption-attachment-8164\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 4. User manual of package<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">It is used to <\/span><i><span style=\"font-weight: 400;\">&#8220;group elements, and to provide a namespace for the grouped elements.&#8221; <\/span><\/i><span style=\"font-weight: 400;\">A package may contain other packages. Inside the package, you can create classes, create free attributes, and create free operations, directories, etc.<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_8166\" aria-describedby=\"caption-attachment-8166\" style=\"width: 1887px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-8166\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-5-8.png\" alt=\"Figure 5. Property editor of package\" width=\"1887\" height=\"547\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8.png 1887w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-300x87.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-768x223.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-1024x297.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-600x174.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-120x35.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-500x145.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-200x58.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-400x116.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-800x232.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-5-8-1200x348.png 1200w\" sizes=\"(max-width: 1887px) 100vw, 1887px\" \/><figcaption id=\"caption-attachment-8166\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 5. Property editor of package<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">It also provides a namespace option here. You can assign a name for a namespace if you plan to use more than one package.&nbsp;&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">For the stereotype option, select \u2018components\u2019 here.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">You can give a name for the package; I&#8217;ll provide HSMs ( Figure 5). That&#8217;s how you create a package.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Under the package, let&#8217;s create a class.&nbsp;<\/span><\/p>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s click on the package HSMs and select Add class.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">This is our main application structure name; let&#8217;s give Clock_Alarm. And select the superclass. The superclass is &#8216;QHsm.&#8217;&nbsp; So, choose qpn::QHsm. Our Clock_Alarm is derived from QHSM. Then save.(Figure 6)&nbsp;<\/span><\/li>\n<\/ol>\n<figure id=\"attachment_8167\" aria-describedby=\"caption-attachment-8167\" style=\"width: 1243px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-8167\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-6-8.png\" alt=\"Figure 6. Creating a Class\" width=\"1243\" height=\"676\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8.png 1243w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-300x163.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-768x418.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-1024x557.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-600x326.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-120x65.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-500x272.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-200x109.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-400x218.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-800x435.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-6-8-1200x653.png 1200w\" sizes=\"(max-width: 1243px) 100vw, 1243px\" \/><figcaption id=\"caption-attachment-8167\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 6. Creating a Class<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now we can create an attribute, as shown in Figure 7.&nbsp;<\/span><\/p>\n<figure id=\"attachment_8168\" aria-describedby=\"caption-attachment-8168\" style=\"width: 1280px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8168 size-full\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-7-6.png\" alt=\"Figure 7. Creating an Attribute\" width=\"1280\" height=\"687\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6.png 1280w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-300x161.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-768x412.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-1024x550.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-600x322.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-120x64.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-500x268.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-200x107.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-400x215.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-800x429.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-7-6-1200x644.png 1200w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><figcaption id=\"caption-attachment-8168\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 7. Creating an Attribute<\/span><\/figcaption><\/figure>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Click on that Class name and select Add attribute.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">The First attribute is the current time; the type is uint32_t; visibility is private; this is a non-static attribute.&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">After that, let&#8217;s create one more attribute. Name as temp_time; type is uint32_t; visibility is private. Like that, you create a couple of attributes.<\/span><\/li>\n<\/ol>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now also add a directory and add files to keep the generated code.&nbsp;<\/span><\/p>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Go to your package HSMs. Right-click and select Add directory.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s give the path for the directory &#8216;..\/src&#8217;. We are going to keep all our source files in &#8216;src.&#8217;<\/span><\/li>\n<\/ol>\n<figure id=\"attachment_8169\" aria-describedby=\"caption-attachment-8169\" style=\"width: 1280px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-8169\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-8-5.png\" alt=\"Figure 8. Adding a Directory\" width=\"1280\" height=\"720\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5.png 1280w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-300x169.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-768x432.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-1024x576.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-600x338.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-120x68.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-500x281.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-200x113.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-400x225.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-800x450.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-8-5-1200x675.png 1200w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><figcaption id=\"caption-attachment-8169\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 8. Adding a Directory<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Next, let&#8217;s add a file.&nbsp;<\/span><\/p>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Right-click on the &#8216;..\/src&#8217; directory and select Add File.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000000;\">Name the source file as ClockAlarm_SM.cpp; that&#8217;s a &#8216;cpp&#8217; file. And again, add another file, ClockAlarm_SM.h, as shown in Figure 9. Currently, I&#8217;ll keep them as internal files.&nbsp;<\/span><\/li>\n<\/ol>\n<figure id=\"attachment_8171\" aria-describedby=\"caption-attachment-8171\" style=\"width: 1226px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-8171\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-9-5.png\" alt=\"Figure 9. Adding a files to src directory\" width=\"1226\" height=\"673\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5.png 1226w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-300x165.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-768x422.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-1024x562.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-600x329.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-120x66.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-500x274.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-200x110.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-400x220.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-800x439.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5-1200x659.png 1200w\" sizes=\"(max-width: 1226px) 100vw, 1226px\" \/><figcaption id=\"caption-attachment-8171\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 9. Adding a files to src directory<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And now, let&#8217;s provide the include guards for the header file, as shown in Figure 10.<\/span><\/p>\n<figure id=\"attachment_8172\" aria-describedby=\"caption-attachment-8172\" style=\"width: 694px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8172 size-full\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-10-4.png\" alt=\"Drawing an HSM(hierarchical state machine)\" width=\"694\" height=\"406\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-10-4.png 694w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-10-4-300x176.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-10-4-600x351.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-10-4-120x70.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-10-4-500x293.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-10-4-200x117.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-10-4-400x234.png 400w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><figcaption id=\"caption-attachment-8172\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 10. Include guards<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now, let&#8217;s add the state machine. State machine we add to the Class. Right-click on the ClockAlarm, and select Add State Machine.&nbsp;<\/span><\/p>\n<figure id=\"attachment_8173\" aria-describedby=\"caption-attachment-8173\" style=\"width: 565px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8173 size-full\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-11-4.png\" alt=\"Drawing an HSM(hierarchical state machine)\" width=\"565\" height=\"428\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-11-4.png 565w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-11-4-300x227.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-11-4-120x91.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-11-4-500x379.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-11-4-200x152.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-11-4-400x303.png 400w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><figcaption id=\"caption-attachment-8173\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 11. Creating a state machine<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Double click on SM, you get the canvas to draw your state machine, shown in Figure 12.<\/span><\/p>\n<figure id=\"attachment_8174\" aria-describedby=\"caption-attachment-8174\" style=\"width: 1917px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8174 size-full\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-12-3.png\" alt=\"Drawing an HSM(hierarchical state machine)\" width=\"1917\" height=\"799\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3.png 1917w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-300x125.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-768x320.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-1024x427.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-600x250.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-120x50.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-500x208.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-200x83.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-400x167.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-800x333.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-12-3-1200x500.png 1200w\" sizes=\"(max-width: 1917px) 100vw, 1917px\" \/><figcaption id=\"caption-attachment-8174\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 12. State machine canvas<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">You can draw a state machine like this shown in Figure 13.<\/span><\/p>\n<figure id=\"attachment_8175\" aria-describedby=\"caption-attachment-8175\" style=\"width: 1583px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8175 size-full\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-13-2.png\" alt=\"Drawing an HSM(hierarchical state machine)\" width=\"1583\" height=\"1015\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2.png 1583w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-300x192.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-768x492.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-1024x657.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-600x385.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-120x77.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-500x321.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-460x295.png 460w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-200x128.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-400x256.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-800x513.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-13-2-1200x769.png 1200w\" sizes=\"(max-width: 1583px) 100vw, 1583px\" \/><figcaption id=\"caption-attachment-8175\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 13. Whole state machine<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">You can get all the required state machine components in canvas, like states, transitions, choice segment, initial transition, etc(Figure 14). Now click on the state; you need to drag anything, click it on canvas. That&#8217;s it.<\/span><\/p>\n<figure id=\"attachment_8176\" aria-describedby=\"caption-attachment-8176\" style=\"width: 287px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8176\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-14-components.png\" alt=\"Drawing an HSM(hierarchical state machine)\" width=\"287\" height=\"268\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-14-components.png 561w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-14-components-300x280.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-14-components-120x112.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-14-components-500x466.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-14-components-200x186.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-14-components-400x373.png 400w\" sizes=\"(max-width: 287px) 100vw, 287px\" \/><figcaption id=\"caption-attachment-8176\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 14. State machine Components<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_8177\" aria-describedby=\"caption-attachment-8177\" style=\"width: 1049px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8177 size-full\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-15-2.png\" alt=\"Drawing an HSM(hierarchical state machine)\" width=\"1049\" height=\"593\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2.png 1049w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-300x170.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-768x434.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-1024x579.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-600x339.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-120x68.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-500x283.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-200x113.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-400x226.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-15-2-800x452.png 800w\" sizes=\"(max-width: 1049px) 100vw, 1049px\" \/><figcaption id=\"caption-attachment-8177\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 15. Drawing a state machine<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Click on the state, and you can change the name. I&#8217;ll call it Ticking, Clock, Settings, Clock_Setting, and Alarm_Setting.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s draw some transitions. First of all, the initial state. When the application starts, the initial state will be ticking. It is already ready-made, the initial transition is available. Just click on this initial transition, and you have to draw.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now, let&#8217;s draw a transition from Ticking state to Clock_Setting state. When the signal &#8216;SET&#8217; arrives, it should transit to Clock_setting. Just take the transition component and draw. By default, it names it TRIG1; you can select that component and change the name. We&#8217;ll use capital letters for all the signals&#8217; SET&#8217;. And when &#8216;OK&#8217; arrives, when the state is Ticking, it transits to the Alarm_setting state. Take the transition component and draw. Name it as &#8216;OK.&#8217;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">And you give one superstate &#8216;Setting,&#8217; then let&#8217;s draw &#8216;ABRT&#8217; from settings state to Ticking. And after that, the transition from the setting state to ticking. Take the transition component, and draw. Name it as OK, as shown in Figure 15.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_8178\" aria-describedby=\"caption-attachment-8178\" style=\"width: 1919px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8178 size-full\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/03\/Figure-16-2.png\" alt=\"Drawing an HSM(hierarchical state machine)\" width=\"1919\" height=\"785\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2.png 1919w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-300x123.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-768x314.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-1024x419.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-600x245.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-120x49.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-500x205.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-200x82.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-400x164.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-800x327.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-16-2-1200x491.png 1200w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><figcaption id=\"caption-attachment-8178\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 16. Alarm_notify state<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">We need one more state for Alarm notification; I will draw that, as shown in Figure 16. And I&#8217;ll call this Alarm_Notify, and it happens with the event Alarm.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">When it is in the Alarm_Notify state, it will show the notification. It will say to the user, &#8220;Hey, Alarm has happened.&#8221; So, the user says OK. And when the user presses OK here, it should come back to the Clock state, but it should go to the history state.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let&#8217;s define the history for Clock. We need deep history. History for the clock can be achieved by using a history state on states any of the boundary line. I take the transition to history component, and I put that on the boundary. You have to put that on the boundary.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Transition to history is a history of Clock. If the history is not available, then this is a default transition. This signifies the default transition. And we&#8217;ll take one transition from Alarm_Notify to history. I&#8217;ll call this OK. Save it. Complete up to here.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-size: 20px; line-height: 28px;\"><span style=\"color: #000080;\"><b>FastBit Embedded Brain Academy Courses<\/b><\/span><\/p>\n<p class=\"\"><span style=\"color: #000000;\">C<span style=\"font-weight: 400;\"><span style=\"color: #000000;\">lick here:<\/span>&nbsp;<\/span><\/span><span style=\"color: #0000ff;\"><a style=\"color: #0000ff; text-decoration: underline;\" href=\"http:\/\/fastbitlab.com\/course1\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">http:\/\/fastbitlab.com\/course1<\/span><\/a><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Exercise-007 Drawing an HSM &nbsp; &nbsp; In the exercise 007ClockAlarm, let&#8217;s create a new folder and call it &#8216;qm.&#8217; Now, we have to keep the new model file, which we will create using the &#8216;qm&#8217; tool. Let&#8217;s launch the qm tool.&nbsp; Go to File and click on New model. Select Framework is \u2018qpn&#8217; \u2192 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8171,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[17],"class_list":["post-8158","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-finite-state-machine","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating an HSM(Hierarchical state machine): Step-by-Step Guide<\/title>\n<meta name=\"description\" content=\"Draw a Hierarchical State Machine (HSM) in this guide. Follow the detailed steps to create an FSM using &#039;qm&#039; tool, design states, transitions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating an HSM(Hierarchical state machine): Step-by-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Draw a Hierarchical State Machine (HSM) in this guide. Follow the detailed steps to create an FSM using &#039;qm&#039; tool, design states, transitions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/\" \/>\n<meta property=\"og:site_name\" content=\"FastBit EBA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fastbiteba\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-07T08:39:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-24T06:01:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1226\" \/>\n\t<meta property=\"og:image:height\" content=\"673\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"FastBitLab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:site\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"FastBitLab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"FSM Lecture 61: Exercise-007 Drawing an HSM\",\"datePublished\":\"2022-03-07T08:39:25+00:00\",\"dateModified\":\"2023-08-24T06:01:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/\"},\"wordCount\":1224,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Figure-9-5.png\",\"keywords\":[\"Finite state Machine(FSM)\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/\",\"name\":\"Creating an HSM(Hierarchical state machine): Step-by-Step Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Figure-9-5.png\",\"datePublished\":\"2022-03-07T08:39:25+00:00\",\"dateModified\":\"2023-08-24T06:01:10+00:00\",\"description\":\"Draw a Hierarchical State Machine (HSM) in this guide. Follow the detailed steps to create an FSM using 'qm' tool, design states, transitions.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Figure-9-5.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Figure-9-5.png\",\"width\":1226,\"height\":673,\"caption\":\"Figure 9. Adding a files to src directory\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FSM Lecture 61: Exercise-007 Drawing an HSM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"name\":\"FastBit EBA\",\"description\":\"Your Online Academy of Embedded Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\",\"name\":\"FastBit EBA\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"width\":640,\"height\":640,\"caption\":\"FastBit EBA\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/fastbiteba\\\/\",\"https:\\\/\\\/x.com\\\/fastbiteba\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/fastbit-embedded-brain-academy-b3167b124\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCa1REBV9hyrzGp2mjJCagBg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\",\"name\":\"FastBitLab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"caption\":\"FastBitLab\"},\"description\":\"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating an HSM(Hierarchical state machine): Step-by-Step Guide","description":"Draw a Hierarchical State Machine (HSM) in this guide. Follow the detailed steps to create an FSM using 'qm' tool, design states, transitions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/","og_locale":"en_US","og_type":"article","og_title":"Creating an HSM(Hierarchical state machine): Step-by-Step Guide","og_description":"Draw a Hierarchical State Machine (HSM) in this guide. Follow the detailed steps to create an FSM using 'qm' tool, design states, transitions.","og_url":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2022-03-07T08:39:25+00:00","article_modified_time":"2023-08-24T06:01:10+00:00","og_image":[{"width":1226,"height":673,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5.png","type":"image\/png"}],"author":"FastBitLab","twitter_card":"summary_large_image","twitter_creator":"@fastbiteba","twitter_site":"@fastbiteba","twitter_misc":{"Written by":"FastBitLab","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"FSM Lecture 61: Exercise-007 Drawing an HSM","datePublished":"2022-03-07T08:39:25+00:00","dateModified":"2023-08-24T06:01:10+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/"},"wordCount":1224,"commentCount":0,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5.png","keywords":["Finite state Machine(FSM)"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/","url":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/","name":"Creating an HSM(Hierarchical state machine): Step-by-Step Guide","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5.png","datePublished":"2022-03-07T08:39:25+00:00","dateModified":"2023-08-24T06:01:10+00:00","description":"Draw a Hierarchical State Machine (HSM) in this guide. Follow the detailed steps to create an FSM using 'qm' tool, design states, transitions.","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/03\/Figure-9-5.png","width":1226,"height":673,"caption":"Figure 9. Adding a files to src directory"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/fsm-lecture-drawing-an-hsm-hierarchical-state-machine\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"FSM Lecture 61: Exercise-007 Drawing an HSM"}]},{"@type":"WebSite","@id":"https:\/\/fastbitlab.com\/blog\/#website","url":"https:\/\/fastbitlab.com\/blog\/","name":"FastBit EBA","description":"Your Online Academy of Embedded Systems","publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fastbitlab.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fastbitlab.com\/blog\/#organization","name":"FastBit EBA","url":"https:\/\/fastbitlab.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","width":640,"height":640,"caption":"FastBit EBA"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fastbiteba\/","https:\/\/x.com\/fastbiteba","https:\/\/www.linkedin.com\/in\/fastbit-embedded-brain-academy-b3167b124\/","https:\/\/www.youtube.com\/channel\/UCa1REBV9hyrzGp2mjJCagBg"]},{"@type":"Person","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d","name":"FastBitLab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","caption":"FastBitLab"},"description":"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries."}]}},"_links":{"self":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/8158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/comments?post=8158"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/8158\/revisions"}],"predecessor-version":[{"id":15585,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/8158\/revisions\/15585"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/8171"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=8158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=8158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=8158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}