{"id":809,"date":"2011-07-13T04:55:30","date_gmt":"2011-07-13T04:55:30","guid":{"rendered":"http:\/\/mainlinetest.com\/?p=809"},"modified":"2011-07-27T15:26:37","modified_gmt":"2011-07-27T15:26:37","slug":"using-the-teststand-api-%e2%80%93-controlling-the-progress-bar-%e2%80%93-part-2","status":"publish","type":"post","link":"https:\/\/mainlinetest.com\/?p=809","title":{"rendered":"Using the TestStand API \u2013 Controlling the Progress Bar \u2013 Part 2"},"content":{"rendered":"<p><a href=\"http:\/\/mainlinetest.com\/wp-content\/uploads\/2011\/05\/tsbiglogo1.gif\"><\/a>In my last post, I promised I would go into further detail on how setting the synchronous boolean to &#8216;False&#8217; can essentially hose up your script.<\/p>\n<p>So remember I said that when using these message codes you will want to set the synchronous boolean to \u2018True\u2019.\u00a0 At first, whenever using this function I set the boolean to \u2018False\u2019 and noticed no difference.\u00a0 In fact, it almost seemed like setting to \u2018False\u2019 provided better performance because setting to \u2018False\u2019 meant we aren\u2019t waiting for the user interface to process the message before going on.\u00a0 However, I was actually able to get TestStand to lock up with a very practical scripting implementation that thoroughly convinced me to always set that boolean \u2018True\u2019.\u00a0 Allow me to explain.<\/p>\n<p>Suppose that during test execution you decide to disable sequence tracing because you have limited CPU resources or the Sequence Call you are calling is being launch via a new thread.\u00a0 Figure\u00a01 below shows an example of me modifying the Sequence Call such that tracing is disabled.<\/p>\n<div id=\"attachment_810\" style=\"width: 530px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mainlinetest.com\/wp-content\/uploads\/2011\/06\/fig8.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-810\" class=\"size-full wp-image-810\" title=\"Figure 1\" src=\"http:\/\/mainlinetest.com\/wp-content\/uploads\/2011\/06\/fig8.jpg\" alt=\"\" width=\"520\" height=\"272\" \/><\/a><p id=\"caption-attachment-810\" class=\"wp-caption-text\">Figure 1<\/p><\/div>\n<p>Now with the boolean variable still set to \u2018True\u2019, I\u2019m going to execute my sequence once again.\u00a0<\/p>\n<div class=\"mceTemp mceIEcenter\">\n<div id=\"attachment_811\" style=\"width: 530px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mainlinetest.com\/wp-content\/uploads\/2011\/06\/fig9.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-811\" class=\"size-full wp-image-811\" title=\"Figure 2\" src=\"http:\/\/mainlinetest.com\/wp-content\/uploads\/2011\/06\/fig9.jpg\" alt=\"\" width=\"520\" height=\"263\" \/><\/a><p id=\"caption-attachment-811\" class=\"wp-caption-text\">Figure 2<\/p><\/div>\n<\/div>\n<p>Figure\u00a02 shows that my progress bar continues to update properly even though tracing is disabled.\u00a0 Now let me see the boolean to \u2018False\u2019 for both the progress indicator and progress text and re-execute the script.\u00a0 Below are my results.<\/p>\n<div id=\"attachment_812\" style=\"width: 530px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/mainlinetest.com\/wp-content\/uploads\/2011\/06\/fig10.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-812\" class=\"size-full wp-image-812\" title=\"Figure 3\" src=\"http:\/\/mainlinetest.com\/wp-content\/uploads\/2011\/06\/fig10.jpg\" alt=\"\" width=\"520\" height=\"32\" \/><\/a><p id=\"caption-attachment-812\" class=\"wp-caption-text\">Figure 3<\/p><\/div>\n<p>Figure\u00a03 shows that after my Sequence Call has finished executing, my progress bar only shows 15 seconds had expired and only 25% was completed.\u00a0 Therefore, the user interface couldn\u2019t process the progress bar updates fast enough.\u00a0 On top of that, the TestStand engine completely froze and I had to go into task manager to kill the process.<\/p>\n<p>So there you have it!\u00a0 Modifying the progress bar can be pretty useful for the end user on the current execution status of a test script.\u00a0 However, as with all things when you are modifying the TestStand user interface, you have to be aware of the traps a future script change could expose to your code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last post, I promised I would go into further detail on how setting the synchronous boolean to &#8216;False&#8217; can essentially hose up your script. So remember I said that when using these message codes you will want to set the synchronous boolean to \u2018True\u2019.\u00a0 At first, whenever using this function I set the&nbsp;<a href=\"https:\/\/mainlinetest.com\/?p=809\" class=\"read-more\">Continue Reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":741,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[24,25,23,26],"class_list":["post-809","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-national-instruments","tag-progress-bar","tag-teststand","tag-teststand-api","cat-1-id"],"_links":{"self":[{"href":"https:\/\/mainlinetest.com\/index.php?rest_route=\/wp\/v2\/posts\/809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mainlinetest.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mainlinetest.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mainlinetest.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mainlinetest.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=809"}],"version-history":[{"count":10,"href":"https:\/\/mainlinetest.com\/index.php?rest_route=\/wp\/v2\/posts\/809\/revisions"}],"predecessor-version":[{"id":898,"href":"https:\/\/mainlinetest.com\/index.php?rest_route=\/wp\/v2\/posts\/809\/revisions\/898"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mainlinetest.com\/index.php?rest_route=\/wp\/v2\/media\/741"}],"wp:attachment":[{"href":"https:\/\/mainlinetest.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mainlinetest.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mainlinetest.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}