TemperatureSensor-full(C# sample program)

Supporting Visual Studio on Windows
Chili Padi

TemperatureSensor-full(C# sample program)

Postby Chili Padi » Tue Jul 19, 2011 12:28 am

I have downloaded the sample program and everything is ok except the form of the program is unable to display any information on the 1070 SBC or the temperature sensor. How can I program it to detect the sensor information :?:

erik
King of the Lab
Posts: 476
Joined: Fri Mar 06, 2009 12:42 pm
Location: Calgary, Canada
Contact:

Re: TemperatureSensor-full(C# sample program)

Postby erik » Tue Jul 19, 2011 9:03 am

TemperatureSensor-full is used for USB-based sensors, and cannot be used for the 1124 or 1125 temperature sensors (which I am assuming is the one you are using).

If you are using the 1124 or 1125 Temperature Sensor, use the InterfaceKit-full examples. In the analog box that corresponds to the port that the sensor is plugged into, the temperature value will be displayed in the range of 0 to 1000. Check the Product Manual for the formula to convert that into Celsius. Or if you click "Advanced Sensors," you can select the type of sensor you are using, and the formula and value will be displayed.

Chili Padi

Re: TemperatureSensor-full(C# sample program)

Postby Chili Padi » Tue Jul 19, 2011 8:34 pm

Im using 1124 temperature sensor with a 1070 SBC. The temperature sensor-full sample program gives me errors when i chose the sensor input, sensor type and sensitivity track and i have no idea how to solve this problem. :(

Chili Padi

Re: TemperatureSensor-full(C# sample program)

Postby Chili Padi » Tue Jul 19, 2011 9:45 pm

the underlined code that has been giving me error

Code: Select all

private void thermoCmb_SelectedIndexChanged(object sender, EventArgs e)
{[u] int index = (int)thermoCmb.SelectedItem;[/u]
SensitivityTrk.Value = (int)(phidgetTemperature.thermocouples[index].Sensitivity*100.0);
sensitivityTxt.Text = phidgetTemperature.thermocouples[index].Sensitivity.ToString();
....}

erik
King of the Lab
Posts: 476
Joined: Fri Mar 06, 2009 12:42 pm
Location: Calgary, Canada
Contact:

Re: TemperatureSensor-full(C# sample program)

Postby erik » Wed Jul 20, 2011 8:39 am

The 1124 cannot be used with the TemperatureSensor-full examples.

Use the InterfaceKit-full examples.

The 1070 has an on-board InterfaceKit and you need to use the InterfaceKit-full examples in order to see the temperature of the 1124.

Chili Padi

Re: TemperatureSensor-full(C# sample program)

Postby Chili Padi » Wed Jul 20, 2011 9:33 pm

Is it possible to let the program fetch which sensor am i using and not choosing? Because I have to program to let it fetch the temperature and send out to other devices :(

erik
King of the Lab
Posts: 476
Joined: Fri Mar 06, 2009 12:42 pm
Location: Calgary, Canada
Contact:

Re: TemperatureSensor-full(C# sample program)

Postby erik » Mon Jul 25, 2011 8:24 am

It is not possible to let the example automatically get the sensor you are using, since the InterfaceKit has no idea what is attached to the analog inputs.

You need to program it into a custom application.

Chili Padi

Re: TemperatureSensor-full(C# sample program)

Postby Chili Padi » Tue Jul 26, 2011 9:11 pm

I have started editing the program but I would like to know what type is Interfacekit_full.SensorExamples.SensorBox[] as I want the program not to get the sensor type if it is below 3 but the error say that it cannot implicitly convert type 'int' to Interfacekit_full.SensorExamples.SensorBox[].

Chili Padi

Re: TemperatureSensor-full(C# sample program)

Postby Chili Padi » Wed Jul 27, 2011 3:02 am

Is the controls of the AdvancedSensorForm.cs[Design] being locked? As I want to edit the controls one by one but am unable to do so. :(

erik
King of the Lab
Posts: 476
Joined: Fri Mar 06, 2009 12:42 pm
Location: Calgary, Canada
Contact:

Re: TemperatureSensor-full(C# sample program)

Postby erik » Wed Jul 27, 2011 9:29 am

Take a look at SensorBox.cs in the SensorExamples folder. That will show you how the AdvancedSensorForm selects and displays the type of sensor.

The layout and design of AdvancedSensorForm is very modular to easily allow adding sensors in the future. It is in SensorBox or in Sensor# that you can edit the controls for each individual type of sensor.


Return to “C#.NET”

Who is online

Users browsing this forum: No registered users and 1 guest