Environment variables are device-specific global variables with predefined values that you can insert anywhere on the command line as dynamic placeholders. An overview of the environment variables and their values can be output using the appropriate CLI commands (see below).
All predefined environment variables begin with two underscores: When entering commands on the command line, the variables are preceded by a dollar sign.
Variable name | Contents |
---|---|
__BLDDEVICE | The sub-project of the device. The sub-project generally consists of a string without spaces and it stands for the hardware model of the current device. |
__DEVICE | The type of the device, for example as displayed in LANconfig or on the device type label. |
__FWBUILD | The build number of the firmware currently used in the device. The build number is a four-digit number |
__FWVERSION | The version number of the firmware currently used in the device, in the form 'x.yy'. The firmware version consists of the major release before the dot and the minor release after it. |
__LDRBUILD | The build number of the firmware currently operating in the device. The build number is a four-digit number |
__LDRVERSION | The version number of the loader currently installed in the device, in the form 'x.yy'. The loader version consists of the major release before the dot and the minor release after it. |
__MACADDRESS | The type of the device, given as a 12-digit string of hexadecimal values with lowercase letters and no separators. |
__SERIALNO | The device serial number. |
__SYSNAME | The system name of the device. |
Use the following commands in the CLI to display or modify environment variables:
- printenv: Displays all environment variables and their current values. If you have set one or more environment variables with the command setenv, the output of the command printenv shows the user-defined value at the top and the default value below it.
- echo $__device: Displays the current values of a single environment variable, in this example the value for the variable '__DEVICE'.
- setenv __device MeinWert: Sets the value of an environment variable to the desired value.
- unsetenv __device: Sets the value of an environment variable to the default value.