Skip to main content
InSource Solutions

Writing Informational, Warning, and Error messages to the SMC Log Viewer using external applications

             insource_logo_large.jpg                     TECHNOTE

Description

Sample Description

 

Author

Joe Hefner

Publish Date 7/31/13

Applies to Software

Wonderware Logger

Applies to Version

8.0 and Higher

Applies to System/Module

 

Article Version

1.01.01

Problem Statement

 

A statement of the problem scenario encountered by the user.

 

Solution Details

Using the UseSMCLogger.dll, a user can write message to the Wonderware SMC Log Viewer from a variety of external applications. The solution below was written using Microsoft Visual Studio .Net 2010 with C Sharp. However, any other .Net programming language could have been used just as easily.  This tech note is intended to be used as a guide for writing to the SMC Log Viewer and is not intended to be a technical  document explaining the features or functionality of the UseSMCLogger dll.

 

 

UseSMCLogger.dll can be downloaded from the location below:

 

http://www.insourcess.com/techsupport/docs/technotes/TN63a.zip

 

 

 

 

Step 1)

From the Microsoft Visual Studio development environment choose Project \ Add Reference

TN63_1.jpg

Step 2)

Browse to and select the UseSMCLogger.dll file linked to from this tech note.

TN63_2.jpg

Step 3)

I have created the simple form below to show the desired functionality of the available methods.

TN63_3.jpg

Step 4)

After double clicking on a button in the development environment, I can have it write an informational message into the SMC Logger by using the available method ArchestrA.Diagnostics.UseSMCLogger.LogInfo().

 

In the example below, txtLogger is the name of the text box I will be using to hold the log information that I wish to write to the logger as an informational message:

TN63_4jpg.jpg

Step 5)

Use the same steps listed in step 4 to include the functionality for the warning and error buttons. The methods that can be called for warnings and errors are listed below:

 

Warning:

ArchestrA.Diagnostics.UseSMCLogger.LogWarning().

 

Error:

ArchestrA.Diagnostics.UseSMCLogger.LogError().

 

After completing all of this, your form should look similar to the one below:

TN63_4.jpg

Step 6)

The next step is to execute the program and test the functionality of the buttons. The example below shows the Form created to write to the logger. At this point you should be able to type in the message that you wish to write and click the appropriate button.

TN63_5.jpg

Step 7)

Check the log viewer to make sure all of the functions work as desired. Informational messages will show up in white. Warning messages will show up in yellow and Error messages will show up in red as displayed in the picture below:

TN63_6.jpg