Documentation
IO Configuration

This endpoint gives access to the configuration of the device's inputs and outputs.

‍path: /api/v1/process

example of the process endpoint:

{
"name": "example",
"entries": [
{
"name": "AIN",
"pin": "-0-",
"unit": "mA",
"shift": 3,
"hysteresis": 0,
"format": "0:24"
"Json+typeName": "MkcJsonLib.jProcessAi",
"Json+typeRevision": 1
},
{
"name": "PWM LED",
"pin": "XB.2",
"unit": "%",
"format": "0:100",
"Json+typeName": "MkcJsonLib.jProcessAo",
"Json+typeRevision": 1
},
{
"name": "RELAY",
"pin": "XB.4",
"pulse": 10,
"save": true,
"Json+typeName": "MkcJsonLib.jProcessDo",
"Json+typeRevision": 1
},
{
"name": "GPIO2",
"pin": "XB.6",
"shift": 3,
"Json+typeName": "MkcJsonLib.jProcessDi",
"Json+typeRevision": 0
},
],
"Json+typeName": "MkcJsonLib.jProcess",
"Json+typeRevision": 0
}

jProcess

{
"name": "mkc1601Bsp",
"entries": [...],
"Json+typeName": "MkcJsonLib.jProcess",
"Json+typeRevision": 0
}

This object contains the process name and an array with all the IO configurations.

Variable Description datatype writable
name The user given name for the process/application string yes
entries array containing all the IO configurations array -

curl read command example:
curl -H "ApiRdKey: rdKey6" 192.168.15.100/api/v1/process

curl write command example:
curl -X PUT -H "ApiRdKey: rdKey6" -H "ApiWrKey: wrKey6" -d "name=myprocessname" 192.168.15.100/api/v1/process

jProcessDi

This structure holds the configuration for a digital input.

{
"name": "GPIO2",
"pin": "XB.6",
"shift": 3,
"Json+typeName": "MkcJsonLib.jProcessDi",
"Json+typeRevision": 1
},
Variable Description datatype writable added in typeRevision
name user given name string yes 0
pin the hardware name of the digital input string no 0
shift the shift value - see explanation below integer yes 0

curl read command example:
curl -H "ApiRdKey: rdKey6" 192.168.15.100/api/v1/process/entries/0

curl write command example:
curl -X PUT -H "ApiRdKey: rdKey6" -H "ApiWrKey: wrKey6" -d "name=MyPin" 192.168.15.100/api/v1/process/entries/0

the shift value

The shift value controls weighted moving average calculation. It is used with time series data to smooth out short-term fluctuations of the digital input. To do this the input is sampled continuously (sampling interval). The period is specified by the system.

A weighted moving average is an average that has multiplying factors (shift value) to give different weights to data at different positions in the sample period. Mathematically, the weighted moving average is the convolution of the datum points with a fixed weighting function:

digital input shift formula

A shift value of 0 will return the input directly. Below you will find some examples over 100 values with different shift values to smooth out short-term fluctuations. The digital input is blue colored and the weighted moving average red.

shift = 1
shift = 2
shift = 4

jProcessDo

This structure holds the configuration for a digital output.

{
"name": "GPIO1",
"pin": "XB.4",
"pulse": 0,
"save": true,
"Json+typeName": "MkcJsonLib.jProcessDo",
"Json+typeRevision": 1
}
Variable Description datatype writable added in typeRevision
name user given name string yes 0
pin the hardware name of the digital output string no 0
pulse the pulse value - see explanation below integer yes 0
save the save flag - see explanation below boolean yes 1

see read and write examples

the pulse value

The pulse value defines the timeout for a monostable digital output. After the output is switched on, the digital output will be automatically switched off after the specified amount of seconds. A pulse value of 0 turns this functionality off <=> the digital output won't be automatically switched off.

the save value

The save flag is used for restoring the output state after a reset. If true, a relay for example will be set to the value it had before the reset. If false, the relay will be set to its default state: false.

Note
The save functionality was added with typeRevision 1 of the jProcessDo class. TypeRevision 0 doesn't have this functionality. It behaves as if the save flag was set to true.

jProcessAi

This structure holds the configuration for a analog input.

{
"name": "GPIO1",
"pin": "XB.4",
"unit": "mA",
"format": "0:24",
"shift": 2,
"hysteresis": 5,
"Json+typeName": "MkcJsonLib.jProcessAi",
"Json+typeRevision": 1
}
Variable Description datatype writable added in typeRevision
name user given name string yes 0
pin the hardware name of the analog input string no 0
unit The unit of the input's values string no 0
format min:max of the input's values string no 1
shift the shift value - see explanation below integer yes 0
hysteresis the hysteresis value - see explanation below integer yes 0

see read and write examples

Note
The format variable was added in typeRevision 1. In case of typeRevision 0, please check the technical documentation of your device in order to get the min and max values.

the shift value

The shift value controls weighted moving average calculation.
See digital input shift explanation for a brief description.

Analog input weighted moving average formula

Some examples:
(The input is blue colored and the weighted moving average yellow.)

shift = 1
shift = 2
shift = 4

the hysteresis value

The hysteresis defines a threshold value for a change of the input to be detected. For example: a hysteresis value of 5 means the value of the input will only change to the currently measured value if the difference between the currently measured value and the old value is bigger than or equal to 5. The hysteresis has the same unit as the value itself, so in this listing it would be 5mA.

hysteresis example 1
hysteresis example 2

If both, shift and hysteresis are active, the hysteresis will be applied to the weighted moving average.

hysteresis and shift example

jProcessAo

This structure holds the configuration for an analog output.

{
"name": "GPIO1",
"pin": "XB.4",
"unit": "%",
"format": "0:100",
"save": false,
"Json+typeName": "MkcJsonLib.jProcessAo",
"Json+typeRevision": 1
}
Variable Description datatype writable added in typeRevision
name user given name string yes 0
pin the hardware name of the digital input string no 0
unit The unit of the input's values string no 0
format min:max of the input's values string no 1
save the save flag - see here for explanation boolean yes 1

see read and write examples

Note
  • The format variable was added in typeRevision 1. In case of typeRevision 0, please check the technical documentation of your device in order to get the min and max values.
  • The save functionality was added with typeRevision 1 of the jProcessAo class. TypeRevision 0 doesn't have this functionality. It behaves as if the save flag was set to true.