WFServerClient Class Overview
Check out this article and learn more details about the WFServerClient Class and the parameters involved in its management.
WFServerClient provides methods and events to access already existing WEBfactory 2010 signals from other connectors or OPC Servers.
The following methods are implemented by WFServerClient class:
Register Operations
int RegisterSignalChangedHandler(string signalName, OnSignalChangedDelegate handler);
int UnregisterSignalChangedHandler(string signalName, OnSignalChangedDelegate handler);
Read Operation
int ReadSignal(string signalName, out object value);
Write Operation
int WriteSignal(string signalName, object value, out int writeResult);
int WriteSignal(string signalName, object value, string user, string userPassword, out int writeResult);
int WriteSignals(string[] signalNames, object[] signalValues, out int[] writeResults);
int WriteSignals(string[] signalNames, object[] signalValues, string userName, string userPassword, out int[] writeResults);
Debug Operation
int WriteTrace(WFTraceLevels level, string message);
The following chapters will describe each method of the WFServerClient class.
Register Operations
RegisterSignalChangedHandler
Method definition | int RegisterSignalChangedHandler(string signalName, OnSignalChangedDelegate handler); |
Calling parameters |
|
Return value |
|
Description | This method assigns a delegate to a specific signal. This delegate will be invoked in case of a signal change. The delegate void OnSignalChangedDelegate(string name, object value);
|
UnregisterSignalChangedHandler
Method definition | int UnregisterSignalChangedHandler(string signalName, OnSignalChangedDelegate handler); |
Calling parameters |
|
Return value |
|
Description | This method removes a delegate for a specific signal. This method can be called with the same calling parameters like each previous |
Read Operation
ReadSignal
Method definition | int ReadSignal(string signalName, out object value); |
Calling parameters |
|
Return value |
|
Description | This method reads a WEBfactory 2010 signal. it does not need to be registered. The read is a synchronous operation. |
Write Operation
WriteSignal
Method definition | int WriteSignal(string signalName, object value, out int writeResult); |
Calling parameters |
|
Return value |
|
Description | This method writes a value to a signal. The
|
WriteSignal
Method definition | int WriteSignal(string signalName, object value, string user, string userPassword, out int writeResult); |
Calling parameters |
|
Return value |
|
Description | This method writes a value to a signal. The
|
WriteSignals
Method definition | int WriteSignals(string[] signalNames, object[] signalValues, out int[] writeResults); |
Calling parameters |
|
Return value |
|
Description | This method writes a value to a signal. The
|
WriteSignals
Method definition | int WriteSignals(string[] signalNames, object[] signalValues, string userName, string userPassword, out int[] writeResults); |
Calling parameters |
|
Return value |
|
Description | This method writes a value to a signal. The
|
Debug Operations
WriteTrace
Method definition | int WriteTrace(WFTraceLevels level, string message); |
Calling parameters |
|
Return value |
|
Description | This method writes a message to WEBfactory 2010Activity Analyzer. All error messages from WEBfactory 2010 server modules can be displayed in that tool. This allows finding out any problems between them. Parameter level is an enumeration: enum WFTraceLevels { TraceInfo = 4, TraceWarning = 2, TraceError = 1, NoTrace = 0 }; |