Software Overview  |  Sitemap  |  Downloads  |  Developers  |  Forums
Small_clear_logo_llc

DLP-TEMP-G Device

The DLP-TEMP-G is a general purpose sensing and control device supporting up to three separate physical connections. The connections are called "S1", "S2", and "S3". Each connection can be independently configured as a digital input, digital output, analog input, or a temperature sensor(input). When used as a temperature sensor, it requires an external DS18B20 sensor (widely available on the internet). Consult the DLP website for details on connecting temperature sensors.

Terminals Description

The Virtual Wiring TEMP-G Device has six terminals. Three of the terminals are inputs, and three are outputs. The inputs are called "1", "2", and "3". The outputs are called "1S", "2S", and "3S" (see above illustration). At any given time, only three of the Device's terminals are active. When one of the device's physical pins (S1, S2, S3) is configured as an input, the corresponding Device output (1S, 2S, or 3S) is active. When a physical pin is configured as an output, the corresponding Device input (1, 2, 3) terminal is active.

The Temp-G device pins are configured by calling the Device's "write_read" method (see the DLP Device Shared Methods section) with the appropriate configuration value. On power up, the device defaults to all digital inputs.

Device Operation

Each of the 3 physical pins on the DLP-TEMP-G can be either an input or an output.

Input Pins

When a device pin is in input, mode, the pin is polled by the system at regular intervals. After polling, the corresponding Device output terminals are updated with the polled values. Polling is how Device output terminals are updated. The interval is set by the Device installation Script's "poll_interval" parameter. All device input pins are polled at the same interval, and intervals are multiples of 10 seconds (Virtual Wiring releases 1.5.0 and lower), or 1 second (releases 1.5.1 and above).

The value assigned to a Device's output terminal is dependent on the pin mode of the device. When a pin is a digital input, the Device output is assigned on or off values. When a pin is an analog input, the Device output is assigned floating point values from 0.000 to 5.000 (for input voltages from 0V to 5V). Temperature inputs are assigned Fahrenheit or Celsius floating point values.

Output Pins

When a device pin is a digital output, the pin will have an electrical value equivalent to the logical value (on or off) of the Device's input terminal. The electrical values track the terminal on and off values in real time. When a device pin is an digital output, its Device output terminal is never assigned anything (it's not used)

Installation

To install a DLP-TEMP-G device, plug one into a spare USB port on your host system. Next run the TempG Script in the DLP directory. The parameters for the TempG Script are:

port_location :

  • the location of the DLP-TEMP-G USB port. In *nix systems, this is in the /dev directory with a name like /dev/ttyUSB0 or /dev/cu.usbserial-00001004. Type "ls -lrt /dev" for hints.

poll_interval :

  • the period in seconds for polling the device's inputs. For Virtual Wiring releases 1.5.0 and earlier, the poll interval can be as short as 10 seconds (lesser intervals will be rounded up to 10 seconds). Releases 1.5.1 and later support polling intervals as short as 1 second (lesser intervals will be rounded up to 1 second).

celsius :

  • if set to true, inputs reporting temperature will report in Celsius. If set to false, temperatures will be reported in Fahrenheit.

Once you have installed your Device, call the Device's "write_read" method to configure the device pins (see DLP Device Shared Methods). When you "write_read", you will be sending odd little quoted character strings. These characters are commands taken from the DLP-TEMP-G data sheet. When you issue a "write_read" command which reads a certain type of value from a pin, that pin becomes an input pin of that type. Similarly, issuing a command that writes a certain output value to a pin makes that pin an output pin initialized to that value.

Example

To add a DLP-TEMP-G Device with ID "temp_g", port_location "/dev/ttyUSB0", a poll interval of 30 seconds, and which reports temperatures in Fahrenheit, run the TempG Script with the following parameters:

id: "temp_g"
celsius: false
poll_interval: 30
port_location: "/dev/ttyUSB0"

If you want the device to have 3 temperature sensing input pins, type the following into your Console or into a Script:

run_script("", text:"write_read \"STU\"", on_device:"temp_g")

If you wanted three digital outputs, starting in the on state:

run_script("", text:"write_read \"JKL\"", on_device:"temp_g")

If you wanted S1 an analog input, S2 a digital input, and S3 a temperature input:

run_script("", text:"write_read \"ANU\"", on_device:"temp_g")

Catalina Computing, LLC.

Copyright © Catalina Computing, LLC. (2013-2018)




Page last updated: Thu Jun 5 18:39:05 2014 (UTC)