To download NI software, including the products shown below, visit ni.com/downloads.
Debug Tools for WebVIs (https://bit.ly/debugtools) provides VIs that can be used along with existing debugging techniques to help debug web applications (WebVIs) created with G Web Development Software 2021. The following nodes are included:
Debug Log VI
The Debug Log VI is capable of taking any value passed to the value terminal and will print a representation to the console. When used inside the G Web Development Software editor the value is printed as a JSON string to the View >> Output pane similar to the Write to System Log VI. When used in a browser the value is printed to the console as an object that can be expanded and interactively explored to find specific fields or values. See the "How to Use" section for more usage details.
Note: The Debug Log VI should not be left in production applications. Values printed to the log are available in the console until the WebVI is closed. Continuously printing values using Debug Log VI will grow memory usage similar to a memory leak. The Debug Log VI should only be used in an WebVI while debugging.
Note: The console representation of values printed by the Debug Log VI should not be considered stable and is for debug use only. The console representation may be lossy (have reduced precision compared to the value in memory) and may change in the future without notice. The representation printed by the Debug Log VI should only be used for debugging.
Description-Separate-2
Once the attached NI package is installed and available in G Web Development Software, the following sections demonstrate how to use the included VIs:
Debug Log VI
The following GIF shows the process of including a Debug Log VI call in an existing application as well as how to find the printed console log in the View >> Output pane of G Web Development Software and how to find the console inside of a Web Browser (the GIF shows the process for Google Chrome but a console debug tool should be available in most browsers):
In addition the following GIF demonstrates how to leverage the prefix terminal of the Debug Log node which can be used to create a string at the start of a console message for searching inside of the View >> Output pane or by using filtering options built-in to the browser console log tools (the GIF shows the process for Google Chrome but most browsers have similar console log filtering features):
How-Separate-2
Notes for legacy LabVIEW NXG 5.1 users:
Additional-Separate-2
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
This is awesome!