Applies To:
  • CitectSCADA

 Trend process intermittently produces a ‘C++ run-time error popup’

In this instance the C++ unhandled exception occurred due to file sharing violation on event trend files.

The problem was that the standby server had its data directory set to Z:\Data (a mapped drive pointing to the Citect directory on the primary server) so it was the standby server that was accessing the primary servers trend files. This was corrected to C:\Citect\Data. The problem was previously occurring within minutes after startup and is resolved after correctly configuring each treand server to use its own local copy of the trend history files.

Lessons learned. / process used, for future reference:

SysInternals Process Monitor:

We identified that the other program accessing the files was via a network share (does not appear in the normal process monitor logs). Two things in process monitor filter settings needed to identify files accessed via a share by a remote system.

  • Filter should be added for Path - Contains - C:\Citect\Data - Include         (the criteria must be "contains" and not "is" else you will only see operations on the whole directory and not specific files)
  • Default filter should be removed Process Name - is - System - Exclude    (it is the system process accessing the files on behalf of the remote machine)
To find out exactly which remote system is not straight forward with Windows XP's built in tools (Server 2003R2 and Server2008 have much better tools for this).

Right click my computer -> manage

System tools -> shared folders (shares, sessions, open files)

we watched the "open files" while repeatedly clicking refresh. Saw occasionally groups of trend files were being accessed. there is nothing in that window that ties the open files back to specific sessions. However via the count of open files in the sessions window we could see that it was the standby server accessing large number of files.

Intuition linked this to the data path in citect. It is not clear what tools could be used to identify which process on the remote machine was opening these specific files if it was not obvious, presumably process monitor again but if there are more caveats it is unknown.

if it was not possible to identify which remote system was accessing the files via computer management tool (which you would not be able too if not knowing the time that the access was happening and refreshing / watching in real time) then ultimately we could have used wireshark and used a display filter of

smb.file contains "filename"

Similar to the 'System tools -> shared folders' is command line tool 'openfiles'

Process Explorer also has some capability. (hit Ctrl-F , type in the name of the file you are searching for)