Connect 4- 20 mA sensors or other devices using the Analog In hardware block. This block supports eight analog 4-20 mA inputs. There is a ten screw terminal connector on back for connecting wires to the block. The connector block can also output 3.3V or 5V for powering an external device.
There are many vendors to purchase sensors that can be connected to Interstacks.
You can individually change the function of each of the eight I/O connections on the back of the I/O Expander hardware block by editing their corresponding property in the “Property Editor” in the bottom right of Stackbuilder.
To set properties in Stackbuilder: Select the Analog In block by clicking on it once. Click in the “Property Editor” in the bottom right, in the “Initial Value” column for the property you want to edit (if a character or string, use quotes).
Property HT1_Mode specifies the function of I/O connection 1 (the leftmost connection, looking into the back of the block). If you are connecting a switch (button), you would likely enter a 3 (digital input – send on change. Sends character ‘0’ or ‘1’ out its output terminal). If you would like to drive a digital output e.g. an LED, enter a 1 (digital output – character ‘0’ low, ‘1’ high). If you would like to connect an analog input voltage that varies between 0 and 3V, set the property to a 4. Refer to the detailed property spec sheet for advanced options.
Analog In Connector – Looking into back
DC Out is 3.3V if property V is 1 (default). 5V if property V is 0. Can supply 400 mA.
Analog input signals
For analog input signals (4-20 mA), there are a number of signal processing features that can be enabled by setting the property for the I/O pin. The property set to 4 will simply read the current and output a number 0 -1000 whenever requested by sending any message to the input terminal that corresponds to that pin. If set to 5, the value will be automatically sent if its value changes by greater than the corresponding hysteresis property e.g. ‘HT1_Hysteresis’’. If set to 6, a ‘1’ will be output if the value is greater than the comparison property e.g. ‘HT1_Threshold’. If set to 7, the value will be output every xx milliseconds based on the rate property for the pin e.g. ‘HT1_Rate’.
Block properties and terminals
HT1_Mode through HT8_Mode (int): Define behavior of I/O1 – I/O 8
0 nothing – never does anything.
4 Analog input on demand.
Output terminal will output an int (0 – 1000) based on analog voltage of I/O pin when requested by sending any message to the corresponding input terminal.
5 Analog input send change. Will output analog value on any change while filtering based on the value of the HTx_Hysteresis (hysteresis) property for that pin.
6 Analog input with compare. Outputs a ‘1’ on change to above HTx_Threshold property. Outputs a ‘0’ on change to below comparison value property HTx_Threshold for that pin.
7 Analog input, send every x milliseconds based on update rate property HTx_Rate for that pin.
HT1_Hysteresis through HT8_Hysteresis (int): Hysterisis value for analog input send on change. default is 5. (multiples of about 3mV).
Each input used as analog input has its own hysterisis property, hence HT1_Hysteresis through HT8_Hyesteresis.
If analog input signal is noisy, use a higher value to reduce automatic value update sends.
HT1_Threshold through HT8_Threshold (int): Comparison value for analog input compare mode. default is 500.
HT1_Rate through HT8_Rate (int): Update rate, in milliseconds (1000 is 1 second), for analog input update rate mode.Voltage (int): 0 to set external power terminal to 5V. 1 for 3.3V (default).
Type (T) (uuid): Module Type
Version (F) (int): Firmware Version
“Properties” – in (List or Property Name string): To set property. Send property name, Value. For example [’N’,’netname’].
To get property, just send property name. For example. ’N’
“Presponse” – out (List or True) : On set, responds with True when done.
On get, responds with list. For example [’N’, ‘netname’].
Terminals Out 1 – 8. See above description of properties HT1_Mode- HT8_Mode.
If property defines I/O pin as analog input, will output int with I/O pin analog value. Outputs a number 0 – 1000.
If analog input with compare, outputs on change character ‘0’ if below compare value and ‘1’ if above.
In HTx_Mode equal to 4, any message to the corresponding input terminal will cause the analog value to be sampled and sent out the output terminal.