Data Access

This chapter provides instructions to configure the data access of a WinCC OA SECS Gateway.

Data is exchanged with the host system via E5 SECS-II messages. The message structure is described in the SECS driver section Message Structure.

Data messages of the fundamental GEM requirements, as well as Status Data Collection and Equipment Constants (without their namelist requests) are already handled by the gateway manager. A full list of messages handled by the manager can be found in Details on the SECS Gateway Manager. Not supported messages must be handled manually in the application.

As an example we can use the data exchange of the host querying status variable namelist data with S1F11. In this example the host wants to query the namelist data for the status variables with the IDs 250 and 251. The message is received on the corresponding equipment DPE <_SecsEquip>.HostInterface.FromHost.

{
    "header": {
        "function": 11,
        "reply": true,
        "stream": 1
    },
    "body": [
        {
            "format": "U4",
            "value": 250
        },
        {
            "format": "U4",
            "value": 251
        }
    ]
}

To handle this message, a CTRL-Script could be used to answer with the correct message (S1F12) and corresponding data. For example, gather the SVID and SVNAME data from the CNS nodes <SystemName>.<SecsGemGwView>:<SecsGemEquip>.StatusVariables.SVID_<250/251>. The UNITS object could be set on the linked DPE from which the value can be gathered by the dpGetUnit function. To send the answer to the host, the library function secsgw_answerHostMessage (secsGateway.ctl) can be used.