Problems with Libraries 22

Supporting 2.7 and 3.2+
satsriakal
Phidgetsian
Posts: 9
Joined: Sun Nov 12, 2017 3:44 am
Contact:

Problems with Libraries 22

Postby satsriakal » Wed Nov 15, 2017 2:30 pm

Dear Sirs,

I'm coding for InterfaceKit888 with Python libraries.
I implemented a code with old libraries, using InterfaceKit() module, and everything was working properly, but when I swapped to the last version libraries (Phidgets22), I could'n find InterfaceKit() and I wrote a new code with API, but the result is really bad compared to the first one.
Is it possible to have InterfaceKit() module in the last version of libraries as well?

Best regards
Beppe

User avatar
mparadis
Site Admin
Posts: 631
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Problems with Libraries 22

Postby mparadis » Wed Nov 15, 2017 2:43 pm

In the new libraries, objects have been split up into individual channels instead of whole boards. The InterfaceKit object has split into DigitalInput, DigitalOutput, VoltageInput and VoltageRatioInput. For more information, look at this guide.

satsriakal
Phidgetsian
Posts: 9
Joined: Sun Nov 12, 2017 3:44 am
Contact:

Re: Problems with Libraries 22

Postby satsriakal » Wed Nov 15, 2017 2:58 pm

Thanks for the answer.
I see what you say, but I see that the learning curve has drastically worsen, time for writing code has increased and performances went down...
With eight sensors the response time has become very slow...

If I compare two codes, the first one with old libraries and the other one with new libraries, the first one is definitively the best one: little coding time, best performances....

New versions should improve...

User avatar
mparadis
Site Admin
Posts: 631
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Problems with Libraries 22

Postby mparadis » Wed Nov 15, 2017 3:03 pm

The problem with Phidget21 was that because many devices shared the same object type, there had to be more and more exceptions just to get them to fit the same mould. Giving each channel its own object also made it easier to set the properties of each channel separately (e.g. setting individual brightness, current and voltage limit for an LED controller).

As far as response time is concerned, it should be no different in Phidget22. If it seems slower, you may not have set dataInterval to the minimum value.

satsriakal
Phidgetsian
Posts: 9
Joined: Sun Nov 12, 2017 3:44 am
Contact:

Re: Problems with Libraries 22

Postby satsriakal » Wed Nov 15, 2017 3:09 pm

The code is not able to recognize SENSOR_TYPE constants. What have I to do?
Have I to create an object for any sensor connected to the InterfaceKit888 board? Have I to call setOnAttachHandler for any sensor connected?

What do you mean datainterval?

I understand your reasons, but I think that now it's more complicated than before. Phidgets strength was in their simplification

User avatar
mparadis
Site Admin
Posts: 631
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Problems with Libraries 22

Postby mparadis » Wed Nov 15, 2017 4:04 pm

You have to type the name of the enumeration before the sensor type, for example:

Code: Select all

VoltageSensorType.SENSOR_TYPE_1127


The data interval can be set for each channel using setDataInterval. The minimum should be 1 millisecond, so typing setDataInterval(1) for a particular voltageInput channel will give you the maximum rate of data coming in.

satsriakal
Phidgetsian
Posts: 9
Joined: Sun Nov 12, 2017 3:44 am
Contact:

Re: Problems with Libraries 22

Postby satsriakal » Wed Nov 15, 2017 4:07 pm

Thanks a lot!

satsriakal
Phidgetsian
Posts: 9
Joined: Sun Nov 12, 2017 3:44 am
Contact:

Re: Problems with Libraries 22

Postby satsriakal » Wed Nov 15, 2017 4:14 pm

If I use setDataInterval() the system locks and I get "watchdog: signaling pd..." messages in the console

Can you help me?

User avatar
mparadis
Site Admin
Posts: 631
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Problems with Libraries 22

Postby mparadis » Thu Nov 16, 2017 8:29 am

I've never heard of that error before. I looked it up online and it seems like "pd" is something called "Pure Data". Are you using that?


Return to “Python”

Who is online

Users browsing this forum: No registered users and 0 guests