Example Code

Custom Text File Logging for Real-Time Targets

Code and Documents

Attachment

Overview

This custom logging is extremely helpful when debugging crashes and hangs on embedded systems. It will log what section of the code is executed and when. This allows the user to know what the last process called is before a crash or hang occurs.

Description

This VI is a simple write to text file that allows for sections of code to be executed in between. This can be extremely helpful when code is executing serially on your embedded controller.

Steps to Implement or Execute Code

  1. Place on block diagram.
  2. Separate code into sections to narrow down specifically when crash or hang occurs.
  3. Review the log that is created using FTP, SFTP, or WebDAV.

Requirements

Software

LabVIEW 2013 SP1

Hardware

CompactRIO, an embedded cDAQ running LinuxRT, or a PXI controller run Phar Lap.

Additional Images or Video


cRIOCustomLogging.png



The log on a Linux cRIO will look like the log below with the section and when the section executed.


customloggingcRIO.PNG


When the log is generated through Linux and viewed in Windows it will look like the log below due to differences in line breaks between the 2 operating sytems.

customloggingWindows.PNG


Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors