How can I efficiently archive bus data to a file using BusTools/1553-API?
This program demonstrates how to use the Bus Monitor to archive bus data to a file. The output file is in BMD format and can be viewed from the BusTools/1553 GUI.
This example is very similar to the example program 'example_bm1.c', but it uses the EVENT_RECORDER interrupt event to write messages to disk only when there is 64KB of data (512 messages). This results in a more efficient archiving application.
The main program sets up the BM and registers the event handler function. It then waits until you tell it to stop archiving. It then reads any messages left in the API BM message buffer and writes them to file and exits.
The event handler function grabs blocks of data and writes them to a file every time the EVENT_RECORDER interrupt occurs. This should happen every time the API has accumulated 64K of data. It also print an asterisk every time this happens so you have some indication that the program is working.
Use a bus analyzer (BusTools/1553) as BC and remote terminal.
Note that the EVENT_RECORDER approach is only for Windows environments.
Download this example by clicking the link on the right.