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.1.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prototwin-0.1.15.tar.gz | 4.9 kB | Details |
Release files / prototwin-0.1.15.tar.gz
| Download URL | prototwin-0.1.15.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd10e29b853bba1aab0b8e1f1ab4a20fa97b8b207862485421f218020819cb89
|
|
BLAKE2b-256 checksum How to use checksums |
df0689904af7f96792df300ef06db37eaba8e26c596415cd1f4467eb7e76cf7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|