Phidget Temperature
Sensor 4-Inputs for Phidget Module 1048_0
This element allows you reading the temperature from up to four
thermocouples with a 1048 PhidgetTemperatureSensor 4-Input
module. J, K, E and T thermocouples are directly supported in the
library and return the measured temperature in °C.
It is possible to interface other thermocouple types by converting
the measured potential returned by the Temperature Sensor into Celsius
using the appropriate tables; the formula and links to the tables are
described in the 1048 Product Manual.
The 1048 module:
- Provides 4 inputs to connect different types of temperature
sensors (thermocouples).
- Outputs temperature in degrees Celsius.
- Uses terminal blocks to interface to inexpensive thermocouples
with stripped leads.
- Connects directly to a computer’s USB port.
With this element, you can access to the module directly (with the
serial number) or through the network, using the WebService of the
phidget's driver in a remote computer with the phidget 1048
connected (here, you need the IP, port and password too).
Usage
To use any Phidget element, drag an drop its icon to the list of
model elements of your model. Then, edit the connection parameters and
invoke phidget.connect() in your code.
All methods returning a boolean will return true on
successful completion of the command, false otherwise. Methods
returning a double value will return Double.NaN if there is any
error when connecting to the phidget.
Available method for this particular phidgets include:
- public boolean connect();
// establish the connection. Returns true if successful
- public int getSensorsCount();
// return the number of sensors present
- public double getTemperature(int
index); // Get the temperature measured by a thermocouple at the
given index
- public double
getMinimumTemperature(int index); // Get the minimum temperature
measured by the thermocouple at the given index
- public double
getMaximumTemperature(int index); // Get the maximum temperature
measured by the thermocouple at the given index
- public double
getAmbientTemperature(); // Get the ambient temperature measured
by the module
- public double
getMinimumAmbientTemperature(); // Get the minimum temperature
measured by the module
- public double
getMaximumAmbientTemperature(); // Get the maximum temperature
measured by the module
- public boolean
setThermocoupleType(int index, char value); // Sets the type of
sensor to one of 'K', 'J', 'E', 'T'
- public char
getThermocoupleType(int index); // Gets the type of sensor.
Returns one of 'K', 'J', 'E', 'T', or '?' if there was any error
- public double getPotential(int
index); // Gets the potential measured by a thermocouple at the
given index
- public double
getMinimumPotential(int index); // Get the minimum potential
measured by the thermocouple at the given index
- public double
getMaximumPotential(int index); // Get the maximum potential
measured by the thermocouple at the given index
Example of use
// Init the module
if (!phidget1048.connect()) _view.alert(null,"Connection error","Can't connect to temperature phidget");
phidget1048.getTemperature(0); // read temperature from thermocouple number 0