Help with 1048_0 temperature

VS2003, VS2005, VS Express
Biggermens
Phidgetsian
Posts: 13
Joined: Sun Aug 02, 2009 9:55 pm
Contact:

Help with 1048_0 temperature

Postby Biggermens » Wed Sep 11, 2013 8:07 pm

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

User avatar
burley
Human-Cyborg Relations
Posts: 439
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Help with 1048_0 temperature

Postby burley » Fri Sep 13, 2013 12:05 pm

What kind of problems are you having exactly?
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com

Biggermens
Phidgetsian
Posts: 13
Joined: Sun Aug 02, 2009 9:55 pm
Contact:

Re: Help with 1048_0 temperature

Postby Biggermens » Sat Sep 14, 2013 9:41 pm

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

User avatar
burley
Human-Cyborg Relations
Posts: 439
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Help with 1048_0 temperature

Postby burley » Mon Sep 16, 2013 7:40 am

But what is actually going wrong? That code looks generally fine so the problems must be coming from elsewhere in the your program.
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com

Biggermens
Phidgetsian
Posts: 13
Joined: Sun Aug 02, 2009 9:55 pm
Contact:

Re: Help with 1048_0 temperature

Postby Biggermens » Mon Sep 16, 2013 9:17 pm

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

User avatar
burley
Human-Cyborg Relations
Posts: 439
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Help with 1048_0 temperature

Postby burley » Tue Sep 17, 2013 11:46 am

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.
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com

Biggermens
Phidgetsian
Posts: 13
Joined: Sun Aug 02, 2009 9:55 pm
Contact:

Re: Help with 1048_0 temperature

Postby Biggermens » Tue Sep 17, 2013 2:31 pm

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

Biggermens
Phidgetsian
Posts: 13
Joined: Sun Aug 02, 2009 9:55 pm
Contact:

Re: Help with 1048_0 temperature

Postby Biggermens » Tue Sep 24, 2013 8:05 pm

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

User avatar
burley
Human-Cyborg Relations
Posts: 439
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Help with 1048_0 temperature

Postby burley » Wed Sep 25, 2013 7:57 am

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.
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com

Biggermens
Phidgetsian
Posts: 13
Joined: Sun Aug 02, 2009 9:55 pm
Contact:

Re: Help with 1048_0 temperature

Postby Biggermens » Wed Sep 25, 2013 1:49 pm

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

Biggermens
Phidgetsian
Posts: 13
Joined: Sun Aug 02, 2009 9:55 pm
Contact:

Re: Help with 1048_0 temperature

Postby Biggermens » Wed Sep 25, 2013 8:56 pm

Hey I got it :D

This is what I did

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

End Sub

Private Sub sensor1_TemperatureChange(ByVal sender As Object, ByVal e As Phidgets.Events.TemperatureChangeEventArgs) Handles sensor1.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

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

If e.Index = 0 Then
NumericUpDown23.Text = e.Temperature.ToString
ElseIf e.Index = 1 Then
NumericUpDown24.Text = e.Temperature.ToString
ElseIf e.Index = 2 Then
NumericUpDown25.Text = e.Temperature.ToString
ElseIf e.Index = 3 Then
NumericUpDown26.Text = e.Temperature.ToString
End If

End Sub


Thanks for everyone's help
Biggs

TMaiden
Fresh meat
Posts: 1
Joined: Thu Dec 14, 2017 10:47 am
Location: Missouri, United States
Contact:

Re: Help with 1048_0 temperature

Postby TMaiden » Thu Dec 14, 2017 5:16 pm

Biggermens wrote: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


I know that this post is 4 years old, but I don't think this "Show 2 decimal points..." question was answered.

You can use the FORMAT() function to display your numbers.

TextBox1.text = format(Variable,"###.##")

Tom

"If at first you don't succeed, do not take up sky-diving"


Return to “VB .NET”

Who is online

Users browsing this forum: No registered users and 1 guest