VINT python help

Supporting 2.7 and 3.2+
Post Reply
florisvb
Fresh meat
Posts: 1
Joined: Mon Jan 19, 2015 1:06 pm
Contact:

VINT python help

Post by florisvb »

I am trying to collect data in python from an RTD device hooked up to a VINT hub. The VINT hub is connected to a ubuntu machine. When I run the HelloWorld.py (Manager) from https://www.phidgets.com/?view=code_samples&lang=Python the VINT hub shows up, however, I can't figure out how to actually get the RTD resistance data.

When I run either the ReistanceInput.py or the TemperatureSensor.py examples I just get a time out. What do I need to change in those scripts to get them working with the VINT hub?
DarkLight
Phidgetsian
Posts: 12
Joined: Wed Dec 27, 2017 6:59 am
Contact:

Re: VINT python help

Post by DarkLight »

This is code for temperature sensor connected to VINT (actually, a humidity phidget HUM1000_0, but it should work with any temperature sensor connected to VINT...)

Code: Select all

# -*- coding: utf-8 -*-
from Phidget22.Devices.TemperatureSensor import *
from Phidget22.Net import *

TempArray = []

i = 0

while 1:
    ct = TemperatureSensor()
    
    try:
        ct.openWaitForAttachment(500)
        
    except PhidgetException as e:
        break
    TempArray.append(ct)
    

for i in TempArray:
    print("Serial: %s Temperature: %0.2f°C" % (i.getDeviceSerialNumber(), i.getTemperature()))
    i.close()

    
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests