Page 2 of 2

Re: Getting Started with Python and Debian

Posted: Fri Mar 02, 2018 10:49 am
by mparadis
When using the built-in functionality of a VINT port (Digital Input, Digital Output, VoltageRatioInput, or VoltageInput) you need to use setIsHubPortDevice(1), so it knows that it's opening the port itself, and not a VoltageRatioInput channel belonging to a device connected to that port. You'll still have to set HubPort, but not channel.

This video may help clear up the different cases of opening channels.

Re: Getting Started with Python and Debian

Posted: Fri Mar 02, 2018 10:58 am
by monteshaffer
Thanks, I watched the video before...

Code samples are more valuable:

Code: Select all

    ch = VoltageRatioInput()
    ch.setIsHubPortDevice(1)
    ch.setDeviceSerialNumber(496910)
    ch.setHubPort(2)
    ch.setChannel(0)
and

Code: Select all

ch = VoltageInput()
    ch.setIsHubPortDevice(1)
    ch.setDeviceSerialNumber(496910)
    ch.setHubPort(2)
    ch.setChannel(0)
seem to work as expected...

How can I adjust the event capture time? e.g., every 5ms, every 1000ms, and so on...

Re: Getting Started with Python and Debian

Posted: Fri Mar 02, 2018 11:04 am
by monteshaffer
Also, the VoltageRatio is supposed to be between 0 and 1 but appears to be in a different range:

Code: Select all

Waiting for the Phidget VoltageRatioInput Object to be attached...

Attach Event Detected (Information Below)
===========================================
Library Version: Phidget22 - Version 1.0.0 - Built Feb 26 2018 19:41:25
Serial Number: 496910
Channel: 0
Channel Class: 31
Channel Name: Voltage Ratio Input
Device ID: 98
Device Version: 100
Device Name: Hub Port - Voltage Ratio Mode
Device Class: 21


Gathering data for 15 seconds...
VoltageRatio: 0.000090
VoltageRatio: 0.000060
VoltageRatio: 0.000060
VoltageRatio: 0.000060
VoltageRatio: 0.000060
VoltageRatio: 0.000060
VoltageRatio: 0.000000
VoltageRatio: 0.000000
VoltageRatio: 0.000030
VoltageRatio: 0.000000
VoltageRatio: 0.000030
VoltageRatio: 0.000060
VoltageRatio: 0.000060
VoltageRatio: 0.000060
VoltageRatio: 0.000060
VoltageRatio: 0.000090
VoltageRatio: 0.000090
VoltageRatio: 0.000060
VoltageRatio: 0.000030
VoltageRatio: 0.000030
VoltageRatio: 0.000000
VoltageRatio: 0.000000
VoltageRatio: 0.000030
VoltageRatio: 0.000060
VoltageRatio: 0.000060

Re: Getting Started with Python and Debian

Posted: Mon Mar 05, 2018 9:20 am
by mparadis
You can change how often data comes in using setDataInterval.

VoltageRatio is between 0 and 1; it just looks like you're measuring a very, very small voltage change on that channel. If you're expecting higher values, it's possible the wrong port has been opened, since that looks like the kind of data you'd get from a port that has nothing connected to it.