Functions
CommandCenter has in-built functions for common operations that either cannot be achieved using expressions or would be laborious to create.
Function Name |
Arguments |
Function/Description |
---|---|---|
CONDITIONAL_ASSIGNMENT |
match,value,default,comp1,value1,comp2,value2.. ..comp8,value8 |
Acts like a 'switch case' in c programming language. Compares the 'match' against 'comp1,2,3 - 8' in turn and assigns the 'value' to 'value1,2,3 - 8' depending if the compare is true. Value is assigned to default if none of the compares evaluate to true. |
CREATE_COLOUR | Red, Green, Blue, RGB or BGR | Takes a red, green and blue value and creates a RGB or BGR (normal) value in the form expected by CommandCenter for setting control colours. |
CURRENT_DATE_TIME | Format |
Gets the current date and time and formats it as a return string in the format required. %Y - Year, %m - Month, %d - Day, %H - hours, %M - minutes, %S - seconds |
DECODE_STRING | String | Removes escape characters from a string, reverse of ENCODE_STRING see below |
ENCODE_STRING | String | Encodes a string |
EXTRACT_VARIABLE_NAME | Variable | Takes a variable string and strip out the user defined part of the name |
FIND_FIRST | string, find string, start position | Finds the position of the find string in the string supplied. The find string can be either a single character or a string |
FIND_LAST | string, find string | Finds the last position of the find string in the string supplied. The find string can be either a single character or a string |
FORMAT_NUMBER | Number, Base, Digits, Precision | Formats an ASCII string when given a number, based on the base, number of Digits and Precision |
GENERATE_ROUTER_ID_CSV | ID CSV, Offset | Generate a CSV of router IDs, with optional offset. e.g. x=1,y=2,z=3 and offset = 1, result = “|ID|2,|ID|3,|ID|4 |
GENERATE_ROUTER_ID_STRING | ID | Generate a router ID string from ID e.g. x=1, result = “|ID|1” |
GENERATE_ROUTER_LPR_STRING | LPR | Convert internal value for protect/release to a human readable string e.g. x=0, result = “Unlocked” |
GET_COLOUR_VALUE | Extract, Colour, RGB or BGR | |
GET_DATASTORE_COUNT | File Path, Data Path | Returns the number of child items from a 'Path' in an XML 'File' |
GET_DATASTORE_VALUE | File Path, Data Path, Attribute | Returns the value from an Attribute Path n XML file File, Path,Attribute |
MAXIMUM | Value1,Value2...Value200 | Returns the maximum value out of all the values supplied |
MINIMUM | Value1,Value2...Value200 | Returns the minimum value out of all the values supplied |
OFFSET_NUMBER_CSV | Num CSV, Offset | Offsets the numbers in a CSV string by the offset given, eg "1,2,3" , "10" returns "11,12,13" |
POSITION_IN_CSV | String list, String | Finds the string in the comma seperated string list and returns its position in the string list (0 indexed) |
RESOLVE_IP_FROM_ROUTER_NAME | Router name | Returns the IP address from the Router name supplied |
RESOLVE_ROUTER_NAME FROM_IP | IP Address | Returns the name of the router from the supplied IP address |
STRING_IN_CSV | String list, Position, Separator | Returns the string at 'Position' in the string list delimited with Seperator characters |
STRING_TO_NUMBER | String, base | Interprets a string as a number at the required base. 'FE5412', 16 returns the decimal number equivalent |
TRUNCATE/TRIM STRING | Left trim, Truncate, Right trim, Input string | Returns the modified string having removed 'Left trim' characters (0 if no trim required), then truncates the string to the number of characters specified by 'Truncate' (unless set <= 0), then removes a number of characters on the right of the string determined by 'Right Trim' (0 if no trim required) |
UTF8_ENCODE | string | Encodes the input string as a UTF8 string |
UTF8_DECODE | string | Decodes the input UTF8 string |