The DataSuite has many options for customizing variables before use. It allows you to customize variables according to specific formats, such as restricting DateTime variables to time or date. The side panel for the calculation and formatting options can be found anywhere we can select a variable. Once we are in the variable selection we can simply expand the panel on the right side of the window and add as many calculations and formatting as we want.
Operations #
The DataSuite offers the possibility to format variables, replace specified text sections with other text, conditional replacement of the variable value and the application of simple calculations through the side panel.
Formatting #
Formatting text is very useful for tailoring a text to what is necessary or to ensure that the text adheres to a predefined standard. For this purpose, DataSuite offers the option to adjust variables with the help of a format string. A typical case is to crop a date so that you only get the month or the year, for example. PLC devices often only have one DateTime variable. In this case, DataSuite allows you to get both the date and the time individually from this variable. At the same time, we can use this formatting to use the computer time variable available in DataSuite more effectively.
Formatting Examples #
Limit decimal places of a floating point number | 0.000 (limited to 3 digits after the decimal point) |
Time without Seconds | hh:mm |
Date without Year | MM:dd |
Replace Text #
The Replace text function does exactly what it says. In this function, we can simply specify a text that we want to replace and what we want to replace it with. For example, this function allows us to convert error codes into error descriptions or to break up umlauts for the international market. Or perhaps you have used abbreviations in your strings in the PLC to save memory and now want to have them written out.
Boolean #
The Boolean function allows us to conditionally assign a value to variables. To do this, the variable is converted into a Boolean (also called a bit in PLC, a value that is true or false). Based on what this value then represents, the corresponding value is returned. However, it is important to note that it makes more sense for some variable types than for others. For example, there are values that automatically become true as long as they are not empty. So it would be good to stick with simple data types like bit or byte.
Calculation #
The Calculations function allows us to calculate our variables with fixed values. The four basic arithmetic operations are covered. Possible applications are the conversion of units. For example, we can convert kiloamperes into amperes by simply multiplying by 1000. Or we could convert kilometers per hour into meters per second. Alternatively, you can convert a timestamp represented in milliseconds to seconds if you don’t need this fine precision and want to save memory.