DLP-TEMP-G DeviceThe 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 DescriptionThe 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 OperationEach of the 3 physical pins on the DLP-TEMP-G can be either an input or an output. Input PinsWhen 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 Output PinsWhen a device pin is a digital output, the pin will have an electrical value equivalent to the logical value ( InstallationTo 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 :
poll_interval :
celsius :
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. ExampleTo 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:
If you want the device to have 3 temperature sensing input pins, type the following into your Console or into a Script:
If you wanted three digital outputs, starting in the
If you wanted S1 an analog input, S2 a digital input, and S3 a temperature input:
|