WEBfactory 2010

Sample Connector Test Application Description

Abstract

Check out this article and learn more details about the WEBfactory 2010 Sample Connector Test Application.

The Sample Connector Test application is provided with the WEBfactory 2010 Server SDK and has the sole purpose of demonstrating how the Server SDK works.

Along with the Sample Connector Test application, a testing database TestSampleConnector is also provided. This database will provide the signals and settings for using the Sample Connector Test application. To use the Sample Connector Test application, the TestSampleConnector database must be loaded in WEBfactoryStudio and set as default.

Capture2119.jpg

The Sample Connector Test

The Sample Connector Test application contains a minimalistic server that creates a signal and updates it and a client with graphical user interface which allows the user to visualize signal register and unregister operations, single and multiple signal write operations and security operations. The results are instantly visible in the Log messages area, which can be cleared using the Clear Logs button.

Register operations

Learn more about Register operations here.

The Sample Connector Test demonstrates the Register and Unregister operations using the Local Second signal. The Local Second signal can be registered and unregistered twice to demonstrate how a signal update can be received on multiple callbacks.

Capture2120.jpg

The registration of the signal is instantly visible in the Log messages area. When the Register1 button is clicked, the RegisterSignalChangedHandler method is called and the Local Second signal is registered. The updates are received on the OnChange1 callback. The signal can be unregistered using the Unregister1 button which will call the UnregisterSignalChangedHandler method. This will stop the updates received on the OnChange1 callback.

Capture2121.jpg

The Register2 button calls same RegisterSignalChangedHandler method which registers the Local Second signal. The updates are received on the second callback, OnChange2. The Unregister2 button will call the UnregisterSignalChangedHandler method which unregisters the Local Second signal. The updates will no longer be received on the OnChange2 callback.

Capture2122.jpg

If both Register1 and Register2 operations are triggered, the Local Second updates will be received on both callbacks.

Capture2123.jpg
Read and Write Signal operations

Learn more about Read and Write operations here.

The Read and Write operations are demonstrated through the Read Signal (Setpoint 1) Test and Write Signal (Single signal) Test (Setpoint 1) areas of the Sample Connector Test application.

Capture2128.jpg

The signal value from the Signal Value text field is written to the Setpoint 1 signal when the WRITE button is clicked. The WRITE button calls the WriteSignal method. The new value is displayed in the Log Messages area.

Capture2127.jpg

When clicking the button from the Read Signal Test (Setpoint 1) section, the ReadSignal method is called and the Setpoint 1 value will be written to the button's label.

Capture2126.jpg
Write multiple signals

Learn more about writing multiple signals here.

The Write Signals (Multiple signals) Test area demonstrates the writing of multiple signals. The WRITE SIGNALS button calls the WriteSignals method and writes the values from the Setpoint 1 Value and Setpoint 2 Value to the Setpoint 1 and Setpoint 2 signals.

Capture2129.jpg

The Log messages area will display the results.

Capture2130.jpg
Security operations

Learn more about Secure Write operations here.

The Security Operation Details section demonstrates the usage of secure signal writing.

Capture2131.jpg

If the signal group that contains the signals Setpoint 1 and Setpoint 2 is set to Write, Read, the two signals will not be written unless the appropriate credentials are provided in the Security Operation Details section.

In this case, the WRITE button will call the secure WriteSignal method (requires user credentials) to write the value to the signal. The WRITE SIGNALS button will also call the secure WriteSignals method (requires user credentials) to write the values to the signals.

If the credentials are not provided or are incorrect, the application will display the appropriate error code.

Capture2132.jpg
Capture2133.jpg

If the signal group containing the Setpoint 1 and Setpoint 2 signals is set to Write, Read (unsecure), both WRITE and WRITE SIGNALS buttons will call the unsecure WriteSignal and WriteSignals methods.