tc_measurement
Create and manage TwinCAT scope and analytics measurement projects, control data recording, and configure logger/stream nodes for data acquisition.
Instructions
Measurement (TE130X Scope View) projects + TwinCAT Analytics (TIAN) logger/stream config. Scope/Analytics PROJECTS are separate EnvDTE.Project nodes (AddFromTemplate), NOT System Manager tree nodes; TIAN logger/stream nodes ARE System Manager children (CreateChild/DeleteChild under TIAN). Requires the respective products installed (scope + analytics templates) — if absent the action fails with a clear 'tooling not installed' message rather than a raw COM HRESULT. Actions: scope_create (name, template? = full .tcmproj path [default: first installed under TE130X-Scope-View\Templates\Projects], destination? = folder [default: solution dir]) — AddFromTemplate a new Scope project; scope_add_child (project, parentPath? = ^-path of names from scope root, name?, elementType? default 0) — CreateChild(out item,name,elementType); only elementType 0 is VERIFIED, non-zero values are EXPERIMENTAL; deep parentPath resolves by enumerating existing children by name; scope_rename (project, path, newName) — ChangeName on the element at path; scope_record (project, state 'start'|'stop') — StartRecord/StopRecord; GUARDED: state='start' performs LIVE data acquisition and requires confirm="ALLOW_MEASUREMENT_RECORD" (state='stop' needs no confirm); analytics_create (name, template? = full Analytics project template path [must resolve or pass explicitly], destination? = folder) — AddFromTemplate a new Analytics project (project creation ONLY; network/function wiring is UNVERIFIED and not implemented); logger_create (name, before?) — CreateChild a DataLogger (subType 1) under TIAN (config edit, no confirm); logger_delete (name, dryRun?, confirm) — DeleteChild under TIAN, GUARDED confirm="ALLOW_TWINCAT_DELETE" (dryRun:true previews existence without deleting); stream_create (name, before?) — CreateChild a StreamHelper (subType 0) under TIAN (config edit, no confirm); stream_delete (name, dryRun?, confirm) — DeleteChild under TIAN, GUARDED confirm="ALLOW_TWINCAT_DELETE"; the actual node name is '_Obj1 (StreamHelper)' (the suffix is appended for you). For raw ProduceXml/ConsumeXml on a TIAN logger/stream node (e.g. 'TIAN^') use tc_tree get_xml/set_xml. OMITTED as UNVERIFIED: Scope data-export (SaveSVD/ExportCSV/ExportTDMS/ExportBinary/ExportDAT), Scope-Server (ShowControl/CloseControl/Disconnect), LookUpChild, and all Scope/Analytics enums. Nothing here targets the safety system.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | No | ||
| mode | No | DTE attach mode; default active | |
| name | No | ||
| path | No | ||
| state | No | ||
| action | Yes | ||
| before | No | insert before this sibling under TIAN | |
| dryRun | No | ||
| confirm | No | ||
| newName | No | ||
| project | No | ||
| summary | No | ||
| template | No | ||
| returnXml | No | ||
| parentPath | No | ^-path of names from the scope project root to the parent element | |
| destination | No | ||
| elementType | No | CreateChild elementType; only 0 is verified |