Getting Started
A first twin in ten minutes
Two components, one signal, one language boundary: a Python producer counts, a C++ consumer receives. Everything is typed by hand so that nothing is hidden; the pipelines that do this from Teamcenter or SysML v2 produce the same shapes at scale.
1. Environment
In PowerShell:
. D:\InnexisVSI\innexis_home\vsi_2026.2\env_vsi.ps1
$env:PATH = "D:\InnexisVSI\innexis_home\vsi_2026.2\common\mingw64\mingw64-11.2.0\bin;" + $env:PATH
mkdir D:\vw\first
cd D:\vw\first
A short root matters because one component is Python (see install-environment-and-licence).
2. The command file
Save as first.vsi.cmd:
set digitalTwinName FirstDT
set workspaceDir ./workspace
set digitalTwinPlatform mingw64
set simulationStep 100000
set totalSimTime 10000000
add component -type Python -name pyProducer
add port -componentName pyProducer -name pyProducer_p -gateway python2DtGenericPayload
add component -type C++ -name cppConsumer
add port -componentName cppConsumer -name cppConsumer_p -gateway c++2DtGenericPayload
define componentSignals -componentName pyProducer -signals [counter:int:output]
define componentSignals -componentName cppConsumer -signals [counter:int:input]
connect signals -sourceSignal pyProducer.counter -destSignal cppConsumer.counter -sourcePortName pyProducer_p -destPortName cppConsumer_p
generate -overwrite -no-build
quit
That is the whole grammar a small twin needs: components, ports with a gateway per language and protocol, signals with a direction, and a connection whose two ends have opposite directions.
3. Generate
vsiBuild -c -f first.vsi.cmd
About fifteen seconds. The last line names the twin folder, workspace/FirstDT. Inside:
src\pyProducer\pyProducer.py, src\cppConsumer\cppConsumer.cxx, a Makefile per
component and the FirstDT.dt file that vsiSim reads.
4. Behaviour
Open src\pyProducer\pyProducer.py and find the region marked "Before sending the packet"
(two tabs of indentation inside executeMainThreadStep). Put one line between its start
and end markers:
self.mySignals.counter = int(vsiCommonPythonApi.getSimulationTimeInNs() // 100000) % 256
The consumer needs nothing: the generated code already unpacks counter into
mySignals.counter and prints every signal each step to its log. To keep your own record,
put a print in the consumer's "After sending the packet" region:
std::printf("consumer step sees %d\n", mySignals.counter);
Alternatively, run the workspace glue over the twin from the innexis-vsi folder and skip
the hand edits; it writes a counter, a monitor and a CSV trace into both components:
python twin_glue\apply_glue_generic.py D:\vw\first\first.vsi.cmd D:\vw\first\workspace\FirstDT
5. Build
In the twin folder:
mingw32-make compile build
One C++ client and the fabric server compile, and the Python gateway extension builds
against the system Python. Success is 0 errors and vsi.build\_objs\VsiClient1.exe plus
pythonGateways0\VsiPythonGateways.cp313-win_amd64.pyd.
6. Run
vsiSim FirstDT.dt --batch --run
Ten to twenty seconds. vsi.sim\_logs\check.FirstDT.log ends with Simulation stopped by user and Total SystemC time = 10000000; check.cppConsumer.log shows counter
climbing one behind the producer, which is the one-step lag every reaction has. If you used
the glue, vsi.sim\_logs\cppConsumer_trace.csv holds the same numbers, and the checker
reads them:
python twin_glue\check_traces.py D:\vw\first\workspace\FirstDT --traces D:\vw\first\workspace\FirstDT\vsi.sim\_logs
7. Control it by hand
Start without --run and you get the VSI Simulation Control prompt in the same terminal:
vsiSim FirstDT.dt --batch
Then run 2 ms, show, step 5, showFull cppConsumer.counter, run, exit. Every
command is on running-and-controlling/simulation-control-commands.
Where to go next
- A twin from a Teamcenter interface definition:
building-a-twin/from-teamcenter-icd. - A block that exists only in SysML v2:
building-a-twin/from-sysml-v2. - The eight two-component templates in
innexis-vsi\templates(C++ pair, Python pair, Python and C++ pair, Ethernet pair, CAN pair, SystemC pair, FMU pilot, Python delay chain) each isolate one protocol or language and have all been built and run here.
Source: innexis-vsi/templates/python-cpp-pair-genericpayload (built and run 2026-09-05 and 2026-09-08, peer session); the pipeline pages of this knowledge base (EXERCISED 2026-09-08) · retrieved Tue Sep 08 2026 00:00:00 GMT+0000 (Coordinated Universal Time)