Skip to main content

ProtoTwin Connect Client

This package provides a simple client that can be used to interface with ProtoTwin Connect.

Basic Example

# STEP 1: Import the ProtoTwin client
import prototwin
import asyncio
import math

# STEP 2: Define your signal addresses (obtain these from your ProtoTwin model)
simulation_time_address = 0
motor_target_velocity_address = 3

async def main():
    # STEP 3: Start ProtoTwin Connect
    client = await prototwin.start()

    # STEP 4: Create the simulation loop
    while True:
        t = client.get(simulation_time_address) # Read signal values
        client.set(motor_target_velocity_address, math.sin(t)) # Write signal values
        await client.step() # Step the simulation forward in time

asyncio.run(main()) # Run the simulation loop

Metadata

Release files for prototwin 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prototwin 0.2.0
File Size Uploaded
prototwin-0.2.0.tar.gz 5.0 kB Details

Release files / prototwin-0.2.0.tar.gz

Download URL prototwin-0.2.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
505153f95177d443264ed1efd3b159a3c28bdf5fda2e14585d90c979f8bd01ff
BLAKE2b-256 checksum
How to use checksums
e1ecafb66bc969796c57f54669b912a0b0e4b0e703f28d2f8ee9c6b840361379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

This release

0.2.0 This release

1 release file

0.1.15

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page