bulk-engineering
Bulk engineering approaches, tools, and implementation strategies for mass-generating PLC/DCS control logic, HMI displays, and I/O configurations from engineering databases. Use when planning or implementing automation of DCS engineering workflows.
What this skill does
# Bulk Engineering for DCS/PLC Automation
## The Problem
Typical mid-size plant: 200-500 motors, 100-300 valves, 500-2000 analog loops, 200-1000 discrete I/O. Manual configuration: 15-60 min/instance. Bulk engineering reduces months to days.
## General Pipeline
```
[Instrument Index / Motor List / Valve List] (Excel/CSV input)
|
v
[Engineering Database] (SQLite / structured data)
|
v
[Template Library] + [Configuration Rules]
|
v
[Code Generator] (Python + Jinja2 / string replacement)
|
v
[DCS/PLC Project Files] (PRT, XML, FHX, etc.)
|
v
[Validation] (cross-reference check, naming, completeness)
|
v
[Import to DCS Engineering Tool]
```
## Input Documents
| Document | Contains | Used For |
|----------|---------|---------|
| Instrument Index (I/O List) | Every tag, type, range, units, alarms, P&ID ref | Tag creation, scaling, alarms |
| Motor List | Motors with power, starter type, protections, interlocks | Motor block generation |
| Valve List | Valves with type, fail position, actuator | Valve block generation |
| Control Narrative | Control logic descriptions per unit | Logic implementation |
| Cause & Effect Matrix | Safety/interlock logic in tabular form | Interlock logic generation |
## Output Artifacts
1. Controller programs (function block instances + logic + parameters)
2. I/O assignments (channel-to-tag mapping)
3. HMI/operator displays (graphics, faceplates, navigation)
4. Alarm configuration (priorities, limits, deadbands)
5. Historian tags (trend definitions, storage rates)
6. OPC server configuration
---
## ABB Freelance Bulk Engineering (Primary Target)
### Method 1: PRT File Templating (Recommended)
1. Create a "golden" template PRT for each type (motor, valve, analog, etc.)
2. Export as .prt file
3. Programmatically for each new instance:
- Read template with UTF-16 encoding
- Replace all identifiers (node name, MSR name, EAM signals, descriptions)
- Update parameters
- Set checksum to `0000000000`
- Write output .prt file
4. Import each .prt into target project in Freelance Engineering Workplace
### Template Replacement Map (Motor)
| Element | Template | Replace With |
|---------|----------|-------------|
| Node name | `11301CLWW1A1` | `{area}{equip}{num}` |
| MSR primary | `11301.CLWW.1A1` | `{area}.{prefix}.{num}` |
| MSR short | `11301.CW.1A1` | `{area}.{short}.{num}` |
| Graph ref | `g11301CLWW1A1` | `g{area}{equip}{num}` |
| Description | `PHO RCK EXTR CNVR-1` | `{description}` |
| EAM signals | `XA1/XA2/XB1/XL/XS1/XS2` + node | Same prefixes + new node |
### Method 2: CSV Full Project Manipulation
Parse full project CSV, add new sections, re-import. More powerful but higher risk.
### Method 3: DMF Display Templating
1. Create template display in DigiVis
2. Export as .DMF
3. For each new display:
- Replace TXL text entries (tag names, descriptions, units)
- Replace ODB variable bindings (DIGI addresses)
- Update display navigation references
### Key Challenges
1. **UTF-16 encoding**: Must read/write correctly
2. **Internal cross-references**: EAM, MSR, LAD:PARA_REF must be consistent
3. **Checksum**: Set to 0, Freelance recalculates
4. **Unique naming**: No duplicates allowed
5. **Area mapping**: Tags must map to correct area codes
---
## Siemens TIA Portal Bulk Engineering
### TIA Openness API (.NET)
```csharp
using Siemens.Engineering;
using Siemens.Engineering.SW;
TiaPortal tia = new TiaPortal(TiaPortalMode.WithUserInterface);
Project project = tia.Projects.Open(new FileInfo(@"Project.ap17"));
PlcSoftware sw = device.GetService<PlcSoftware>();
sw.BlockGroup.Blocks.Import(new FileInfo(@"MotorFB.xml"), ImportOptions.Override);
PlcTagTable table = sw.TagTableGroup.TagTables.Create("Motors");
```
### SiVArc (HMI Auto-Generation)
Rules-based: define rules like "For every MotL FB, create faceplate." Reads PLC structure, auto-generates WinCC displays.
---
## Emerson DeltaV Bulk Engineering
### Class-Based Configuration (Most Powerful)
Define module template (class) -> instantiate many -> template changes propagate to all instances.
### FHX File Generation
```
MODULE TEMPLATE "MT_MOTOR_1SPD" /
MODULE_CLASS = DEVICE /
{
FUNCTION_BLOCK "DC-1" / DEFINITION = "DC" /
{ ATTRIBUTE MODE_BLK.TARGET = AUTO ; ... }
}
```
Text-based, parseable, generatable with Python.
---
## Recommended Technology Stack
| Component | Technology | Purpose |
|-----------|-----------|---------|
| Language | Python 3.10+ | Core automation |
| Excel I/O | openpyxl, pandas | Read input spreadsheets |
| Templates | Jinja2 / string.Template | Generate output files |
| Database | SQLite | Engineering database |
| File I/O | codecs (UTF-16) | Read/write Freelance files |
| XML | lxml | PLCopen XML, SimaticML |
| Validation | pydantic | Data validation |
| GUI (opt) | Streamlit / PyQt6 | User interface |
| VCS | Git | Version control |
## Python Template Approach
```python
import codecs
import re
import pandas as pd
# Read motor list
motors = pd.read_excel('motor_list.xlsx')
# Read template
with codecs.open('MOT_template.prt', 'r', 'utf-16') as f:
template = f.read()
# Generate for each motor
for _, motor in motors.iterrows():
output = template
output = output.replace('11301CLWW1A1', motor['node_name'])
output = output.replace('11301.CLWW.1A1', motor['msr_name'])
output = output.replace('PHO RCK EXTR CNVR-1', motor['description'])
# ... more replacements
# Reset checksum
output = re.sub(r'\[CHECKSUM\];.*', '[CHECKSUM];0000000000', output)
with codecs.open(f"{motor['node_name']}.prt", 'w', 'utf-16-le') as f:
f.write('\ufeff' + output)
```
---
## NAMUR NE 148 Requirements
The NAMUR standard for automation engineering tools mandates:
1. **Single data source** - one instrument defined once, used everywhere
2. **Template-based engineering** - define once, instantiate many
3. **Bulk operations** - create/modify/delete in mass
4. **Consistency checking** - validate cross-references
5. **Import/export** - Excel and P&ID tool integration
6. **Version management** - track changes
7. **Multi-user** - concurrent engineering
8. **Target independence** - generate for multiple DCS targets
---
## Third-Party Tools
| Tool | Vendor | Description |
|------|--------|-------------|
| SmartPlant Instrumentation | AVEVA | Central instrument DB, generates DCS configs for all vendors |
| COMOS | Siemens | P&ID to PLC code, TIA Portal integration |
| Engineering Base | AUCOTEC | Object-oriented, multi-DCS output |
| Unity App Generator | Schneider | Excel-based Modicon PLC generation |
| Ignition | Inductive Automation | Database-driven SCADA/HMI with Python scripting |
---
## Asset-Centric vs Signal-Centric
**Signal-Centric (Traditional):** Start from I/O signals. AI_Card1_Ch3 -> create tag -> configure. Matches hardware but disconnected from equipment.
**Asset-Centric (Modern):** Start from physical equipment. Pump P-101A includes motor, flow, pressure, vibration, protection. Easier to template. Aligned with ISA-88/95.
| Approach | ABB Freelance | Siemens PCS 7 | Emerson DeltaV |
|----------|--------------|---------------|----------------|
| Support | Moderate (MSR hierarchy) | Moderate (plant hierarchy) | Strong (class-based) |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.