Table of Contents

Data Downlink: Receiving Messages

Receiving a Message

Similar to the transmitter, the receiver has a Receive Message function that can overwrite a message passed in with the new data from the telemetry system. The message passed into the function must be of the same type as the message to be overridden. Additionally, the key can be added to ensure the correct message is found. The recent flag will specify if the most recent message should be returned. If the flag is disabled, the oldest message will be read from the TT&C system and the data will be replaced with that.

Untitled

For this tutorial, a new IMU and CSS message must be created and passed into the receive function and their data will be updated. Leaving the message key empty (0) will result in no messages being read by the receiver.


Creating a Message

For the message key, a new message of the correct type must be made for the message to be read by the ground station. The first example is the CSS Raw Data Message. This will hold the data of the coarse sun sensor and will output the values estimated by the sensor. Typically, creating a new message will have the same format for each message. They are static functions that exist within Nominal Editor and can be called by using the Create [MESSAGE] function, where the name of the message type is used. The payload will be the raw structure of the message (which can be left as the default value) and the id will be the reference pointer to the message that is required for the receive function to use.

Untitled

Note

Each message will have a different payload, depending on the message type. These are structures and can be used to initialize a message. Right-click on the payload parameter and split to see all available data points on the message. Since the message will be immediately overridden by the data from the TT&C system, leaving this as default is sufficient.


Checking the Simulation

Throughout the development of a simulation, it is good practice to constantly play the simulation and see if particular features are working as expected. For example, in this case, we can check to see if the messages are being received once the spacecraft is in range of the ground station. To do this, the Print function is useful for displaying information. Here, we can print the result of the return value from the Receive Message function to see if any messages existed and if the message was correctly overridden.

Untitled

Printing to the screen will display the text in the top-right of the screen. It will look messy with the user interface underneath but is useful for debugging. As seen in the screenshot below, the flag changes to true when the spacecraft is in range of the ground station.

Untitled


Reading a Message

Message data can be broken down into their structural form provided that the correct message type is known. Similar to the Create Message function, there is a Read Message function that exists as a static function on the simulation. Each message that is exposed to Nominal Editor will have a dedicated read function.

Untitled

After reading a message, the payload will contain the data within the structure of the message. To split the data within the structure out, the Break structure Unreal function can be used. Alternatively, using the structure split (by right-clicking and selecting break) can also be done in the same way.

Warning

Since the ID of a message is agnostic of type, when configuring a simulation, the correct type of the message must be known. Connecting a message of a different type to a different read type will throw an error. The type of message must be known before reading or writing messages.


Plotting Data

For this message, we want to plot the data that was received by the ground station on a graph when it was received. This will be for the CSS data message and it will show the data on the graph. Firstly, a new graph needs to be added to the user interface. This will be done using the Add Widget | Graph on the UI variable on the configure UI function.

Untitled

Adding widgets should only be done on the Begin Play event and not be handled on a simulation tick.

Returning to the receive message function, the data that has been read from the message can be displayed in the graph. This can be done by using the Update Graph Widget | Add Double Data function which will turn the double data that is outputted from the data payload of the CSS message on the ground station.

Untitled

This will display the value read from the ground station after the message has been communicated to the TT&C system to the graph. Additionally, on the same graph, a second data point can be added that plots the real data from the CSS sensor at the current time.

Untitled

Note

Many data points can be plotted on the same graph. When dealing with multiple data points on the same graph, ensure that the Show Legend toggles for the graph when configuring it is enabled.

The graph will show a 150 second delay between the two data points. This is because the spacecraft takes 150 seconds before it reaches the access of the ground station. Additionally, the data is cut off when the spacecraft is out of range from the ground station again.

Untitled