-
ContextThis is mostly a part 3 to my questions in #278 and #282. I would like to write data from instruments to a readable .csv file. I have developed an application with the assistance/framework of the sample app that I have modified to interface with my sensors and publishes said data to the telemetry output application which can also be viewed with the ground station GUI. Now I am trying to write my data into a file in a readable format. I was interested in using the Data Storage application to accomplish this, and I am able to populate what I think is my data packed into a binary file but I am a bit confused on translating it into the readable csv file I would like. In #282 I was confused as to why I couldn't read the file header from my binary output file but I needed to have code to translate the file out of binary into readable ASCII characters. QuestionFor printing out the rest of the data past the header in a file, would we need another struct to read and print from representing the rest of that message? If so what type? It's not clear to me what abstract data type is mapped to each message ID I want in my output file. For example, in my ds_filter_tbl.c file I have 3 MessageIDs I would like to send to my output file called SAMPLE_APP_SEND_HK_MID, SAMPLE_APP_HK_TLM_MID, and SAMPLE_APP_CMD_MID. Each messageID, I am assuming, corresponds to some data structure that is packed into the binary file that I need to translate. I am also assuming that one of those messageIDs specifically corresponds with the values I put into the SAMPLE_APP_Data_t global data structure in my sample app or the telemetry packet but I'm not quite sure which.
Thanks again for answering my previous questions. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Yes you will need to know all of the binary structures of the data being stored in the DS file. Here's a picture showing the structure of a DS file that is storing event messages. After the standard cFS file header DS has its own file header. After this header DS stores packets as defined in its tables. When processing the packets in the file I would recommend using the information in the CCSDS primary header of each packet as opposed to making any assumptions about packet order. Use the message ID to identify which packet structure needs to be used to interpret the binary data and use the packet length to find the start of the next packet in the file. |
Beta Was this translation helpful? Give feedback.
Yes you will need to know all of the binary structures of the data being stored in the DS file. Here's a picture showing the structure of a DS file that is storing event messages. After the standard cFS file header DS has its own file header. After this header DS stores packets as defined in its tables. When processing the packets in the file I would recommend using the information in the CCSDS primary header of each packet as opposed to making any assumptions about packet order. Use the message ID to identify which packet structure needs to be used to interpret the binary data and use the packet length to find the start of the next packet in the file.