Managing I/O Points with the IOX
IOX is a compact, programmable companion module to the SmartServer IoT for connecting to industrial devices. You can use its configurable digital I/Os, and Modbus interface to control and monitor devices such as digital sensors, dry contact relays, push buttons, and Modbus devices. You can use the metering version of the IOX to monitor power and energy usage for one to three phase power mains.
The IOX complies with DIN 43880 form factor standard and connects to a local SmartServer IoT via a USB connection. (See IOX I/O Expansion Module for information about this module.) For information on using the CMS to configure I/O, see Configuring Local I/O Using the IOX.
You can program the IOX to configure the I/Os and read data that is logged in the SmartServer IoT, or accessible by remote clients and applications. This section consists of the following:
Digital Output Configuration
You can specify the output mode for each of the six digital outputs, and configure each output to operate in one of the following modes.
- Level Mode
- Pulse Mode
- Frequency Mode
- PWM Mode
Level Mode
The output is either ON or OFF. You can specify non-inverted or inverted logic. The default is non-inverted logic, where a True value results in an output pull-down to ground, and a False value results in a floating output that can have an external pull-up for a positive voltage output. You can specify inverted logic, where a True value results in a floating output and a False value results in an output pull-down to ground.
The level can be set to True or False. We also support inverted configuration for Level mode.
To set the level to True on Digital Output 1, publish the following object:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/do/1 |
To set the Level mode with inverted OFF:
{"mode":{"value":{"invert": false,"type": "level"}}} |
To set the Level high using the ”output” datapoint:
{"output":{"value":{"level":true,"frequency":0,"pulse_counter":{"pulse_pwm":{"pwm":{"frequency":0,"duty_cycle":0},"pulse":0}}}}} |
To set the Level low using the ”switch” datapoint:
{"switch":{"value":{"value":0,"state":0}}} |
Pulse Mode
The output pulses from OFF to ON to OFF, on request with a specified duration. The Pulse mode configures the output to stay in the High / True state for the duration specified. The duration unit is milliseconds (ms).
To configure output #1 in Pulse mode for 20 secs, publish the following object:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/do/1 |
To set Pulse mode (invert_cfg is not supported for this type):
{"mode":{"value":{"invert": false,"type": "pulse"}}} |
To set Pulse to 10 seconds:
{"output":{"value":{"level":false,"frequency":0,"pulse_counter":{"pulse_pwm":{"pulse":10000,"pwm":{"frequency":0,"duty_cycle":0}}}}}} |
Frequency Mode
The output toggles at a specified frequency. Frequency mode generates a signal of the specified frequency on the output channel. The unit of configuration is Hertz. The range supported is from 1 Hz to 20000 Hz.
To configure output #2 in Frequency mode with 10000 Hz, publish:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/do/1 |
To set the Frequency mode (invert_cfg is not supported for this type):
{"mode":{"value":{"invert": false,"type": "frequency"}}} |
To set Frequency to 10Hz:
{"output":{"value":{"level":false,"frequency":10,"pulse_counter":{"pulse_pwm":{"pulse":10000,"pwm":{"frequency":0,"duty_cycle":0}}}}}} |
PWM Mode
The output toggles at a specified frequency with a specified duty cycle. The PWM mode generates a signal of the specified frequency and duty cycle on the output channel. The configuration takes 2 values. Frequency in Hz and Duty cycle in %.
To configure output #3 in PWM mode with 15000 Hz and Duty cycle as 20%:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/do/1 |
To set the Frequency mode (invert_cfg is not supported for this type):
{"mode":{"value":{"invert":false,"type":"pwm"}}} |
To set Frequency to 10Hz and Duty_cycle of 10%:
{"output":{"value":{"level":false,"frequency":10,"pulse_counter":{"pulse_pwm":{"pulse":10000,"pwm":{"frequency":10,"duty_cycle":10}}}}}} |
Digital Input Configuration
- Level Mode
- Counter Mode
- Frequency Mode
- Toggle Mode
Level Mode
The input is either ON or OFF. You can specify non-inverted or inverted logic. The default is non-inverted logic, where an input value above the specified threshold results in a True value, and a low voltage input results in a False value. You can specify inverted logic where an input voltage above the specified threshold results in a True value, and a low voltage input results in a False value.
To set the level on the Digital Input, publish the following object:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/di/1 |
{"mode":{"value":{"type":"level","level":{"invert":false,"pullup":false,"trigger_level":0},"frequency":{"pullup":false,"trigger_level":0},"counter_toggle":{"toggle":{"invert":false,"pullup":false,"trigger_level":0},"counter":{"pullup":false,"trigger_level":0}}}}} |
The following fields are used:
Field | Description |
---|---|
trigger_level | The input voltage range to be connected at the input port. Values: 0 -- 0 to 3.3V |
pullup | Sets the digital input register in pullup or pulldown mode. Values: False -- pulldown mode |
invert | Sets DI to invert configuration. Values: False -- invert Off |
Counter Mode
Reports a count of the specified transitions of the input signal, either high-to-low or low-to high. In counter mode, the pulses accumulated in the last 1-second time frame are reported.
To set the counter on the Digital Input, publish the following object:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/di/1 |
{"mode":{"value":{"type":"counter","level":{"trigger_level":0,"pullup":false,"invert":false},"frequency":{"trigger_level":0,"pullup":false},"counter_toggle":{"counter":{"trigger_level":0,"pullup":false},"toggle":{"trigger_level":0,"pullup":false,"invert":false}}}}} |
Frequency Mode
Reports the average frequency of transitions of the input signal. In frequency mode, the frequency connected at the input port is reported. The value is reported in Hertz.
To set the frequency on the Digital Input, publish the following object:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/di/1 |
{"mode":{"value":{"type":"frequency","level":{"trigger_level":0,"pullup":false,"invert":false},"frequency":{"trigger_level":0,"pullup":false},"counter_toggle":{"counter":{"trigger_level":0,"pullup":false},"toggle":{"trigger_level":0,"pullup":false,"invert":false}}}}} |
Toggle Mode
Reports a True or False value that toggles with each specified transition of the input signal, either high-to-low or low-to-high. In toggle mode, either for only high values or for low values, the level corresponding to DI changes. When Invert is ON, the DI value toggles for every high value. When invert is OFF, the DI value toggles for every Low input.
To set the frequency on the Digital Input, publish the following object:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/di/1 |
{"mode":{"value":{"type":"toggle","level":{"trigger_level":0,"pullup":false,"invert":false},"frequency":{"trigger_level":0,"pullup":false},"counter_toggle":{"counter":{"trigger_level":0,"pullup":false},"toggle":{"trigger_level":0,"pullup":false,"invert":false}}}}} |
Relay Output
The relay operation supports On/Off operations, with the relay level set to True or False.
To set relay #1 level to True, publish:
glp/0/{SID}/rq/dev/iap/{LOGICAL_ID}.dio/if/relay/1 |
Data: |
Relay Example
The following example uses mosquitto_pub to configure the relay level to False for relay port 1.
Request
mosquitto_pub -t glp/0/1401/rq/dev/iox.409eb1/dio/if/relay/1 -m '{ |
Response
This is the response after a successful configuration of the relay.
Topic: |
Monitoring Configuration
To get the monitoring configuration from a metering device publish:
glp/0/{SID}/rq/dev/{IOX_HANDLE}/meter/if/phase/0 |
Monitoring Example
IOX sends the response on the feedback channel, as well as publishes the configuration data to the monitoring service.