ICube Max Plugin-83 Commands Input Specific
The iCube object accepts the input-specific commands as listed below.
Input-specific commands apply only to the specified outlet and the sensor input it is connected to, if any. Outlets and inputs are numbered starting with 1. The outlet parameter "<outlet>" can be substituted by "<outlet1> - <outlet2>" to specify all outlets from <outlet1> to <outlet2>, which range can be ascending or descending. The outlet parameter can be made specific to the virtual outlet of a digital sensor only by specifying the virtual outlet as a decimal, ie. "1.01" specifies virtual outlet 1 of outlet 1, which in the case of an Orient5D set to method 1 is the H (heading) measurand.
<outlet> report
Reports for the specified outlet all the available data stored in the iCube data structure in the Max window.
<outlet> dump <value>
Sends for the specified outlet all the available data stored in the iCube data structure as messages out the status outlet, and if the specified value = 1 reports the same in the Max window.
<outlet> reset
Initializes the iCube data structure for the specified outlet to the default values and, if the digitizer is in standalone mode, sends a CONFIG command to the digitizer with default values.
<outlet> init
Initializes the iCube data structure for the specified outlet to the default values.
<outlet> connect <input> (<outlet> assign <input>)
Connects the specified outlet to specified digitizer sensor input. Just like the outlet parameter "<outlet>" can be substituted by "<outlet1> - <outlet2>" to specify all outlets from <outlet1> to <outlet2>, which range can be ascending or descending, the input parameter "<input>" can be substituted by "<input1> - <input2>" to specify a range of inputs, which can also be ascending or descending. Example: "1 - 4 connect 4 - 1" connects outlets 1 thru 4 to inputs 4 thru 1, ie. outlet 1 is connected to input 4 etc.
<outlet> stream <value>
Sends a STREAM command to the digitizer to set the sensor input connected to the specified outlet to the specified value [0..1] (0 is off, 1 is on). If the digitizer is in standalone mode, to turn on a sensor input the processing for the input must also be set to a value such that the input processes sensor values in continuous or peak mode. See also the smc_processing command.
<outlet> on
Sends a STREAM command to the digitizer to enable the sensor input connected to the specified outlet and, if the digitizer is in standalone mode and if processing for the sensor input connected to the specified outlet is off, sends a CONFIG command to the digitizer to set processing to continuous.
<outlet> off
Sends a STREAM command to the digitizer to disable the sensor input connected to the specified outlet.
<outlet> sample
Sends a SAMPLE command to the digitizer to request the latest value of the sensor connected to the sensor input which in turn is connected to the specified outlet.
<outlet> res <value>
Sends a RES command to the digitizer to set the resolution of the sensor input connected to the specified outlet, to the specified value [0..1] (0 is low, 1 is high). This command is only applicable to analog sensors. The low resolution is 7-bit (which translates to 5/127 = 0.0394 Volt), the high resolution is 10-bit (which translates to 5/1023 = 0.004888 Volt) for all digitizers except the Digitizer which high resolution value is 12-bit (which translates to 5/4095 = 0.001221 Volt). Upon receipt of the digitizer's confirmation that it has executed the command, the iCube's input configuration is set to default values.
<outlet> address <value>
Sends a FUNCTION command to the digitizer to set the I2C device id of the digital sensor connected to the sensor input which in turn is connected to the specified outlet to the specified value [0..127].
<outlet> function <value> (<outlet> func <value>)
Sends a FUNCTION command to the digitizer to set the function number of the digital sensor connected to the sensor input which in turn is connected to the specified outlet to the specified value [0..127].
<outlet> method <value>
Sends a FUNCTION command to the digitizer to set the method number of the digital sensor connected to the sensor input which in turn is connected to the specified outlet to the specified value [0..127].
<outlet> analog <value>
<outlet> angled <value>
<outlet> air2d <value>
<outlet> bioaird <value>
<outlet> biobeat3d <value>
<outlet> hotspot2d <value>
<outlet> light2d <value>
<outlet> magnetic3d <value>
<outlet> moist3d <value>
<outlet> movealong <value>
<outlet> movearound <value>
<outlet> orient3d <value>
<outlet> orient4d <value>
<outlet> orient5d <value>
<outlet> reachclosed <value>
<outlet> reachfard <value>
<outlet> reachid <value>
<outlet> reachond <value>
<outlet> swipe3d <value>
<outlet> voltd <value>
Sends a FUNCTION command to the digitizer to set the I2C device id and function number according to the type (as specified by the name of the command) of the digital sensor connected to the sensor input which in turn is connected to the specified outlet, and its method to the specified value [0..127].
<outlet> inmin <value>
Sets the iCube to discard sensor values received for the sensor input connected to the specified outlet when it is lower than the specified value, and scale sensor values between the inmin and inmax values to the min and max values set by the inmax, min and max commands. The inmin and inmax commands are used to match the digitizer's sensor input range to sensor's output range. If the digitizer's sensor input is configured for an analog sensor that outputs a voltage, for more accurate results, it may be necessary to calibrate inmax and inmax to the actual digitizer's sensor input voltage range by using a volt meter and measuring the voltage supplied by the digitizer to the sensor(s). The default voltage input range assumed by iCube is 0-5V. In the case of analog sensors, the specified value range is the input voltage range, ie. [0..5] or, if the outlet is configured to output raw sensor data, the range of the digital representation of the digitizer's input voltage range, eg. [0..1023] for a USB/Wi-microDig which has 10 bit resolution analog to digital converters. In the case of digital (I2C) sensors, the specified value range is determined by the sensor.
<outlet> inmax <value>
Sets the iCube to discard sensor values received for the sensor input connected to the specified outlet when it is higher than the specified value, and scale sensor values between the inmin and inmax values to the min and max values set by the inmin, min and max commands. The inmin and inmax commands are used to match the digitizer's sensor input range to the sensor's output range. If the digitizer's sensor input is configured for an analog sensor that outputs a voltage, for more accurate results, it may be necessary to calibrate inmax and inmax to the actual digitizer's sensor input voltage range by using a volt meter and measuring the voltage supplied by the digitizer to the sensor(s). The default voltage input range assumed by iCube is 0-5V, but the actual voltage range is likely slightly less than 5 volt. Use the inmax command to calibrate the actual voltage range by measuring the voltage supplied to the sensors by the digitizer. In the case of analog sensors, the specified value range is the input voltage range, ie. [0..5] or, if the outlet is configured to output raw sensor data, the range of the digital representation of the digitizer's input voltage range, eg. [0..1023] for a USB/Wi-microDig which has 10 bit resolution analog to digital converters. In the case of digital (I2C) sensors, the specified value range is determined by the sensor.
<outlet> scale <value>
Sets the iCube to multiply each sensor value received from the sensor input connected to the specified outlet by the specified value. Together with the offset command, the scale command allows the output value to be calibrated to a desired unit of measurement. By default set 1 for analog sensors.
<outlet> offset <value>
Sets the iCube to add the specified value to the sensor value received from the sensor input connected to the specified outlet. Together with the scale command, the offset command allows the output value to be calibrated to a desired unit of measurement. By default set to 0 for analog sensors.
<outlet> min <value> (<outlet> outmin <value>)
Sets the iCube to scale sensor values received for the sensor input connected to the specified outlet to a range with the minimum set by the specified value.
<outlet> max <value> (<outlet> outmax <value>)
Sets the iCube to scale sensor values received for the sensor input connected to the specified outlet to a range with the maximum set by the specified value.
<outlet> steps <value> (<outlet> step <value>)
Sets the iCube to divide the output range of the specified outlet into the number of values as per the specified value, which is at most the inverse of the resolution of the sensor value.
<outlet> normal <value>
Sets the iCube to scale sensor values received from the sensor input connected to the specified outlet using the min and max settings to the range {0 .. <value>} if the specified value is greater than zero, or {-<value> .. <value>} if the specified value is smaller than zero.
<outlet> noise <value>
Sets the iCube to only output sensor values received from the sensor input connected to the specified outlet if the value is greater or equal than the specified value.
<outlet> smooth <value>
Sets the iCube to apply an exponential moving average filter to the sensor value received from the sensor input connected to the specified outlet with the level of the filter as per the specified value [0..100]. A higher specified value increases the smoothing.
<outlet> preset <value>
Sets the iCube to select a a preset according to the specified value:
- 0: output raw data, ie. output the sensor values as they were received from the digitizer input (see also the "raw" command below)
- 1: output values of a digital sensor as raw data that is scaled and offset as per its defaults, output values of an analog sensor that is scaled and offset such that they are output as {0..5} Volt (see also the "calibrate" command below)
- 2: output values scaled to the range {-1..1}
- 3: output values scaled to the range {0..1}
- 4: output values scaled to the range {0..10}
- 5: output values scaled to the range {0..100}
- 6: output values scaled to the range {0..127}
- 7: output values scaled to the range {0..1023}
- 8: output values scaled to the range {0..4095}
- 9: output values scaled to the range {0..16383}
<outlet> raw (<outlet> preset 0)
Sets the iCube to output raw data, ie. output the sensor values received from the sensor input connected to the specified outlet as they were received from the sensor input.
<outlet> calibrate (<outlet> preset 1)
Sets the iCube to output calibrated data, ie. output the sensor values received from the sensor input connected to the specified outlet multiplied by the scale factor and offset by the offset factor. Most obviously useful for analog sensors.
Analog sensor values are scaled as per the voltage resolution of the digitizer, ie. scale is 5 / 1023 = 0.004888 Volt for a digitizer with 10-bit resolution such as the WiDig or USB-/Wi-microDig. Note that the actual voltage range is likely slightly less than 5 volt. Use the scale and offset commands to calibrate to the actual voltage range by measuring the voltage supplied to the sensors by the digitizer.