- Open the LabVIEW project that is associated with your FlexLogger plug-in.
- Open the Initialize.vi and add the Write Parameter.vi. As its name suggests, this VI will add a parameter to the plug-in. This will allow the user to enable and disable the status logging capability if desired. Please refer to the following image for more information:

- In the Project Explorer Window, open the .ctl file, which contains the private data of the LabVIEW class that is associated with your plug-in.
- Modify the Cluster of class private data and add a File Path Control to it. This element will contain the path to the status log file for the plug-in.
- In the Project Explorer Window, right-click on the .lvclass element and select New>> VI for Data Member Access...

- In the Create Accessor dialog box, select Read from the Access drop-down list, enable the Create static accessor option, and click on Create.

- Modify the VI to write status information to a file. Refer to the images below for guidance.



As shown in the images above, the code was modified to write the following details to the status log file:
-
- Date and time. This data will be updated each time the plug-in executes a VI that is part of its operation sequence (Configure Session, Process, Cleanup Session, and Finalize)
- VI that is being executed (VI Refnum input). This input is used with a property node to obtain the name of the VI that is calling this Status Log File.vi
- Execution status or error information, indicating whether the operation completed successfully or returned an error or warning
Note: You can add more information or data to the status log file depending on your application requirements.
- Modify the VI's name, icon and update the conector pane if required. For this example, this VI has been renamed Status Log File.vi
- In the Project Explorer Window, open the Configure Session.vi and add logic to create the log file and write its column headers.
- Place the Status Log File.vi and wire its inputs accordingly. Refer to the images below for guidance.


As shown, the Configure Session.vi has been modified to create a new path every time the plug-in is loaded to FlexLogger and the Enable Status Log parameter that was previously defined is enabled. Additionally, at the end to the VI, the recently created Status Log File.vi has been wired.
- Call the Status Log File.vi from Process.vi and Finalize.vi. Use the Configure Session.vi as a guide. Note: Logging every execution of Process.vi may generate a large amount of data, depending on the plug-in execution rate. For production applications, consider logging only relevant events, errors, warnings, or state changes.
- For the Cleanup Session.vi, wire the Status Log File.vi as shown in the following images:


As observed, the Empty String/Path? function is used to determine whether the Status Log File.vi is executed. This is to prevent FlexLogger from displaying a dialog window asking for a file path the first time the Enable Status Log parameter is enabled.
- Recompile the Packed Library, so the changes are included.