One of the Perfect Abstractions Ignition project developers developed a very useful tool for viewing the Ignition wrapper.log file in an Ignition client or designer.
We are releasing the Wrapper.log Viewer project here for other people to use. Download this project file: WrapperLogViewer.proj. Ignition 7.7.5 or higher is required to import the project.
Here is a screenshot of the project:
The Wrapper.log Viewer project was designed to be very easy to install and use. To install it import the Wrapper.log Viewer project into an existing Ignition project or import it as a new project. Note that importing into an existing project will delete existing Gateway Event Scripts in the project. That is all that is needed to install it. No database connections or anything else.
To use the Wrapper.log Viewer project in an Ignition designer open up the ViewerWindow window and put the designer into preview mode. The current contents of the wrapper.log file will display within 5 seconds.
To use the project in a client simply start a client and open the ViewerWindow window. Very easy, nothing to it.
The Wrapper.log Viewer project has been tested on both Windows and Linux.
How it Works
The Wrapper.log Viewer project has a Gateway Timer Script that runs every 5 seconds. It checks to see if the wrapper.log file has been modified. If it has been modified then the last 64,000 characters of the wrapper.log file are copied into a memory tag. The memory tag is automatically created when the project is first used.
A binding and Python scripting in the ViewerWindow window updates the display of the wrapper.log file when the content changes.
The AutoRefresh button is used to toggle on and off the functionality to automatically update the display of the wrapper.log file content. The auto update functionality is on by default.
The ViewerWindow window automatically scrolls the display of the content to the newest content as it comes in.
The Highlight Text field is used to highlight text in the wrapper.log contents that is displayed. This is useful for searching and finding specific text in the content.
More Useful Projects
The Perfect Abstractions development team is interested in developing more useful tools and projects. If you think of something that you want feel free to tell us. We might implement it.
27 July 2015
A most excellent utility you wrote. Thank you! I've been using wrapper logs extensively lately (due to SFC and webservice development) and this will help save time versus RDPing into the server. I made minor changes for my Windows environment, but the only thing that doesn't work is the scrollToTheBottom method. I keep getting 'ViewerWindow closed, can't scroll to the bottom'. And I don't see that method in the doc viewer help page. Deprecated? Hidden? I'm running 7.7.5.
Again, thanks a lot. I enjoy reading your blogs.
27 July 2015
Hi Asher, thanks for the feedback! Glad it has been useful to you. The "scrollToTheBottom" function is a custom method defined on the Document Viewer. You can see it under "Custom Methods" when you open the component scripting window for the Document Viewer object. The problem is that the function uses the window path "ViewerWindow" so if you put the window in a window folder or change the window name the functionality breaks. We are going to fix it soon so that the function no longer mentions the window path so doesn't break if the window is put in a window folder or the window name is changed.
28 July 2015
Ah, that was it indeed. I feel bad I didn't notice the custom method. I am trained to look for the bolded blue highlights for any non-default code and missed that. I fixed my paths & it works now. Thank you!
On my install I also added a simple button to launch the client diagnostics, as it's console serves a similar purpose (since most clients have the menu bars disabled).
Thanks again. I love learning new tricks to do under the hood with Ignition.
4 August 2015
The problem with using the window path was fixed. So now it is possible to rename the ViewerWindow window or put it into a window folder.