Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Interface for OPC DA

OPC refreshes

  • Last UpdatedMay 22, 2025
  • 3 minute read

Logging refreshes

To log OPC refreshes, enable debug option 8, which causes PI Interface for OPC DA to create three log files: opcscan.log, opcrefresh.log, and opcresponse.log. If the interface is running as a service, the files are located in the %windows%/system32 directory (%windows%/sysWOW64 for 64-bit systems). Otherwise, the files reside in the working directory for the interface process. The working directory does not need to be the same as the directory containing the .exe file.

When the interface sets the flag for a scan, it logs the current time, the number of the scan class, and the current value of the scan flag in the opcscan.log file. The time stamp is in UTC (Greenwich time zone, daylight savings time is not observed), structured as a FILETIME structure written as a 64-bit hexadecimal field. The lower and upper halves of the number are transposed and the actual number is a count of the interval since January 1, 1601, measured in 10E-7 seconds.

After logging the data, the interface sets the scan flag for the group, then the COM thread takes its turn. When the interface cycles around to perform the poll, it logs the time, the scan class, and the TransID used in the opcrefresh.log file. For v1.0a server, the TransID logged is the TransID that was returned from the last poll of the group. For v2.0 servers, it is the actual TransID returned from the server.

When the interface receives data from the OPC server, it logs the time, the scan class, and the TransID received in the opcresponse.log file. For advise points, no entries are logged in the opcrefresh.log and opcscan.log files. Only the opcresponse.log file is updated.

Time stamps in PI Interface for OPC DA logs are stored in their native format, which is hard to read. To translate the time stamps to a readily readable format, use the following programs, which are installed into the Tools sub-directory below the interface directory:

  • opcscan.exe

  • opcrefresh.exe

  • opcresponse.exe

To run one of these programs from the command line, specify the input and output file names. Examples:

> opcscan.exe opcscan.log scan.log

> opcrefresh c:\pipc\Interfaces\OPCInt\opcrefresh.log c:\temp\refresh.log

> tools\opcresponse opcresponse.log response.log

The utilities display the UTC time stamp that came with the data, both raw and translated, the time stamp translated into local time, both raw and translated, and the PI time sent to Data Archive. For example:

response.log 126054824424850000 2000/06/14 18:54:02.485 126054680424850000
2000/06/14 14:54:02.485 960994309.485001 2 1db8

To check the time stamp returned from the OPC server, consult these log files. The time stamp is based on 1 January 1600 UTC, so if you see a date around 1600, it indicates that the server is not sending valid time stamps. To configure the interface to create time stamps when it gets the data, use PI ICU to enable the Interface Provides Timestamp option on the OPCInt page (or edit the batch file and specify the /ts=N parameter).

If the interface is running with debugging options 32 or 64 enabled, the log file contains entries for individual data items that were received by the COM thread. For advise points, the group number in the opcresponse.log file might not be correct for entries generated by debugging options 32 or 64, although the shorter entries generated by debugging option 8 correspond to the correct group number.

By looking at the log files, you can see when the interface polled for data, when it made the call, and when the data came in. If the flag in opcscan.log is non- zero, the last call made to the server did not return by the time the interface started another poll. If you find non-zero flags in the log file, contact your server vendor and have them contact AVEVA.

No OPC server response to refresh calls

To determine whether the OPC server is responding to the refresh calls made by the interface, check the local PI Message Log file for the following message:

The OPC server did not respond to the last refresh call for scan class 2, and has not responded to the previous 100 refresh call(s).

This message indicates that the OPC server failed to respond to a refresh call. This problem occurs when the OPC server cannot keep up with the update rates or has suspended operation due to a bug. The message is repeated for each additional 100 refresh calls that receive responses from the OPC server for each scan class. If these messages appear in your local PI Message Log, data loss might be occurring. Contact your OPC server vendor immediately, and consider the following adjustments to reduce load on the OPC server:

  • Move points into the Advise scan class 1.

  • Reduce the total number of scan classes for the interface.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in