To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI creates a multithreaded application that reads continuous packet data transferred over a specified Serial (COM) port while continuously displaying the data graphically and writing the data to a file.
Description
In this example the data is received from an accelerometer with a fixed packet length. The contents of the packet are Header, Data, CheckSum (comma delimited)
[4bytes] [XData][YData][ZData]
Once the Data is read from the COM port and put into the queue the second thread processes it. The shift register initialized at 8 skips to the [XData], the for loop executes three times to extract the accelerometer values. The values are transferred in HEX so they are converted into a number, displayed on a graph and written to a spreadsheet file.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange. **
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.