Page 1 of 1

VINT python help

Posted: Mon Jun 04, 2018 10:08 am
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?

Re: VINT python help

Posted: Sun Aug 12, 2018 9:16 am
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()