Skip to main content
InSource Solutions

TN DA119 Troubleshooting Wonderware FSGateway DA Server

insource logo large.jpg

 

Description

This document describes troubleshooting tools that can be used to deal with FS Gateway DA Server problems you may encounter.

 

  • Author: Peter Farrell
  • Published: 06/30/2015
  • Applies to: FSGateway DA Server 1.0 and above

 

 

Details

The DAServer Manager provides access to diagnostics and other statistical data, and the Log Viewer provides access to event messages logged during the operation of FS Gateway. Also, your client (for example, InTouch) can monitor connectivity with your data source through the $SYS$Status item. Use these tools together with the information in this section to troubleshoot FS Gateway.


Note: In order to determine the version of your FS Gateway, perform the following steps. Search for FSGateway.dll, right-click on the File Name, select Properties on the context menu, and select the Version tab on the Properties dialog box. The version of your FS Gateway is listed under File Version.

 


Monitoring Connectivity Status with a Data Source


The built-in discrete item, $SYS$Status, can be used to monitor the status of communications with your data source. This item is set to the following:


•  0 (zero) when communication with the data source fails. 


•  1 (one) when communication is successful. 


Note: For DDE/SuiteLink clients, $SYS$Status always comes from the leaf level of FS Gateway hierarchy branch, which is the destination data source. For OPC clients, $SYS$Status can be accessed at all hierarchy levels. $SYS$Status at the root level of the whole hierarchy tree is always good, as it represents the quality status of the local computer itself. Hence, for practical application, OPC clients should reference $SYS$Status at any hierarchy levels other than the root.


Enter the following DDE reference formula in the appropriate place in your client:


=FSGateway|<Device Group>!$SYS$Status


where:


FSGateway is the name of FS Gateway application.


<Device Group> is the exact device group defined in FS Gateway for the data source.


$SYS$Status is the discrete item used to monitor the status of connectivity with the data source.


Example:


=FSGateway|ModbusOverSL_FastTopic!$SYS$Status

 
Enter the following OPC item reference syntax when adding the item in your OPC client:


<YourLinkName>.$SYS$Status


where:


<YourLinkName> is the assembly of hierarchy node names leading to a specific data source.


$SYS$Status is the discrete item used to monitor the status of connectivity with the data source.


Example:


ModbusOverSL.FastTopic.$SYS$Status


Note: In case of a data source disconnection, FS Gateway attempts the number of connection retries as configured for the given data source object, and makes no more attempts afterward. Subsequently, it is up to the client to reinitiate the connection via the system item $SYS$Reconnect.

 


Monitoring the Status of Conversations with DDE/SuiteLink Clients


The InTouch WindowViewer supports built-in topic names, called DDEStatus and IOStatus, that can be used to monitor the status of specific DAS conversations. 


For example, assume that WindowViewer (VIEW) is communicating through FS Gateway with a data source with the topic name ArchestrA. The discrete items, DDEStatus and IOStatus, are set to:


•  0 (zero) when the conversation between FS Gateway and InTouch View fails. 


•  1 (one) when the conversation between FS Gateway and InTouch View is successful. 


Note: These items represent the status of communication between the client and FS Gateway.

 


Using DDEStatus and IOStatus in Excel


The status of communications between FS Gateway and InTouch can be read into Excel by entering the following DDE reference formula in a cell on a spreadsheet:


=view|DDEStatus!ArchestrA


or


=view|IOStatus!ArchestrA


where:


view is the name of the InTouch application.


[DDE][IO] Status is the built-in topic name used to monitor the status of communications between FS Gateway and InTouch.


ArchestrA is the exact access name defined in FS Gateway for the data source.

 


Reading Values from FS Gateway into Excel


Values may be read directly into Excel spreadsheets from FS Gateway by entering a DDE formula into a cell using the following format:


=applicationname|<devicegroup>!itemname


Example formula:


=FSGateway|ArchestrA!'<tagname>'


where:


FSGateway is the name of FS Gateway application.


ArchestrA is the exact device group name defined in FS Gateway for the data source.


<tagname> is the actual location in the data source that contains the data value. This is the item name.


In this example, each time the value of <tagname> changes in the data source, FS Gateway automatically sends the new value to the cell containing the formula in Excel.


Note: Refer to the Microsoft Excel manual for complete details on entering Remote Reference formulas for cells.

 

 

Error Messages and Codes


To troubleshoot FS Gateway problems, use the following error messages together with the DAServer Manager Diagnostics data. Use the Log Flag data to customize the messages logged to the Log Viewer. See the Log Viewer online documentation for more information about using log flags.


FS Gateway processes write requests by receiving them from a client, doing any necessary type conversions, and then forwarding them to the data source. The write request from the gateway to the data source succeeds or fails.


In the case of write success, the gateway informs the client that the write succeeded through write acknowledgement support provided by the client side protocol.


In the case of a write failure, the gateway informs the client that the write failed through the same client side protocol support. In the case of write failure to items on ArchestrA, DDE, SuiteLink and InTouch data sources, OPC_E_BADRIGHTS is reported regardless of the failure reason.

 

DDE/SuiteLink Client to Any Data Source – Write Errors


In the case of DDE, FastDDE and SuiteLink clients, the write response is a Nak (negative acknowledgement) with no additional failure detail code. When FS Gateway detects a failed write condition, it responds to the client with the Nak.

 

OPC Client to ArchestrA – Write Errors


In the case of an OPC Client, the following error code support is used:


FSG_Image_001.png


A failed write to an ArchestrA data source is handled as follows:


•  If ArchestrA responds with Nak, FS Gateway sends an E_FAIL error code to the OPC Client. 


•  If FS Gateway cannot successfully convert the requested OPC data, this maps to a new vendor specific error for OPC indicating “Conversion Error” (OPC_E_BADTYPE). 


•  If the item handle is unknown to FS Gateway or ArchestrA, the OPC_E_INVALIDHANDLE error code is sent. 


•  If the item name is not valid in FS Gateway or ArchestrA, the OPC_E_UNKNOWNITEMID error code is sent. 

 

 

OPC Client to DDE/SuiteLink Data Source – Write Errors


A failed write to a DDE/SuiteLink data source is handled as follows:


•  If the data source responds with Nak, FS Gateway sends an E_FAIL error code to the OPC Client. 


•  If FS Gateway cannot successfully convert the requested OPC data, this maps to a new vendor specific error for OPC indicating “Conversion Error” (OPC_E_BADTYPE). 


•  If the item handle is unknown to FS Gateway or the data source, the OPC_E_INVALIDHANDLE error code is sent. 


•  If the item name is not valid in FS Gateway or the data source, the OPC_E_UNKNOWNITEMID error code is sent. 

 

 

Runtime Diagnostics and Error Reporting 


For each data source connection, FS Gateway provides a read-only string item to each connected client called:


$SYS$GatewayConnectionStatusString


To each client, this item functions like other items, just under the topic or device group level. It indicates whether the gateway has established a successful connection to the configured data source and topic (if any) as follows:


•  “Connected” 


•  "Disconnected” 


Another item, called $SYS$GatewayConnectionStatus, is a Boolean that reads True when connected and False when disconnected. Note in the case of a DDE/SuiteLink data source, the connection is to an application and a topic. Also, in the case of an ArchestrA data source, the connection is to a Platform through Message Exchange. And in the case of an OPC data source, the connection is to an OPC Server through COM/DCOM object creation.

 

 

Communication Failures


FS Gateway behaves in the following manner in the case of failed communication with a data source:


•  The gateway attempts to periodically reestablish a connection with the data source up to the maxmium number of retry attempts as specified in its Reconnect Attempts parameter. 


Note: The gateway is not responsible for starting the data source server, unless the source protocol supports it. OPC has this capability.


•  The gateway marks all items being read from the data source with Bad quality. OPC carries a sub-status of Comm Failure. 


•  Write attempts to the data source are rejected with an appropriate error code. 


FS Gateway behaves in the following manner in the case of failed communication with a client:


•  The gateway unsubscribes (deactivates) all items on the data source that were previously subscribed to by the failed client. (Exceptions: Those items required by other, still connected, clients remain subscribed. Also, in the case of an OPC client, FS Gateway maintains subscriptions to all items on the data source previously subscribed to by the failed client.) 


•  The gateway accepts future attempts to reconnect from the client. Reconnection is the responsibility of the client. 


Important: If FS Gateway fails to connect to a remote OPC server through both its ProgID and ClassID, then lower the DCOM Authentication Level of the OPC server to None. Do this by opening Control Panel on the remote computer, double-clicking Administrative Tools, double-clicking Component Services, and then expanding the hierarchy tree under the Console Root as follows: Component Services, Computers, My Computer and DCOM Config. Click DCOM Config. In the right pane, right-click on the OPC server you cannot connect to, and then click Properties on the shortcut menu. On the General page of the properties dialog box, select None for Authentication Level. Click OK.


Communications failures with an ArchestrA data source behave in the following manner:

 

FSG_Image_002.png