MQTT - Industrial Analog Out Bricklet

This is the description of the MQTT API bindings for the Industrial Analog Out Bricklet. General information and technical specifications for the Industrial Analog Out Bricklet are summarized in its hardware description.

An installation guide for the MQTT API bindings is part of their general description.

Examples

The example code below is Public Domain (CC0 1.0).

Simple Current

Download (example-simple-current.txt)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Change XYZ to the UID of your Industrial Analog Out Bricklet

setup:
    # Set output current to 4.5mA
    publish '{"current": 4500}' to tinkerforge/request/industrial_analog_out_bricklet/XYZ/set_current 
    
    publish '' to tinkerforge/request/industrial_analog_out_bricklet/XYZ/enable 

cleanup:
    # If you are done, run this to clean up
    publish '' to tinkerforge/request/industrial_analog_out_bricklet/XYZ/disable 

Simple Voltage

Download (example-simple-voltage.txt)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Change XYZ to the UID of your Industrial Analog Out Bricklet

setup:
    # Set output voltage to 3.3V
    publish '{"voltage": 3300}' to tinkerforge/request/industrial_analog_out_bricklet/XYZ/set_voltage 
    
    publish '' to tinkerforge/request/industrial_analog_out_bricklet/XYZ/enable 

cleanup:
    # If you are done, run this to clean up
    publish '' to tinkerforge/request/industrial_analog_out_bricklet/XYZ/disable 

API

All published payloads to and from the MQTT bindings are in JSON format.

If an error occures, the bindings publish a JSON object containing the error message as member _ERROR. It is published on the corresponding response topic: .../response/... for .../request/... and .../callback/... for .../register/....

Basic Functions

request/industrial_analog_out_bricklet/<UID>/enable
Request:
  • empty payload
Response:
  • no response

Enables the output of voltage and current.

The default is disabled.

request/industrial_analog_out_bricklet/<UID>/disable
Request:
  • empty payload
Response:
  • no response

Disables the output of voltage and current.

The default is disabled.

request/industrial_analog_out_bricklet/<UID>/is_enabled
Request:
  • empty payload
Response:
  • enabled – Type: bool

Returns true if output of voltage and current is enabled, false otherwise.

request/industrial_analog_out_bricklet/<UID>/set_voltage
Request:
  • voltage – Type: int, Range: [0 to 216 - 1]
Response:
  • no response

Sets the output voltage in mV.

The output voltage and output current are linked. Changing the output voltage also changes the output current.

request/industrial_analog_out_bricklet/<UID>/get_voltage
Request:
  • empty payload
Response:
  • voltage – Type: int, Range: [0 to 216 - 1]

Returns the voltage as set by request/industrial_analog_out_bricklet/<UID>/set_voltage.

request/industrial_analog_out_bricklet/<UID>/set_current
Request:
  • current – Type: int, Range: [0 to 216 - 1]
Response:
  • no response

Sets the output current in µA.

The output current and output voltage are linked. Changing the output current also changes the output voltage.

request/industrial_analog_out_bricklet/<UID>/get_current
Request:
  • empty payload
Response:
  • current – Type: int, Range: [0 to 216 - 1]

Returns the current as set by request/industrial_analog_out_bricklet/<UID>/set_current.

Advanced Functions

request/industrial_analog_out_bricklet/<UID>/set_configuration
Request:
  • voltage_range – Type: int, Range: See symbols
  • current_range – Type: int, Range: See symbols
Response:
  • no response

Configures the voltage and current range.

Possible voltage ranges are:

  • 0V to 5V
  • 0V to 10V (default)

Possible current ranges are:

  • 4mA to 20mA (default)
  • 0mA to 20mA
  • 0mA to 24mA

The resolution will always be 12 bit. This means, that the precision is higher with a smaller range.

The following symbols are available for this function:

For voltage_range:

  • "0To5V" = 0
  • "0To10V" = 1

For current_range:

  • "4To20mA" = 0
  • "0To20mA" = 1
  • "0To24mA" = 2
request/industrial_analog_out_bricklet/<UID>/get_configuration
Request:
  • empty payload
Response:
  • voltage_range – Type: int, Range: See symbols
  • current_range – Type: int, Range: See symbols

Returns the configuration as set by request/industrial_analog_out_bricklet/<UID>/set_configuration.

The following symbols are available for this function:

For voltage_range:

  • "0To5V" = 0
  • "0To10V" = 1

For current_range:

  • "4To20mA" = 0
  • "0To20mA" = 1
  • "0To24mA" = 2
request/industrial_analog_out_bricklet/<UID>/get_identity
Request:
  • empty payload
Response:
  • uid – Type: string, Length: up to 8
  • connected_uid – Type: string, Length: up to 8
  • position – Type: char
  • hardware_version – Type: [int, ...], Length: 3, Range: [0 to 255]
  • firmware_version – Type: [int, ...], Length: 3, Range: [0 to 255]
  • device_identifier – Type: int, Range: [0 to 216 - 1]
  • _display_name – Type: string

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be 'a', 'b', 'c' or 'd'.

The device identifier numbers can be found here. If symbolic output is not disabled, the device identifier is mapped to the corresponding name in the format used in topics.

The display name contains the Industrial Analog Out's name in a human readable form.