OPC Classic Core Components
The OPC Classic core components: C++ and C# code for the COM/DCOM-based industrial-automation interfaces (Data Access, Alarms and Events, Historical Data Access, Data eXchange), including sample servers and .NET wrappers. Maintained by the OPC Foundation.
Business rules, traced to source lines.
These 8 rules are a sample of the 3,973 CoreStory V3 extracted from OPC Classic Core Components. Each one links to the exact lines on GitHub at commit efe0d1d. The statement is CoreStory V3’s wording; the code excerpt is the source it cites.
In SetState, when pRequestedUpdateRate is provided: if the requested value is 0 or not a multiple of MAX_UPDATE_RATE, the actual value becomes MAX_UPDATE_RATE*(dwUpdateRate/MAX_UPDATE_RATE+1) and the result is OPC_S_UNSUPPORTEDRATE; in all cases m_uTickOffset is reset to RESET_TICK_BASELINE_NO_CALLBACK and both m_dwUpdateRate and *pRevisedUpdateRate are set to dwUpdateRate.
- 0 — requested rate causing rounding up
Also cited: L39
SetKeepAlive returns E_INVALIDARG when pdwRevisedKeepAliveTime is NULL; when dwKeepAliveTime==0 it sets m_dwKeepAlive and *pdwRevisedKeepAliveTime to 0 and returns S_OK; otherwise it rounds dwKeepAliveTime up to a multiple of MAX_KEEP_ALIVE_RATE=1000 (adding 1 to the integer quotient when not already a multiple), assigns the result to m_dwKeepAlive and *pdwRevisedKeepAliveTime, and returns OPC_S_UNSUPPORTEDRATE when the rounded value differs from the request, otherwise S_OK.
- 1000 — MAX_KEEP_ALIVE_RATE granularity for keep-alive times
- 0 — value that disables keep alive
In SetSamplingRates, if the server-returned result differs from the requested SamplingRate, that item's SamplingRate is updated to the returned value and SamplingRateSpecified is set true; else if the call failed, SamplingRate is 0 and SamplingRateSpecified false. On a general exception, all items get SamplingRate 0 and SamplingRateSpecified false.
- 0 — sampling rate cleared on failure
- true — SamplingRateSpecified when adjusted by server
- false — SamplingRateSpecified on failure
Also cited: L1593–L1597, L1633–L1637, L1644–L1648
A continuation point is expired when the UTC-now ticks exceed its stored timestamp ticks by more than 10 minutes (TimeSpan.TicksPerMinute * 10); expired points are removed and their positions disposed.
- 10 minutes — continuation point lifetime
Also cited: L1224–L1229
When creating a group with a non-empty requested name, creation fails with OPC_E_DUPLICATENAME if a group with that name already exists.
Also cited: L161–L163
When the requested group name is empty, the server generates a unique name of the form "Group%03d" using an incrementing counter, repeating until the generated name is not present in the group table.
- Group%03d — format string for generated group name
Also cited: L173
In the synchronous Write, if an item has QualitySpecified or TimestampSpecified, its ResultID is set to ResultID.Da.E_NO_WRITEQT, DiagnosticInfo is set to null, and the item is excluded from the write.
- E_NO_WRITEQT — ResultID assigned to items with quality or timestamp specified
BrowseOPCItemIDs returns E_INVALIDARG if any access-rights bits outside the low two bits are set, i.e. (dwAccessRightsFilter & 0xFFFFFFFC) != 0.
- 4294967292 — mask clearing low two bits
What was analyzed
- C# · 91 files · 34,175 lines
- C++ · 67 files · 23,375 lines
- C/C++ Header · 93 files · 6,511 lines
- IDL · 12 files · 3,838 lines
- XML · 7 files · 1,362 lines
- PowerShell · 10 files · 1,156 lines
- Windows Message File · 7 files · 943 lines
- MSBuild script · 6 files · 921 lines
- WiX source · 4 files · 788 lines
- Windows Resource File · 12 files · 787 lines
- CMake · 2 files · 558 lines
- Other (7 languages) · 23 files · 750 lines
Whole repository: 353 files. cloc 2.06 counts 75,164 lines of code in 334 of them (121,308 lines with comments and blanks).
Where this came from
Extracted by CoreStory V3 (build 4470 with two small engine fixes) using DeepSeek-V4.1-Flash from the public repository at commit efe0d1d on 2026-11-14.
- Repository OPCF-Members/OPC-Classic-CoreComponents
- Commit efe0d1d1ea86a8a727bf26a501a261765e836766
- Line counts cloc 2.06
- Rule citations Each rule shown was checked: its quote was compared with the repository source at the cited lines at this commit.
Code excerpts are from the upstream repository and remain under its OPC Foundation MIT License 1.00 license. CoreStory is not affiliated with or endorsed by the OPC Foundation.
Want this for your own codebase?
Talk to us about mapping the business rules in your repositories.