Page 1 of 2

Help with 1048_0 temperature

Posted: Wed Sep 11, 2013 8:07 pm
by Biggermens
Hello everyone

I just got a couple of 1048_0 temperature sensors
I am having a hard time I have not done this in years and years
I looked at the sample code I downloaded from the website and I cant figure it out
Can anyone help me with just simple code to get me started ???
Please

I am also using VB2012 64bit is that a problem ???
Thanks
Biggs

Re: Help with 1048_0 temperature

Posted: Fri Sep 13, 2013 12:05 pm
by burley
What kind of problems are you having exactly?

Re: Help with 1048_0 temperature

Posted: Sat Sep 14, 2013 9:41 pm
by Biggermens
Well I have lots of problem and probably more to come hehe right now this is were I am at

I have this for code to make thermocouple 0 Ktype work in a textbox


Private Sub sensor_TemperatureChange(ByVal sender As Object, ByVal e As Phidgets.Events.TemperatureChangeEventArgs) Handles sensor.TemperatureChange


If e.Index = 0 Then
TextBox1.Text = e.Temperature.ToString
ElseIf e.Index = 1 Then
TextBox2.Text = e.Temperature.ToString
End If


End Sub

And I also have 2 1048 to make work at the same time

And would be easier if I use a 32bit system ???

Thanks
Biggs

Re: Help with 1048_0 temperature

Posted: Mon Sep 16, 2013 7:40 am
by burley
But what is actually going wrong? That code looks generally fine so the problems must be coming from elsewhere in the your program.

Re: Help with 1048_0 temperature

Posted: Mon Sep 16, 2013 9:17 pm
by Biggermens
OK I will keep working at that and see what will happen.

One problem I see I will have is How do I get 2 1048 working at the same time ????

I think the biggest problem is who is sitting in front of my computer screen hehe

Thanks
Biggs

Re: Help with 1048_0 temperature

Posted: Tue Sep 17, 2013 11:46 am
by burley
Just create a second object in the same way that you created the first. When you call open make sure that you use the appropriate serial number.

Re: Help with 1048_0 temperature

Posted: Tue Sep 17, 2013 2:31 pm
by Biggermens
ok thank you I will try it then I will let you know

Would you know by any chance know how to display only 2 decimal points ?? instead of 4 ??


Thanks
Yves

Re: Help with 1048_0 temperature

Posted: Tue Sep 24, 2013 8:05 pm
by Biggermens
I cant figure out how to use multiple 1048-0 temperature sensor
This is what I got

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
sensor = New Phidgets.TemperatureSensor
sensor.open(284703)

End Sub

Private Sub sensor_TemperatureChange(ByVal sender As Object, ByVal e As Phidgets.Events.TemperatureChangeEventArgs) Handles sensor.TemperatureChange

If e.Index = 0 Then
NumericUpDown19.Text = e.Temperature.ToString
ElseIf e.Index = 1 Then
NumericUpDown20.Text = e.Temperature.ToString
ElseIf e.Index = 2 Then
NumericUpDown21.Text = e.Temperature.ToString
ElseIf e.Index = 3 Then
NumericUpDown22.Text = e.Temperature.ToString
End If

End Sub


Were do I open the second 1048 SN# 284285 ??? and how do I do the sensor_TemperatureChange for the second 1048


Thanks
Biggs

Re: Help with 1048_0 temperature

Posted: Wed Sep 25, 2013 7:57 am
by burley
You need to create a second temperature sensor object.

sensor = New Phidgets.TemperatureSensor
sensor.open(284703)

Like that, only a second one. Use the appropriate serial number as well. You can use the same event handler for both devices. You can differentiate in the handler which device generated the event by checking the serial number of the sender object.

Re: Help with 1048_0 temperature

Posted: Wed Sep 25, 2013 1:49 pm
by Biggermens
This is what I did not sure if its right as for the handle I cant figure one out :(
I also have been looking for multiple phidgets examples from the example pack I downloaded from you guys I cant find it

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
sensor = New Phidgets.TemperatureSensor
sensor.open(284703)
sensor.open(284285)

End Sub

How would I go about doing the handle ???

Thanks in advance
Biggs