Problem reading voltage ratio on Ubuntu 20

Supporting 2.7 and 3.2+
Post Reply
user2023
Fresh meat
Posts: 4
Joined: Tue Aug 27, 2024 4:26 pm
Contact:

Problem reading voltage ratio on Ubuntu 20

Post by user2023 »

I'm getting the following error when trying to read the voltage ratio from a DAQ1500 Wheatstone Bridge Sensor.

I can read the min/max ratio limits but when I try to read the voltage ratio using the getVoltageRation function I get the following error:

Code: Select all

Phidget22.PhidgetException.PhidgetException: PhidgetException 0x33 (Unknown or Invalid Value)
The value is unknown. This can happen right after attach, when the value has not yet been recieved from the Phidget. This can also happen if a device has not yet been configured / enabled. Some properties can only be read back after being set.
I get the same error using "C" as well.

OS: Ubuntu 20.04 amd64

Code: Select all

dpkg -l |grep libph
ii  libphidget22:amd64                    99:1.19.20240411-1ubuntu~20.04        amd64        Phidgets runtime library

pip show Phidget22
Phidget22                   1.19.20240513

When I enumerate the devices I am able to get advanced details from the device as seen below:

Code: Select all

 {
        "VendorVID": "06c2",
        "DeviceModelPID": "0038",
        "HubPort": 0,
        "DeviceName": "Wheatstone Bridge Phidget",
        "DeviceSKU": "DAQ1500",
        "DeviceVersion": 104,
        "Hub": "<beryl_libs.Phidget22.Phidget.Phidget object at 0x7f0e6d048160>",
        "DeviceSerialNumber": "XXXXXX_0"
    },


I've also tried different versions of the API from 1.10 all the way to the latest 1.19. Any help appreciated.
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Problem reading voltage ratio on Ubuntu 20

Post by jdecoux »

How much time are you leaving between opening the Phidget and reading it?

Some Phidgets can take 100-500ms to initialize before they report their first valid data.
user2023
Fresh meat
Posts: 4
Joined: Tue Aug 27, 2024 4:26 pm
Contact:

Re: Problem reading voltage ratio on Ubuntu 20

Post by user2023 »

I give it minutes - hours. Even rebooting doesn't help.
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Problem reading voltage ratio on Ubuntu 20

Post by jdecoux »

What do you see if you try and run the code sample for the device?

In your case I recommend checking the "Error Event Handler" box in the sample generator, to see if the device is actively reporting error codes.

And I'm sure you've already checked, but I also recommend making sure the connections to the load cell are correct and secure, as the DAQ1500 could also give that error if the load cell is not properly connected.
Last edited by jdecoux on Wed Aug 28, 2024 4:05 pm, edited 1 time in total.
user2023
Fresh meat
Posts: 4
Joined: Tue Aug 27, 2024 4:26 pm
Contact:

Re: Problem reading voltage ratio on Ubuntu 20

Post by user2023 »

Yes. Thanks for the suggestion. I tried that . I get error 51 (0x33).
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Problem reading voltage ratio on Ubuntu 20

Post by jdecoux »

When you run the example, do you see a set of changing voltage ratios?

Alternately, if you check the "Error Event Handler" box, do you see a set of error messages?

You can also try lowering the gain of the bridge input to see if the value is out of range for the default (highest) gain mode.
user2023
Fresh meat
Posts: 4
Joined: Tue Aug 27, 2024 4:26 pm
Contact:

Re: Problem reading voltage ratio on Ubuntu 20

Post by user2023 »

I don't see any voltage ratios. I get this error (via event handler) as soon as I try to read the voltage ratio.

Code: Select all

 raise PhidgetException(result)
Phidget22.PhidgetException.PhidgetException: PhidgetException 0x33 (Unknown or Invalid Value)
The value is unknown. This can happen right after attach, when the value has not yet been recieved from the Phidget. This can also happen if a device has not yet been configured / enabled. Some properties can only be read back after being set.
Thanks for your gain suggestion. I tried each level, verified it took hold via the getBridgeGain method (even slept 1 sec in between) and it didn't help.
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Problem reading voltage ratio on Ubuntu 20

Post by jdecoux »

What is the text output of the program if you run this code, specifically?

Code: Select all

from Phidget22.Phidget import *
from Phidget22.Devices.VoltageRatioInput import *
import time

def onVoltageRatioChange(self, voltageRatio):
	print("VoltageRatio: " + str(voltageRatio))

def onError(self, code, description):
	print("Code: " + ErrorEventCode.getName(code))
	print("Description: " + str(description))
	print("----------")

def main():
	voltageRatioInput0 = VoltageRatioInput()

	voltageRatioInput0.setOnVoltageRatioChangeHandler(onVoltageRatioChange)
	voltageRatioInput0.setOnErrorHandler(onError)

	voltageRatioInput0.openWaitForAttachment(5000)

	try:
		input("Press Enter to Stop\n")
	except (Exception, KeyboardInterrupt):
		pass

	voltageRatioInput0.close()

main()
Alternately, can you supply a minimum piece of code to replicate the issue?

Which channel of the device is your input plugged into? The code sample will connect to channel 0 by default.
Do you have another load cell you can try?
User avatar
burley
Human-Cyborg Relations
Posts: 26
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Problem reading voltage ratio on Ubuntu 20

Post by burley »

Do you have a multimeter available? It would be worth checking that the load cell itself is functioning normally. Disconnect the load cell from the bridge and measure the resistance between the red/white, red/green, black/white, and black/green wires. They should all be the same and nonzero nor open circuit.
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests