PDA

View Full Version : Trouble with Temp Sensor



super-d
02-26-2008, 06:12 PM
I just got my 8/8/8, installed the software and hooked it up. Tests out fine. Plugged in the temp sensor and looked at the manager and it sees it there and it "seems" to be changing when I put my finger on it to give it some heat.

When I run the demo in VB6 it never sees the sensor is attached. I attach and de-attach but VB doesn't seem to see it. No changes to the software just the "out of the box" demo.

Is there something I'm missing?

Thanks
David

Alex
02-26-2008, 07:34 PM
never sees the sensor is attached or the 8/8/8? There are no attach events for the sensor, only the Phidget USB devices (ie. the 8/8/8).

super-d
02-26-2008, 07:46 PM
Alex,

I'm using the TemperatureSensorSimple demo. It looks for the a sensor to be attached. When I run the demo it doesn't see that it is attached.



Private Sub sensor_OnAttach()
lblMessage.Caption = "PhidgetTemperatureSensor Attached"
sensor.TemperatureChangeTrigger(0) = 0
sensor.TemperatureChangeTrigger(1) = 0
Text4.Text = "0"
End Sub



never sees the sensor is attached or the 8/8/8? There are no attach events for the sensor, only the Phidget USB devices (ie. the 8/8/8).

Alex
02-26-2008, 08:46 PM
ah, gotcha! I thought you were talking about the analog Phidget temp sensor that gets plugged into the 8/8/8 interface kit.

Are you plugging the USB tempsensor directly into the USB port on your computer? I'm downloading the tempsensor simple app now, so I'll check that for errors too.

Alex
02-26-2008, 08:49 PM
First glance at the project file. Did you make sure to add a reference to the Phidget21.NET.dll in the demo app?

super-d
02-26-2008, 09:03 PM
Alex,

All is well. I don't have the USB Temperature sensor, I have the Analog. When I saw the demo I ran it and it didn't work but I didn't realize there were two different ones on our site (USB and Analog). It is working fine.

Do have one question as I test this... where do you set the SensorChangeTrigger? I put it in the form load event and then checked it. I set it to 0 but it defaulted to 10. I set it to 0 iin an OnTimer event to watch it and that did change it to 0. So where do you set it at? Is this the same as the Sensitivity setting when viewing the manager?

Thanks again,
David


First glance at the project file. Did you make sure to add a reference to the Phidget21.NET.dll in the demo app?

Alex
02-26-2008, 09:06 PM
No, you should be able to change it anywhere after the .Open() method.

super-d
02-26-2008, 09:16 PM
Yep, that that is exactly where i put it. Then in my OnTimer event every second I checked it. It was always 10 even though in my form load I had it set to sensor.SensorChangeTrigger(0)=0.

I am working with sensor 0 because it is reading the temp but it doesn't seem to hold the SensorChangeTrigger setting.

David


No, you should be able to change it anywhere after the .Open() method.

Alex
02-26-2008, 09:31 PM
Could you zip up your code and attach it?

super-d
02-26-2008, 09:45 PM
Sure, here you go. The led object is some HMI controls I was using but you can comment that out.

David

Alex
02-26-2008, 09:52 PM
hmm.... that's strange. I don't have vb6 installed on my laptop here, nor do I have an 8/8/8 handy so I'm just looking at code, but it looks like you have everything entered right.

I'll have to take a look at this tomorrow when I get to work. I have vb6 installed there, and I got a couple of spare 8/8/8's I can test it out on.

super-d
02-27-2008, 02:02 PM
Alex,

Did you have any luck reproducing this problem at work?

Thanks
David

Alex
02-27-2008, 02:14 PM
Hey David. Do you mind logging on to TRC Chat? I ran into some problems unrelated to this and I needed to talk to you about it.

super-d
02-27-2008, 05:08 PM
Alex,

WOW VB.Net 2005 is a whole different animal! All I did was convert my program and I got the same results.

David

Alex
02-27-2008, 05:16 PM
Yeah, vb.NET 2005 is really sweet, once you get the hang of it. It's TONS more powerful than vb6.

The theory I had was with the vb6 to Phidget interface, so converting your project should still result in the same error.

Download the vb.NET demo applications and run the either the interfacekit-controller or the Interfacekit-full. You have to open the .sln in Visual Studio, then just press the play button.

http://www.phidgets.com/downloads.php?example_id=6

super-d
02-27-2008, 05:46 PM
I did that last night... Both the VB6 and VB.Net demos seem to work fine.



Download the vb.NET demo applications and run the either the interfacekit-controller or the Interfacekit-full. You have to open the .sln in Visual Studio, then just press the play button.

http://www.phidgets.com/downloads.php?example_id=6

Alex
02-27-2008, 07:33 PM
they both work fine? I'm confused as to what the problem is then?

super-d
02-27-2008, 07:48 PM
Alex,

The demos run fine but it is when you set the SensorChangeTrigger to 0 it doesn't seem to stay so when you read back the setting it will be 10. If you get a chance to try the VB6 sample code I uploaded, try it and see what you get. Should I be looking for some type of certain results when I run the demos?

Maybe it's just me and I'm doing something wrong or expecting different results but the manual says you can change it but it didn't work for me UNLESS I put it in the OnTimer event but that sort of defeats the purpose of the function.

David

Alex
02-27-2008, 08:28 PM
ok super-d. I figured it out. Something that I totally forgot till I started fiddling around.

After you call the .Open() command, you need to wait for the physical attachment of the Phidget USB device to occur. It doesn't attach right away, but a few hundred or so milliseconds after.

So, just for an example, I attached a modified version of your program. I just did a quick job, but hopefully you can see what I'm talking about. You'll see that I added the OnAttach Event Handler and set the SensorChangeTrigger there to 0. Also, I added a scroll bar that allows you to change the SensorChangeTrigger during runtime. Any questions, just let me know:)

super-d
02-27-2008, 08:53 PM
Alex,

Strange.... Winzip won't open the file. It says it's an invalid archive. Can you check it and repost?

Thanks.
David

Alex
02-27-2008, 09:18 PM
I just edited my previous post and reuploaded it. I actually re-zipped the folder, so hopefully that fixes it.

I also uploaded it to our server:
http://www.trossenrobotics.com/testFiles/ph_stuff.zip

super-d
02-28-2008, 08:37 AM
Yep, that does the trick. Thanks Alex.

David

Alex
02-28-2008, 09:10 AM
Awesome! So everything is working now? That's great news:D

If I get my new HD in time, I'm going to be reinstalling everything on my desktop here at work this weekend. Hopefully that'll correct my USB problem...