user

user folder explained
/etc/motorcortex/config/
└── user
    └── parameters.json

parameters.json

In parameters.json parameters can be added to a motorcortex application without recompiling the application. This is useful when external processes or devices need to write data into a motorcortex application. For instance a vision system can use the Motorcortex API to write coordinates of an object into the UserParameters. The robot application can then use these coordinates in a robot program. The created user parameters are visible in de desk-tool under the tree path: root/UserParameters/.../....


{
    "Version": "1.0",
    "Children": [
        {
            "Name": "IO",
            "Children": [
                {
                    "Name": "Gripper1",
                    "Type": "int32[1],parameter_volatile",
                    "Value": 0
                },
                {
                    "Name": "Gripper2",
                    "Type": "int32[1],parameter_volatile",
                    "Value": 1
                }
            ]
        },
        {
            "Name": "Branch2",
            "Children": [
                {
                    "Name": "branch2Param1",
                    "Type": "int32[3],input",
                    "Value": [2,3,4,5,6]
                },
                {
                    "Name": "branch2Param2",
                    "Type": "int32[3],input"
                },
                {
                    "Name": "subbranch1",
                    "Children": [
                        {
                            "Name": "branch2subbranch1Param1",
                            "Type": "char[11],parameter_volatile",
                            "Value": "Hello world"
                        },
                        {
                            "Name": "branch2subbranch1Param2",
                            "Type": "int,parameter_volatile",
                            "Value": 123
                        }
                    ]
                }
            ]
        },
        {
            "Name": "moduleParam1",
            "Type": "double[6],input",
            "Value": [
                1.34,
                2.23,
                3.5675,
                4.0034,
                5.5677,
                6.2345
            ]
        },
        {
            "Name": "moduleParam2",
            "Type": "bool,input"
        }
    ]
}

image not found

DataTypes

The [x] specified after each dataType defines how many rows the array contains, except for string and char the [x] indicates respectively the letter and character size.

DataType Definition Example
int/int32/int64[x] Numeric data type for numbers without fractions -707, 0, 707
uint[x] Positive numeric data type for numbers without fractions 0, 7, 707
float[x] Numeric data type for numbers with fractions -707.07, 0.7, 707.00
char[x] Single letter, digit, punctuation mark, symbol, or blank space a, 1, !
string[x] Sequence of characters, digits, or symbols—always treated as text hello, +1-999-6
bool[x] True or false values 0(false), 1 (true)

Value

A parameter can contain an initial "Value": that is loaded each time during system initialization. If no value is assigned the default value = 0. Assigning no value provides the option to write a value of control.xml, linking.json or persistent.bin depended on the parameterType.

ParameterTypes

ParameterType Description.
INPUT In this parameter type a value can be written, for example Via DESK-tool or when linked to a other parameter via linking.json. Input data cannot be stored, only during start-up, data is retrieved from parameter.json or linking.json.
OUTPUT This parameter type is read-only, in linking.json you can link an input to an output parameter. Output data cannot be stored, only during start-up data is retrieved from parameter.json or linking.json.
PARAMETER This parameter type is used to configure the system. Parameters are retrieved from the parameter.json or control.xml during start-up. This parameter can be read and written that can be saved via desk-tool to the control.xml.
PARAMETER_VOLATILE This parameter type is used to configure the system. Parameters are retrieved from the parameter.json or linking.json during start-up. This parameter can be read and written, the parameter_volatile can not be stored.
PARAMETER_PERSISTENT This parameter type is used to configure the system. Parameters are retrieved from the persistent.bin during start-up. This parameter can be read and written, the last value of this parameter is automatically stored in the persistent.bin.