To download NI software, including the products shown below, visit ni.com/downloads.
Overview
MultiThreaded application to read, graphically display and write serial port data to a spreadsheet file.
Description
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. In this example, the data is from an accelerometer with a fixed packet length. The contents of the packet are Header, Data, CheckSum (comma delimited HEX values)
[4bytes][XData][YData][ZData][CHKSUM]
Once the Data is read from the COM port it is put into a thread safe queue for the second thread to process it.
Requirements
Steps to Implement or Execute Code
Serial Packet from serial instrument: FFAADDFF,5D,A6,55,CHKSUM
2. Configure the serial instrument by inputting strings below the Waveform Chart.
3. Check the Packet Data indicator and Chart.
Additional Information or References VI Block Diagram
VI Snippet
**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.