{"id":533,"date":"2013-05-25T05:37:21","date_gmt":"2013-05-24T19:37:21","guid":{"rendered":"http:\/\/legoeng.local\/?p=533"},"modified":"2017-09-07T16:13:25","modified_gmt":"2017-09-07T06:13:25","slug":"program-structure","status":"publish","type":"post","link":"http:\/\/legoeng.local\/program-structure\/","title":{"rendered":"Program structure – simulating publish and subscribe"},"content":{"rendered":"

Many times I see teams I’m supporting decide to run their GUI-based programs in a straight line from start to finish. But I’m not sure that’s always a great idea.<\/p>\n

Consider the program structure outlined below:<\/p>\n

\"Program<\/a>
Program Structure Option<\/figcaption><\/figure>\n

In this model, the first thing that happens after the blue start block is the definition of variables and setting their first values as determined by the programmer. Don’t limit the concept to just writing variables. If calibration for a sensor was required, then the initialization phase of the program could check for existing calibration values or files, and if they did not exist, the program would request the operator to perform the calibration.<\/p>\n