Manage structured data sources and queries.
Reference → Datasets | Tutorial | How-to Guide | Reference
Datasets Module (Reference) provides comprehensive database connectivity, query execution, and data management capabilities for the FrameworX platform. The Datasets Module enables:
The Datasets Module enables:
The module serves as the data storage backbone for Retentive Tags, Alarms Logging, Historian, and custom application data.
| Section | Path | Purpose |
|---|---|---|
| DBs | Datasets → DBs | Database connections |
| Queries | Datasets → Queries | SQL statements and procedures |
| Tables | Datasets → Tables | Direct table operations |
| Files | Datasets → Files | Recipe and text file management |
| Step | Action | Location | Purpose |
|---|---|---|---|
| 1 | Define connections | Datasets → DBs | Establish database links |
| 2 | Prepare queries | Datasets → Queries | Create SQL statements |
| 3 | Map tables | Datasets → Tables | Direct table access |
| 4 | Configure files | Datasets → Files | Recipe management |
Four system databases included in every solution:
| Database | Purpose | Location |
|---|---|---|
| Retentive | Retentive tag values | <SolutionNameAndPath>.dbRetentive |
| RuntimeUsers | Dynamic user management | <SolutionNameAndPath>.dbRuntimeUsers |
| AlarmHistorian | Alarm and audit records | <SolutionNameAndPath>.dbAlarmHistorian |
| TagHistorian | Time-series data | <SolutionNameAndPath>.dbTagHistorian |
SQLite databases are created automatically if they don't exist. Other database types must exist before connection.
Protect the Runtime Users database. By default, the Runtime Users database is an unencrypted SQLite file in the solution folder, or in the Path set under Execution Environment in Runtime Startup. Anyone who can write to that folder can replace the file, and the users in the replacement file can log on. Move the Runtime Users database to a server database with its own logon, such as SQL Server with encryption turned on, in Datasets → DBs → RuntimeUsers. Restrict write access to the solution folder and that Path folder.
TRunModule.exe (Dataset) handles:
TServer provides:
Dataset Module Thread:
TServer Database Threads:
Client Request Threads:
SQL statements with dynamic parameters:
sql
SELECT * FROM Production
WHERE BatchID = {{Tag.Batch_ID}}Direct CRUD operations without SQL:
Text-based data exchange:
xml
<DataGrid DataSource="{Dataset.Query.ProductionQuery}" />csharp
DataTable result = @Dataset.Query.MyQuery.SelectCommand();
@Tag.DataTableTag = result;csharp
TK.CopyDataTableToTag(result, @Tag.Template);Access Datasets → Monitor during runtime:
csharp
int status = @Dataset.Query.MyQuery.LastStatus;
string error = @Dataset.Query.MyQuery.LastStatusMessage;
int rows = @Dataset.Table.MyTable.RowCount;The platform's parameterization:
Configure GatewayIP for secure routing access:
The module provides multiple error detection methods:
Property Monitoring:
csharp
@Dataset.Query.Query1.SelectCommand();
if (@Dataset.Query.Query1.Error != "") {
// Handle error
}Status Methods:
csharp
string status;
DataTable result = @Dataset.Query.Query1.SelectCommandWithStatusAsync(out status);
if (status != "OK") {
// Handle error
}Connection Loss
Query Errors
Performance Issues
Module Down
Row Limiting Examples:
SQL Server:
sql
SELECT TOP 10 * FROM tableSQLite:
sql
SELECT * FROM table LIMIT 10Oracle:
sql
SELECT * FROM table FETCH FIRST 10 ROWS ONLYNCHAR columns limited to 1999 bytes (auto-adjusted)