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

File:C:/Users/gyancey/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg

Step 2)

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

File:C:/Users/gyancey/AppData/Local/Temp/msohtmlclip1/01/clip_image004.jpg

Step 3)

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

File:C:/Users/gyancey/AppData/Local/Temp/msohtmlclip1/01/clip_image006.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:

 

File:C:/Users/gyancey/AppData/Local/Temp/msohtmlclip1/01/clip_image008.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:

File:C:/Users/gyancey/AppData/Local/Temp/msohtmlclip1/01/clip_image010.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.
 

File:C:/Users/gyancey/AppData/Local/Temp/msohtmlclip1/01/clip_image012.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:

File:C:/Users/gyancey/AppData/Local/Temp/msohtmlclip1/01/clip_image014.jpg