Chapter 13: Log
Logs help you observe the operation state of hardware, the connection of EtherCAT network, the change of variable values, and importantly, help you debug when errors occur. In this chapter, you'll learn how to record specified data, add your own variables, and display them in KINGSTAR Analysis Console.
Add a header and .cpp file
You need to add a header and a .cpp file to learn the code of this chapter. The steps of adding them are written in Chapter 2 > Add a header and .cpp file.
- Add a header file:
- Add a .cpp file:
In Solution Explorer, in Header Files, add a header file and name it "Log.h
."
In Solution Explorer, in Source Files, add a C++ file and name it "Log.cpp
."
Tutorial
Take the following steps to complete the training: