Skip to main content

i4scada Knowledge Base

i4scada Signal writing

Abstract

In order to learn more about the i4scada Signals writing check out this article that has been easily structured for a better understanding.

This article describes the three modes, that can be set for the i4scada Signal writing functionality, as follows:

  • The Synchronous mode is the most basic signal writing mode. To enable the Synchronous mode, the „OPCSyncWrite“ Registry Key setting needs to be set to value "1". The OPCSyncWrite Registry Key setting can be found on the following path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WEBFACTORY\WFSERVER\2.00\Settings.

    OPCSync_is_1.jpg

    OPCSyncWrite = 1

    Warning

    When writing signal values while using the Synchronous mode, the write operation can be slow, since the server is blocked, until the value is written.

  • The Asynchronous mode is also known as the "fire and forget" mode. This is the default writing mode, enabled by setting the „OPCSyncWrite“ Registry Key to value "0".

    OPCSync_is_0.jpg

    OPCSyncWrite = 0

    By default, the Asynchronous mode does not return any feedback, concerning the write operation status. The server always returns a result code "0", regardless if the write operation was successful or if it failed, if the ServerSvc setting "WritingWithImmediatelyWCSAcknowledge" is set to value "true".

    Note

    Unlike the Synchronous mode, the Asynchronous writing mode does not block the server, during the write operation.

  • The second Asynchronous writing mode is similar to the previously described one. However, if the user desires to receive feedback and a result code, for the writing operation, the ServerSvc setting „WritingWithImmediatelyWCSAcknowledge“ needs to be set to the value "false".

    OPCSync_is_0.jpg

    OPCSyncWrite = 0

    The settings required for the asynchronous writing mode, with feedback, can be found under this path: "C:\Program Files (x86)\i4scada\Server\ServerSvc.exe.config".

    Note

    These settings are not relevant, when using the Synchronous mode.

    settings_ServerSvc.jpg

    The ServerSvc.exe.config file

    Warning

    When using the Asynchronous mode, with feedback, the following server result codes, can be delivered for Signal writing operations:

    ServerSignalCodes.jpg

    The Server Result Codes

    Server message

    Server Result Code

    Observation

    Succeeded

    0

    The write operation was successful.

    WriteFailed

    -1073479674

    The write operation failed due to an error.

    WriteExpired

    -300

    The write operation expired.

    Tip

    Even if the Asynchronous (with result code) mode does not block the server, during the write operation, the server waits until the write is finished.

    On slow devices, the write operation might encounter timeouts, hence, it is recommended that the „WritingStateTimeout“ setting is properly configured. By default, the timeout value is set to 500 milliseconds, but it can be increased or decreased, as desired.

    WriteFaulted

    -301

    The write operation encountered an exception and failed.