Versions Compared
Version | Old Version 12 | New Version 13 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Tables
Table of Contents | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Command Functions
Item | Description | ||
Open Page | I will open up 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 specify the page by name or page number. If the selected page is not a popup, it will close and replace the current page. | ||
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 specify 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. | ||
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. | ||
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. | ||
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. | ||
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. | ||
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 Min/Max: Will enable the use of setting a Min / Max on the keypad Min: Set the minimum value accepted for the keypad. No limit. Max: Set the maximum value accepted for the keypad. No limit. | ||
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. | ||
Set Translation Language | Sets the Language. It has the following parameters: Language: Set the language, which must be in the translation editor. | ||
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, and FTP. Label: This can be set only to record Alarms with a specific label or to grab all labels.
| ||
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, and FTP. 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.
| ||
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. | ||
Exit Project | Automatically closes the project. There are no parameters for this command. | ||
Open Config Menu | Opens the configuration menu, this is usually opened via the 3-corner method. There are no parameters for this command. | ||
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. | ||
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. | ||
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. | ||
Logout user | Automatically logs out the current user from the runtime. There are no parameters for this command. | ||
Insert Custom Script | Creates a script to run. Will be treated like a Manual Script. There are no parameters for this command. | ||
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. | ||
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 Previous Page | Open the previous page that the current page was opened from. There are no parameters for this command. | ||
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. | ||
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.
| ||
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. | ||
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. | ||
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. | ||
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. | ||
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. |
Script Functions
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Item | Description | ||
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 The return value is undefined. | ||
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 following labels in the below image. 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 The return value is undefined. | ||
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. | ||
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. | ||
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. | ||
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 The return value is undefined. | ||
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 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. | ||
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. Here is a list of supported keycodes. The return value is undefined. | ||
keyboard.launchKeypad(tagname, properties) | Create a popup numeric keypad 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:
The return value is undefined. This function does not wait for user input, and it does not return a value. After this function is called, the rest of the script will be executed. | ||
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 keypad. The following options are:
The return value is undefined. This function does not wait for user input, and it does not return a value. After this function is called, the rest of the script will be executed. | ||
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. Any value that is set to less than 0 means it will stay until manually dismissed. The default value is -1. The return value is 0. | ||
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. If the selected page is not a popup, it will close and replace the current page. | ||
page.openIndex(number index) | Opens the page with the specified index. Numbers index refers to the index of the page to be opened. The return value is undefined. If the selected page is not a popup, it will close and replace the current page. | ||
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. It is possible to close all pages in a project with this command. This function should only be used to close popup pages. | ||
page.closeIndex(number index) | Closes the page with the specified index. Number index refers to the index of the page to be closed. It is possible to close all pages in a project with this command. This function should only be used to close popup pages. | ||
page.currentName() | Gets the name of the current page. The return value is the string containing the name of the currently opened page. | ||
page.currentIndex() | Gets the index of the current page. The return value is the string containing the index of the currently opened page. | ||
schedule.isEnable(String title); | Returns a bool stating if the schedule is enabled or not. String title refers to the name of the schedule that is being checked. | ||
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. | ||
system.importScript(string scriptName) | Executes a specified script in the current project on the current thread. Any variables/functions in the declared script will be accessible in the calling script. 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. The script with this command will not finish execution until the called script completes execution. | ||
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. The script with this command will continue execution after this function is called. | ||
system.openConfig() | Opens the runtime config (3 corner method) menu. The return value is undefined. | ||
system.openXpanelManager() | Opens the Xpanel Control Center (desktop) The return value is undefined. | ||
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. | ||
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; it will return false if it is unsuccessful.
| ||
system.openLoginWindow(properties) | Open 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:
The return value is undefined. | ||
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 specifying parameters that can change components of the function. The only option is: Username: sets the user to be authenticated. If no user is provided, it will authenticate the current user. If there is no user logged in, it will return false. The return value is True if logged in; otherwise, it is false. | ||
system.logout() | Logs out of the current user from the Identity and Access Management system The return value is undefined. | ||
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. | ||
system.exit() | Closes the current project and runtime application. The return value is undefined. | ||
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 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. | ||
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 String relativePath refers to the path to the audio file. The return value is the audio file. | ||
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 is undefined. | ||
system.email.send(properties) | Sends an email using the SMTP settings. Properties refers to specific email properties. The return value is undefined. | ||
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 String path refers to the path to the file. The return value is true or false. | ||
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 String path refers to the path to the directory. The return value is true or false. | ||
system.file.openDialog(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 String path refers to the path for selecting a file. The return value is undefined. | ||
system.file.saveDialog(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 String path refers to the path for selecting a file. The return value is undefined. | ||
system.ftp.startServer() | Starts a local FTP server. The return value is undefined. | ||
system.ftp.stopServer() | Stops a local FTP server. The return value is undefined. | ||
system.openFrameMonitor() | Opens the Frame Monitor. The return value is undefined. | ||
tag.read(string name) | Gets the current value of the specified tag. String name refers to the name of the tag. The return value is dependent on what type the tag is; a BOOL will return a BOOL, a String will return a String, etc. | ||
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.
| ||
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. | ||
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. | ||
recipe.openConfig(string recipe = string()) | Opens a Recipe configuration window in runtime. If no recipe name is given, the function will open the most recently created recipe. String recipe refers to the name of the created Recipe to open. The return value is undefined. | ||
recipe.sendRecord(string recipe, int id) | Sets the recipe values from a local recipe database to a device. String recipe refers to the Recipe to save onto. Int id refers to the record ID to save the new data. The return value is undefined. | ||
recipe.receiveRecord(string recipe, int id) | Gets the recipe values from a device and saves them onto a local recipe database. String recipe refers to the Recipe to save onto. Int id refers to the record ID to save the new data. The return value is undefined. | ||
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. 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 all parameters that must be listed within the record. The return value is undefined. | ||
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. | ||
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 to add the new record. Int Id refers to the Record ID of the record. List <Value> values refers to all the values within each parameter that must be listed within the record. The return value is undefined. | ||
recipe.getRecordValues(string recipe, int id) | Updates the values of a record from the local recipe model. String recipe refers to the recipe database to add the new record. Int Id refers to the Record ID of the record. The return value is a list of all record values. | ||
recipe.getAllParameters(string recipe) | Returns a list of all record values from the device. String recipe refers to the recipe database. The return value is all values from the device. | ||
recipe.getParameter(string recipe, int id, int index) | Returns a single 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 requested. | ||
recipe.setParameter(string recipe, int id, int index, Value value) | Sets a value of a record from the selected recipe database. String recipe refers to the recipe database to add the new record. Int Id refers to the Record ID of the record. Int index refers to the position within the recipe. List value refers to the value that will be set. The return value is undefined. | ||
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 new record. String name refers to the parameter the user wants to grab data from. The return value is the value of the record. | ||
recipe.setParameterbyName(string recipe, int id, string name, Value value) | Sets 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 new record. String name refers to the parameter the user wants to set data to. Value value refers to the new data that will be set. The return value is undefined. | ||
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. | ||
recipe.setRecordName(string recipe, int id, string name) | Sets the name of a record and saves it to the name of the selected recipe database. String recipe refers to the recipe database. Int Id refers to the Record ID of the new record. String name refers to the new name that will be added to the record. The return value is undefined. | ||
recipe.setRecordId(string recipe, int oldID, int newId) | Updates the record ID from the selected 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. | ||
recipe.importCsv(string recipe, Storage type, string path) | Replace 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 String path refers to where to find the CSV file. The return value is undefined. | ||
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 String path refers to where to find the CSV file. The return value is undefined. |