Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming Analog Data #8

Closed
diefenbachb18 opened this issue Aug 21, 2019 · 1 comment
Closed

Streaming Analog Data #8

diefenbachb18 opened this issue Aug 21, 2019 · 1 comment

Comments

@diefenbachb18
Copy link

Hello,

I am looking to stream analog data that is collected in QTM. Looking at the examples in the SDK folders, I have found the majority of information and examples on streaming marker data.

I have tried modifying the BasicExample.py file, to stream in analog data, but I keep receiving an error when I try to retrieve the analog parameter packet.

I have no issues with my connection to QTM, and am able to stream marker data using the basic example how it is intended.

I am fairly new to Python, and any help to better understand the code would be appreciated. Thank you in advance.

CODE:
"""
Minimal usage example
Connects to QTM and streams 3D data forever
(start QTM first, load file, Play->Play with Real-Time output)
"""

import asyncio
import qtm

def on_packet(packet):
""" Callback function that is called everytime a data packet arrives from QTM """
print("Framenumber: {}".format(packet.framenumber))
header, markers = packet.get_analog()
print("Component info: {}".format(header))

async def setup():
""" Main function """
connection = await qtm.connect("127.0.0.1")
if connection is None:
return

await connection.get_parameters(parameters=["analog"], on_packet=on_packet)

if name == "main":
asyncio.ensure_future(setup())
asyncio.get_event_loop().run_forever()

@mlveggo
Copy link
Contributor

mlveggo commented Sep 3, 2019

Hi,

Analog streaming is now possible with the latest code update.

@mlveggo mlveggo closed this as completed Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants