ITSyslog Script Function

ITSyslog Script Function

Introduction

The ITSyslog script function library consists of two files:

  • dll
  • wdf

The DLL contains script functions that can be used to send message to a Syslog server over UDP.

Download the ITSyslog.zip file from WeMadeKit Site.

  1. Unzip the zip file.
  2. Copy the dll and ITSyslog.wdf files and place them in your InTouch™ Install directory.
    • The functions will then be available from scripts when running WindowMaker.

Library Function

This library consists of three script function:

  • WMKSyslogStartup ( SyslogServer, Port )
  • WMKSyslogPostLog ( LogMessage )
  • WMKSyslogCleanup ( )


WMKSyslogStartup Function

This function establishes a connection to a specified Syslog server.

Syntax

[Result=] WMKSyslogStartup ( SyslogServer, Port );

Arguments

SyslogServer

The IP address of the Syslog server.

Port

The port number of the Syslog server.

Remarks

This function must be called before any syslog function, and it’s recommend to call this function when the Window Viewer is started. Refer ‘Configuring Application Scripts’ in Wonderware InTouch HMI Help for more information.

Returns an integer error code. For error code please refer https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2

Example

Status = WMKSyslogStartup ( “127.0.0.1”, 514 );

WMKSyslogStartup ( SyslogHost, iPort );


WMKSyslogPostlog Function

This function post a message to the specified Syslog server which set in WMKSyslogStartup.

Syntax

[Result=] WMKSyslogStartup ( Message );

Arguments

Message

The message content which will be send to the Syslog server.

Remarks

WMKSyslogStartup must be called once before calling WMKSyslogPostlog, otherwise a 10038 error log will be logged to LogViewer.

Returns an integer error code. For error code please refer https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2

Example

Status = WMKSyslogPostLog(“Hello, the second now is ” + StringFromIntg( $Second, 10 ));

WMKSyslogPostLog(“trigger a message to syslog server”);


WMKSyslogCleanup Function

This function establishes a connection to a specified Syslog server.

Syntax

[Result=] WMKSyslogCleanup ( );

Arguments

None.

Remarks

This function must be called before the Window Viewer shut down. Refer ‘Configuring Application Scripts’ in Wonderware InTouch HMI Help for more information.

Returns an integer error code. For error code please refer https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2

Example

Status = WMKSyslogCleanup ( );

For technical support questions, send an e-mail to us.

 

ITSyslog_1.0.8130.33661.zip (23 downloads)

Leave a Reply

Your email address will not be published.

+ 78 = 81