App: Scheduler Lab

Note 1: We're working on updating the videos. In the meantime, go ahead and turn up your volume.

Note 2: This video covers a few of the most popular apps. You can skip around to the app you care about.

 

Motivation

Would you like something to happen every day precisely at 2:03 in the morning? Would you like a series of things to happen, one right after the other? Or perhaps you want something to happen every second?

NASA created the free Scheduler "Lab" app, which lets you do all those things when running your system on the ground and/or in the lab. This is one of the three free apps that NASA provides to get you started (the other two are the command interface lab app and the telemetry output lab app.) It's simple and effective.

 

The Scheduler Lab App

If you want to schedule something, you do two things:

1. Tell the scheduler what messages you want it to send

2. Tell the scheduler when to send them

 

From there, the app follows your instructions in a deterministic way. If you haven't seen this word before, it simply means that if you ask for something it gives you the same product in the same way and uses the same process every single time, no matter what. Critical software is often required to be deterministic and this is a lot trickier to do with timing than new programmers might expect. This a great reason to adopt cFS instead of trying to write your own code.

The Scheduler talks with the TIME features of the Core Flight Executive layer to know when to send things.  It can also do some tricks with splitting time into segments and managing interrupts by talking with the Operating System Abstraction Layer (OSAL), which talks with the hardware timer on your board. So this app does a few more "deep dive" things than most apps do.

The number of messages you can schedule to run within a second depends on your hardware and what you're doing, but most systems can send hundreds and even thousands of messages. Note that these messages tend to be short: You wouldn't send a gigabyte-sized file as a scheduled message, you'd send a message that told your app where to find the big file. So it's straightforward to send many small messages in every direction.

NASA provides this "Lab" version to get you started. You could use it in flight but you'll probably want to tailor it a bit for your mission. 

 

Quick Notes

- The "non-lab" version hasn't been updated in a few years. You can find it here: https://github.com/nasa/SCH. It's unlikely to work in the latest version of cFS but you can learn a lot from it, especially if you compare it with the modern "Lab" version.

- In the code, Scheduler LAB is abbreviated as "SCH_LAB". The non-lab version uses "SCH".