Attaching pH sensor not ack in sample code

Supporting Java SE version 7 and up
nvmon
Phidgetsian
Posts: 5
Joined: Thu May 05, 2011 5:15 am
Contact:

Attaching pH sensor not ack in sample code

Postby nvmon » Thu May 05, 2011 10:29 am

Got my phidgets components a few days ago. Foll. is my set up:

3550 (pH) --> 1130 (pH/ORP adapter) --> 1018 (interface kit) --> PC (running Win 7 Home basic on 64-bit i3 CPU)

(a) Connected all components as above.
(b) Downloaded and installed Phidget-x64_2.1.8.20110329.exe
(c) Downloaded and installed JavaJNI_2.1.8.20110329.zip
(d) Executed Phidget Control Panel (which recognizes the 1018 and also the pH sensor, including reading pH value) so that is fine
(e) Opened the "PHSensor-full" Netbeans project in Netbeans and compiled successfully
Problem: When running the main file in this project, the screen shows up and after connecting the USB port to the PC, nothing happens. It just waits there.
(f) I noticed no waitForAttachment() method
(g) I added the method immediately after ph.openAny().
(h) Even then the screen just waits there and does not recognize/ack the fact that the 1018 was connected.
Reuqest: Please help me identify where I am going wrong.

User avatar
Patrick
Lead Developer
Posts: 3110
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Attaching pH sensor not ack in sample code

Postby Patrick » Thu May 05, 2011 2:00 pm

You need to run the interfacekit exmaple - the PHSensor example is for a discontinued product - the old USB version of the PHSensor.

-Patrick

nvmon
Phidgetsian
Posts: 5
Joined: Thu May 05, 2011 5:15 am
Contact:

Re: Attaching pH sensor not ack in sample code

Postby nvmon » Sat May 07, 2011 8:16 pm

Patrick,

Thanks a lot for your prompt response. It is working now.

A quick question: Many methods in the API (especially InterfaceKitPhidget) have the "index" as an argument. In my setup, the pH sensor is attached to port number 1 of the analog inputs on the 1018.

I am guessing that wherever I need a value for index, in my setup, I will have to use a value of "1" (I know its an integer).

Question: Is it possible to obtain this value from a method or does it need to be "hard-coded" in the program?

Sincerely,
nvmon.

User avatar
Patrick
Lead Developer
Posts: 3110
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Attaching pH sensor not ack in sample code

Postby Patrick » Mon May 09, 2011 8:43 am

It needs to be hard-coded.

-Patrick


Return to “Java”

Who is online

Users browsing this forum: No registered users and 0 guests