The Stages Of The Code Runs Through

1407 Words Aug 3rd, 2015 6 Pages
When PHIL is run it has three distinct stages that the code runs through. First is the initialization stage. This is where the code that needs to be set up first is run. The next stage is the execution stage, which is arguably the most important stage. This is where the majority of the code is executed. Any code in the execution stage is repeated until the user terminates it. The final stage is the termination stage, where all tasks are stopped and any code which needs to be closed out can be done safely after user termination. Tasks in PHIL are pieces of code that will need to be executed repeatedly. The Lua script handles the scheduling, initializing, execution, and termination of these tasks. Tasks can be anything from the satellite propagation to the sensors. Each task runs according to how the Lua script has it scheduled and the code will continue to run until the command from the user is given to terminate the task. Figure 2 shows the architecture of PHIL. This portion of the reboot was focused on the simulation side and not the flight software side. As these tasks run they may have data that other tasks need to successfully run. A way of handling the transfer of data from one task to another is to adopt a Publish and Subscribe System. This system allows for the transferring of variables without getting in the way of the scheduler and makes sure that all tasks receive the same data for that given moment of time. For example: The satellite propagation publishes…

More about The Stages Of The Code Runs Through

Open Document