Command and Script Functions List
Command and Script Functions Tables
Command Functions
Item | Description |
---|---|
Add Row to Data Log | Adds a row to the Data Log. It has the following parameters: Data Log Model: specifies which Data Log Model will have the vrow added. |
Call Script | Toggles a Manual Script to be run when activated. It has the following parameters: Run on a separate thread: A toggle that will determine if each instance of the script being run will count as a separate script or the same one. Script Name: Specifies the script that will be called. |
Close Page | Closes the current page. It has the following parameters: Method: Either calling the page by the name or by the index. Page: Depending on the Method, users will specifiy the page by name or page number. It is possible to close all pages in a project with this command. This function should only be used to close popup pages. |
Enable/Disable Driver | Enables or Disabled Communication with the selected I/O Device. It has the following parameters: I/O Device: Selects which I/O Device will have their communication configuration will be altered. Operation: Sets the command only to Enable or Disable. |
Enable/Disable Schedule | Sets a schedule to be turned on or off depending on the command specifications. It has the following parameters: Schedule: specifies which schedule to enable/disable. Operation: Sets the command only to Enable, Disable, or Toggle the schedule. |
Enter Tag Value | Opens up a keypad to manually input a new tag value. It has the following parameters: Type: Sets the to-be input as either text or a Numeric input. Numeric will display a keypad; text will display a keyboard. Tag: Specifies the tag that will be changed. Header: Sets the text at the top of the keypad that will appear at the top left of the keypad window. Subheader: Sets the text below the header. It will appear also in the top left of the keypad. X: Sets the X position for the keypad Y: Sets the Y position for the keypad. The following parameters are for Numeric Keypads only. Decimal Places: Will set how many decimal places will show by default when opening the keypad. Leading Zeroes: Sets how many Zeroes will appear preceding the tag value when opening the keypad Base: Can be set to either Decimal or Hexadecimal. A numeric keypad will appear with standard numbering conventions of A-F, respectively. Use Thousands Separator(,): Adds a comma for every thousand places. Use Scaling: Enables the use of Raw Min / Raw Max for the keypad. Restrict Min/Max Input: Will enable the use of setting a Min / Max on the keypad. Raw Min: The lowest number that the tag will be scaled to. Raw Max: The highest number the tag will be scaled to. Min: Set the minimum value accepted for the keypad. No limit. Max: Set the maximum value accepted for the keypad. No limit. |
Exit Project | Automatically closes the project. There are no parameters for this command. |
Export Recipe CSV | Select a Recipe to export into the selected storage type. It has the following parameters: Recipe: Select the Recipe to have the CSV file exported from. Storage Type: Selection choice for where the CSV file will be exported to. |
Import Recipe CSV | Select a CSV file to import into the selected recipe. It has the following parameters: Recipe: Select the Recipe to have the CSV file imported. Storage Type: Selection choice for where the CSV file will be searched from. |
Insert Custom Script | Creates a script to run. Will be treated like a Manual Script. There are no parameters for this command. |
Logout User | Automatically logs out the current user from the runtime. There are no parameters for this command. |
Open Config Menu | Opens the configuration menu, usually opened via the 3-corner method. There are no parameters for this command. |
Open Frame Monitor | Opens up the Frame Monitor. This only works on a physical Xpanel and is not supported in simulator mode. There are no parameters for this command. |
Open Login Window | Opens the Login window for Identity and Access Management. It has the following parameters: Show User List: A toggle to show the list of all available users or to have the user type in the username. |
Open PDF | Opens the PDF viewer with the specified file. It has the following parameters: Storage Type: Selection choice of where to search for valid PDF files. PDF File: Selects the PDF to open. |
Open Page | Opens a new page. It has the following parameters: Method: Either calling the page by the name or by the index. Page: Depending on the Method, users will specifiy the page by name or page number. If the selected page is not a popup, it will close and replace the current base page. |
Open Previous Page | Open the previous page that the current page was opened from. There are no parameters for this command. |
Open Recipe Config | Opens a Recipe configuration window in runtime. It has the following parameters: Recipe: Select the Recipe that will have its config window open. |
Play Library Audio | Plays the selected audio file. It has the following parameters: Audio File: The selected audio file that will be played. Async: Allows the playing of multiple audio files at once if selected. This will only work on the eXT2 series. |
Stop Library Audio | Stops playing the selected audio file. It has the following parameters: Audio File: The selected audio file that will be played. This will only work on the eXT2 series. |
Play Video | Plays the selected video file. It has the following parameters: Storage Type: Sets where the video file will be selected from. Has the options of Local, USB, SD Card, FTP and Project. Video File: Sets the video file that will be played. This will only work on the eXT2 series. |
Press Key | Simulates a keystroke from a specified key on the keyboard. It has the following parameters: Key: Specifies which key will be simulated. I.E., Enter, tab, backspace, etc. |
Receive Recipe Record | Receives tag values from the project and saves them to the recipe. It has the following parameters: Recipe Database: Sets the Recipe database to pull the info from. Use Record Tag ID: A Toggle to pull the tag connected to the record or just the ID number. Record ID: The ID number of the record to pull tag data from. Record Tag ID: The Tag connected to the record to pull tag data from. |
Save Alarm CSV | Creates a CSV file based on the Alarm Summary data. It has the following parameters: Storage type sets where the CSV file will be stored. Has the options of Local, USB, SD Card, FTP, and Project. Label: This can be set only to record Alarms with a specific label or to grab all labels. Disclaimer: CIMON recommends exclusively using a USB or SD card for storage types. Saved CSV files to local memory are only accessible through an SSH connection. |
Save Data Log CSV | Creates a CSV file based on the Data Logger data. It has the following parameters: Storage type sets where the CSV file will be stored. Has the options of Local, USB, SD Card, FTP, and Project. Data Log Model: Specifies which Data Log Model to grab the data from. Time Range: All by default. It can be configured to grab within a specific time frame only. Disclaimer: CIMON recommends exclusively using a USB or SD card for storage types. Saved CSV files to local memory are only accessible through an SSH connection. |
Send Email | Sends an email from the project to the recipients. It has the following parameters: To: Select from Users or groups, or type in an email to send the message to. Cc: Carbon copy. Recipients in this will receive the email, but it will not be primarily addressed to them. Subject: Sets the subject line for the email. Message: Sets what the message within the email will be sent. For this command to work, emails must be configured to send. More information on how to do so will be found on our Email Feature Page. |
Send Recipe Record | Sets tags to the values saved within the recipe. It has the following parameters: Recipe Database: Sets the Recipe database to pull the info from. Use Record Tag ID: A Toggle to pull the tag connected to the record or just the ID number. Record ID: The ID number of the record to pull tag data from. Record Tag ID: The Tag connected to the record to pull tag data from. |
Send Screen Notification | Sends a notification to the bottom of the screen during runtime. It has the following parameters: Message: Set the message to be sent by the news. Automatically Dismiss: Toggle to turn on automatic dismissal. Dismiss Delay (ms): Set how long the project will wait before Dismissing the message. |
Set Tag Value | Sets the tag value to the predetermined value. It has the following parameters: Tag: Specifies which tag will have its value changed. Value Type: Configuration for how the value will be set, copying from another tag or by a constant integer. Value: Depending on the configuration of the Value Type, it will require either an int or another tag to grab the value from. |
Set Translation Language | Sets the Language. It has the following parameters: Language: Set the language, which must be in the translation editor. |
Start/Stop Data Log | Sets a Data Log to be turned on or off depending on the command specifications. It has the following parameters: Schedule: specifies which Data Log Model to enable/disable. Operation: Sets the command only to Enable or Disable. |
Start/Stop FTP Server | Toggles on or off an FTP server. It has the following parameters: Operation: Sets the power only to Start or Stop. |
Toggle Tag Value | Toggles a tag to interchange between zero and one. It cannot go to any other value. Has the parameters: Tag: Sets the tag which is to be toggled. |
Script Functions
All functions must be used with parenthesis
alarm.createAllCsv(enum storageType ) |
Saves all the messages at the assigned Storage type as a CSV.Enter the number or string below as the user’s declared Storage type :1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project The return value is undefined. Example:
|
alarm.createCsv(String label , enum storageType ) |
Saves all the alarm messages associated with the String label at the assigned Storage type as a CSV.String label refers to one of the labels within the Alarm Settings. Users can create their own labels or use a preset label.Enter the number or string below as the user’s declared Storage type :1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project The return value is undefined. Example:
|
datalog.addRow(String modelName ) |
Causes the Data Log Model specified to have a single row added to it.String modelName refers to the name of the data log model to be targeted.The return value is undefined. Example:
|
datalog.createCsv(String modelName , enum storageType ) |
Creates a CSV file of the Data Log Model specified at the designated location.String modelName refers to the name of the data log model to be targeted.Enter the number or string below as the user’s declared Storage type :1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project The return value is undefined. Example:
|
datalog.createCsvForRange(String modelName , Date start , Date end , enum storageType ) |
Creates a CSV file of the Data Log Model specified at the designated location with a set time boundary.String modelName refers to the name of the data log model to be targeted.Enter the number or string below as the user’s declared Storage type :1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project Date start refers to the first day that it will collect data from.Date end refers to the last day that it will collect data from.The return value is undefined. Example:
|
datalog.start(String modelName ) |
Causes the Data Log Model specified to begin logging data.String modelName refers to the name of the data log model to be targeted.The return value is undefined. Example:
|
datalog.stop(String modelName ) |
Causes the Data Log Model specified to stop logging data.String modelName refers to the name of the data log model to be targeted.The return value is undefined. Example:
|
driver.enable(Device Name ) |
Enables the specified device.Device Name refers to the name of the device to enable.Example:
|
driver.disable(Device Name ) |
Disables the specified device.Device Name refers to the name of the device to disable.Example:
|
keyboard.launchKeyboard(tagname , properties ) |
Creates a popup keyboard to set a tag to the user input value.tagname refers to the name of the tag to be set.properties refer to optional specifying parameters that can change components of the keyboard. The following options are:
Example:
|
keyboard.launchKeypad(tagname , properties ) |
Creates a numeric keypad popup to set a tag to the user input value.tagname refers to the name of the tag to be set.properties refer to optional specifying parameters that can change components of the keypad. The following options are:
Example:
|
keyboard.sendKeyEvent(keycode ) |
Simulates a keystroke for an integer keycode.keycode is a code that indicates which key to simulate, either in hexadecimal or decimal.Example:
|
notification.send(string msg , int dismissInterval = -1 ) |
Sends a popup notification to the screen runtime displaying the specified message.string msg refers to the string to be displayed in the notification.int dismissInterval refers to an optional number of seconds before the notification is automatically dismissed.If dismissInterval is less than 0, the message will stay until manually dismissed.The return value is 0. Example:
|
page.close(string name ) |
Closes the page with the specified name.string name refers to the name of the page to be closed.The return value is undefined. Example:
|
page.closeIndex(number index ) |
Closes the base page with the specified index.number index refers to the index of the base page to be closed.The return value is undefined. Example:
|
page.open(string name ) |
Opens the page with the specified name.string name refers to the name of the page to be opened.The return value is undefined. Example:
|
page.openIndex(number index ) |
Opens the base page with the specified index.number index refers to the index of the base page to be opened.The return value is undefined. Example:
|
recipe.createRecord(string recipe , int id , string name , List<Value> values ) |
Creates a new record with the given parameters and adds it to the local recipe database.string recipe refers to the recipe database to add the new record to.int id refers to the Record ID of the new record.string name refers to the name of the record.List<Value> values refers to a list of parameter values to store in the record.The return value is undefined. Example:
|
recipe.deleteRecord(string recipe , int id ) |
Deletes the given record from the recipe database.string recipe refers to the recipe database to delete the record from.int id refers to the ID of the record to be deleted.The return value is undefined. Example:
|
recipe.exportCsv(string recipe , Storage type , string path ) |
Saves recipe data in a CSV at the specified path.string recipe refers to the recipe database.Enter the number or string below as the user’s declared Storage type :1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project string path refers to where to find the CSV file, relative to the storage location.The return value is undefined. Example:
|
recipe.getAllParameters(string recipe ) |
Returns a list of the current parameter values from the device (the current tag values).string recipe refers to the recipe database.The return value is a list of the current tag values. Example:
|
recipe.getParameter(string recipe , int id , int index ) |
Returns a single parameter value from a given record from the recipe database.string recipe refers to the recipe database.int id refers to the Record ID of the record.int index refers to the position within the recipe.The return value is the value of the specified cell. Example:
|
recipe.getParameterByName(string recipe , int id , string name ) |
Returns a single value from the given record from the named column.string recipe refers to the recipe database.int id refers to the Record ID of the record.string name refers to the parameter the user wants to grab data from.The return value is the value of the specified cell. Example:
|
recipe.getRecordName(string recipe , int id ) |
Returns the name of the given record from the selected recipe database.string recipe refers to the recipe database.int id refers to the Record ID of the record.The return value is the name of the record. Example:
|
recipe.getRecordValues(string recipe , int id ) |
Returns the values stored in a record from the local recipe model.string recipe refers to the recipe database.int id refers to the Record ID of the record.The return value is a list of values stored in the record. Example:
|
recipe.importCsv(string recipe , Storage type , string path ) |
Replaces recipe data with the data found in a CSV at the path.string recipe refers to the recipe database.Enter the number or string below as the user’s declared Storage type :1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project string path refers to where to find the CSV file, relative to the storage location.The return value is undefined. Example:
|
recipe.setParameter(string recipe , int id , int index , Value value ) |
Sets a single value (cell) in the given recipe database for a given record and parameter.string recipe refers to the recipe database.int id refers to the Record ID of the record.int index refers to the position (column number) of the parameter within the recipe.Value value refers to the new value that will be set.The return value is undefined. Example:
|
recipe.setParameterByName(string recipe , int id , string name , Value value ) |
Sets a single value (cell) in the given recipe database for the given record and column name.string recipe refers to the recipe database.int id refers to the Record ID of the record.string name refers to the parameter the user wants to set data to.Value value refers to the new value that will be set.The return value is undefined. Example:
|
recipe.setRecord(string recipe , int id , List<Value> values ) |
Updates the values of a record from the local recipe database.string recipe refers to the recipe database.int id refers to the Record ID of the record.List<Value> values refers to a list of values to store in the record. The list should contain one value for each parameter in the recipe.The return value is undefined. Example:
|
recipe.setRecordId(string recipe , int oldId , int newId ) |
Updates the record ID for a record in the specified recipe database.string recipe refers to the recipe database.int oldId refers to the old Record ID of the record.int newId refers to the new Record ID of the record.The return value is undefined. Example:
|
recipe.setRecordName(string recipe , int id , string name ) |
Updates the name of a record from the specified recipe database.string recipe refers to the recipe database.int id refers to the Record ID of the record.string name refers to the new name that will be assigned to the record.The return value is undefined. Example:
|
schedule.isEnabled(string title ) |
Returns a Boolean indicating whether the schedule is enabled or not.string title refers to the name of the schedule that is being checked.Example:
|
schedule.setEnable(string title , bool enable ) |
Turns the named schedule on or off based on what bool enable is set to.string title refers to the name of the schedule that is being enabled/disabled.bool enable can only be set to true to enable the schedule or false to turn off the schedule.The return value is undefined. Example:
|
system.audio.playFile(Storage type , string relativePath , bool async = true ) |
Plays an audio file at the designated location. Enter the number or string below as the user’s declared Storage type .1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project string relativePath refers to the path to the audio file.If async is true, it will return immediately; otherwise, it will finish when the audio file is complete. The return value is the audio file. Example:
This will only work on the eXT2 series.
|
system.audio.stopFile(Storage type , string relativePath ) |
Stops all audio files at the specific location. Enter the number or string below as the user’s declared Storage type .1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project string relativePath refers to the path to the audio file.The return value is the audio file. Example:
This will only work on the eXT2 series.
|
system.audit.log(description ) |
Logs the entered description in the audit database.description refers to the text to be added to the database.The return value is undefined. Example:
|
system.currentUsername() |
Returns the current Username of the current logged-in User. Example:
|
system.email.send(properties ) |
Sends an email using the SMTP settings.properties refer to specific email properties including:
Note: This function will not work in the offline simulator. Example:
|
system.exit() |
Closes the current project and runtime application. The return value is undefined. Example:
|
system.file.exists(Storage type , String path = string() ) |
Determines whether a file exists at the given path. Enter the number or string below as the user’s declared Storage type .1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project String path refers to the path to the file.The return value is true or false. Example:
|
system.file.isDirectory(Storage type , String path ) |
Determines whether the path is a directory or not. Enter the number or string below as the user’s declared Storage type .1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project String path refers to the path to the directory.The return value is true or false. Example:
|
system.file.openDialog(Storage type , String path = string() ) |
Opens a dialog to select a file at the given path. Enter the number or string below as the user’s declared Storage type .1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project String path refers to the path for selecting a file.The return value is undefined. Example:
|
system.file.openPdf(Storage type , String path ) |
Opens the PDF viewer with the specified file.Storage type :1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project String path refers to the path to the file.The return value is true if the PDF opened, or false if it did not. Note: This function will not work in the simulator. Example:
|
system.file.saveDialog(Storage type , String path = string() ) |
Opens a dialog to save a file at the given path. Enter the number or string below as the user’s declared Storage type .1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project String path refers to the path for saving a file.The return value is undefined. Example:
|
system.ftp.startServer() |
Starts a local FTP server. The return value is undefined. Note: This function will not work in the simulator. Example:
|
system.ftp.stopServer() |
Stops a local FTP server. The return value is undefined. Note: This function will not work in the simulator. Example:
|
system.hasPermission(string permission ) |
Check to see if the currently logged-in user has the specified permission.string permission refers to the name of the permission being checked.The return value is true if the user has permission and false if the user does not. Example:
|
system.importScript(string scriptName ) |
Executes a specified script in the current project on the current thread.string scriptName refers to the target script that will run within the current script.The return value would be whatever the result of the called script is. Example:
|
system.login(string username , string password ) |
Immediately logs in the user for the Identity and Access Management feature.string username refers to the name of the user to log in to.string password refers to the password for the specific user. This argument can be omitted without a password or an empty string.The return value is true if the user is successfully logged in; false if unsuccessful. Example:
|
system.logout() |
Logs out of the current user from the Identity and Access Management system. The return value is undefined. Example:
|
system.openAuthWindow(properties ) |
Opens the built-in dialog for authenticating a user. Users will have to re-enter username and password.properties refer to optional parameters that can change components of the function. The options are:Username: Sets the user to be authenticated. If no user is provided, it will authenticate any user that enters their username and password. If no user is logged in, it will return false. Permissions: Only allows users with the listed permissions to log in. If they do not have permission, login will not complete. The return value is true if logged in, otherwise false. Example:
|
system.openConfig() |
Opens the runtime config (3 corner method) menu. The return value is undefined. Example:
|
system.openFrameMonitor() |
Opens the Frame Monitor. The return value is undefined. Note: This function will not work in the simulator. Example:
|
system.openLoginWindow(properties ) |
Opens the login window from the Identity and Access Management system.properties refer to optional specifying parameters that can change components of the function.The only option is: listUsers: A toggle to show the list of all available users, or to have the user type in the username. The return value is undefined. Example:
|
system.runScript(string scriptName ) |
Executes a specified script in the current project on a separate thread.string scriptName refers to the target script that will run within the current script.The return value is undefined. Example:
|
system.screenshot(Storage type ) |
Takes a screenshot of the screen during runtime.Storage type :2: Storage.Usb 3: Storage.SdCard Example:
|
system.setLanguage(string language ) |
Sets the language to be used by the Translation Editor.string language refers to the name of the language to be used. This should be one of the columns in the Translation Editor.The return value is undefined. Example:
|
system.video.playFile(Storage type , String path ) |
Opens a video for playback from the specified location.Storage type :1: Storage.Local 2: Storage.Usb 3: Storage.SdCard 4: Storage.Ftp 5: Storage.Project String path refers to the path to the file.The return value is true if the video played, or false if it did not. Note: This function will not work in the simulator. Example:
This will only work on the eXT2 series.
|
system.video.stop() |
Stops the current video playback on the runtime. Note: This function will not work in the simulator. Example:
This will only work on the eXT2 series.
|
tag.read(string name ) |
Gets the current value of the specified tag.string name refers to the name of the tag.The return value depends on the type of the tag; a BOOL will return a BOOL, a String will return a String, etc. Example:
|
tag.write(string name , value ) |
Sets the value of the specified tag.string name refers to the name of the tag.Value refers to what the tag will be set to.The return value is undefined. Example:
|
thread.msleep(number msecs ) |
Suspends the current thread for the specified amount of milliseconds.number msecs refers to the number of milliseconds the program will wait before continuing execution.The return value is undefined. Example:
|
thread.sleep(number secs ) |
Suspends the current thread for the specified amount of seconds.number secs refers to the number of seconds the program will wait before continuing execution.The return value is undefined. Example:
|