PhidgetSBC4 and BLDCMotor PhidgetException

Supporting Visual Studio on Windows
Post Reply
flavioluz
Phidgetsian
Posts: 5
Joined: Tue Oct 27, 2020 12:31 pm
Contact:

PhidgetSBC4 and BLDCMotor PhidgetException

Post by flavioluz »

Hello,


I have a PhidgetSBC4 and a BLDCMotor.

In Phidget Control Panel, it works fine.

In my Visual Studio 2019 C# program, when I Open the BLDCMotor the TargetVelocity
passes from 0 before open() to invalid after open().

I can only change it back to 0 if in the open() I use a 5000ms timeout, any other value I receive the same error below.

When I'm going to change the TargetVelocity to 1 I receive this error:
PhidgetException 0x0d (Invalid)\nInvalid or malformed command. This can be caused by sending a command to a device which is not supported in it's current configuration.

If I try to change the StallVelocity to a lower value before setting TargeVelocity to 1, I get the same error.

What is wrong?

Here is the BLDCMotor condition before I try to change the value.

motor {Phidget22.BLDCMotor} Phidget22.BLDCMotor
Acceleration 1
Attached true
BrakingStrength 0
Channel 0
ChannelClass BLDCMotor
ChannelClassName "PhidgetBLDCMotor"
ChannelName "Brushless DC Motor Controller"
ChannelSubclass None
DataInterval 250
DeviceClass VINT
DeviceClassName "PhidgetVINT"
DeviceFirmwareUpgradeString "DCC1100"
DeviceID PN_DCC1100
DeviceLabel ""
DeviceName "Brushless DC Motor Phidget"
DeviceSKU "DCC1100"
DeviceSerialNumber 592533
DeviceVINTID 65
DeviceVersion 120
Hub {Phidget22.Phidget}
HubPort 3
HubPortCount 6
IsChannel true
IsHubPortDevice false
IsLocal false bool
IsRemote true
MaxAcceleration 100
MaxBrakingStrength 1
MaxDataInterval 60000
MaxFailsafeTime 0
MaxPosition 1E+15
MaxStallVelocity 2000
MaxVelocity 1
MeshMode motor.MeshMode threw an exception...
MinAcceleration 0.1
MinBrakingStrength 0
MinDataInterval 100
MinFailsafeTime 0
MinPosition -1E+15
MinStallVelocity 0
MinVelocity 0
Parent {Phidget22.Phidget}
Position 0
RescaleFactor 1
ServerHostname "192.168.1.241"
ServerName "phidgetsbc"
ServerPeerName "192.168.1.241:5661"
ServerUniqueName "192.168.1.241"
StallVelocity 1000
TargetBrakingStrength 0
TargetVelocity 1
Velocity 0
flavioluz
Phidgetsian
Posts: 5
Joined: Tue Oct 27, 2020 12:31 pm
Contact:

Re: PhidgetSBC4 and BLDCMotor PhidgetException

Post by flavioluz »

Found the cause, we can only use MotorPositionController or BLDCMotor at a time. If we open() both, the last one will give an phidgetexception when is used.

Just a note, the Phidget API could return an error on Open() when already in use as a different type. This way it's clear to the user what's happening.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest