Iconics Genesis 64 is a powerful SCADA platform used for a vast variety of automation applications. Whether this is your first time working with Iconics Genesis or if you have been working with it for a while, here are ten useful tips and tricks that everyone working with Iconics should know.
1. Ctrl+m Hot Key for Runtime
Quickly entering and exiting runtime is the best method for testing the functionality of the screen. The fastest way to do this is to simply hit Ctrl + M from inside GraphWorx. Once inside runtime, the only way to exit runtime is to hit Ctrl + M once again.
2. Find and Replace Through All Screens at Once with Ctrl+F and Ctrl+H
Need to search through all your screens at once? Simply hit CTRL + F while NOT inside the scripting window to will display the popup shown below. Select what “Type” you want to find from the “Find Type” section. Next, choose if you want to search the current open section, the current display, or multiple files. If searching through multiple files, either add your files individually or the folder containing the relevant files. Add in your keyword and search. Note, other screens will open so be sure to save the current screen before leaving it.
If you are trying to replace an item instead of finding it, hit CTRL+H instead. All the steps will be the same except there will be an extra text entry section for what you want to replace the text with.
3. Calling Script or Event on Opening a Screen
Calling an event on a screen opening can be quite useful. Often, there are values or connections that need to be initialized when a screen is called. To set this up, add a button to the screen and set initial click to true.
From here, you can add your event or script that should be called at the screen opening. Next, turn off the button’s visibility in the project explorer on the left side. Now the button won’t be interactable from the user but will still call the startup action or script when the screen is opened.
4. Can’t Add a Script to a Button?
Are you unable tot find a function you wrote from the “RunScript” drop down?
That is because the function needs the following parameters need to be passed in:
sender : System.Object, cmdArgs : Ico.Gwx.CommandExecutionEventArgs
Now, the script should be able to be linked to the “RunScript” drop down.
5. C# Syntax to Get Close
If you are new to coding in Jscript.net and unsure on how to get started, C# is a similar language, as they are both .NET languages. Be warned the two languages do have some differences and some fine tuning and error fixing will be required. Luckily, Iconics has built-in error checking!
6. Check for Errors in Script
In the top ribbon of the code view window there is an error checking button.
This button will scan through the script and check for any syntax errors. If there are any errors within script, the first error will be displayed at the bottom of the window.
Please note that this only checks for syntax, bugs and invalid function calls will not be flagged.
7. Adding Variables into Workbench SQL
When querying from SQL it is often useful to insert variables so that the query can be dynamically modified. To implement this, within workbench add the ‘@’ to declare that the following is a variable that will be defined later.
This can be utilized within the script by adding in a string to the SQL call.
This line sets the variable “@Second” to “World”, modifying the query to “SELECT [first] FROM dbo.Table_2 where second = World.”
8. Inserting Variables into SQL Calls
This can be further dynamized by turning the string that is being passed in, in this case “World”, into a variable.
This is a simple use case but the ability to pass variables into SQL queries from a script allows for more complex usage such as passing in data from the user and retrieving the relevant information.
9. How to Find Workbench SQL Path
Trying to hunt down the appropriate path for SQL data source or modifiers in workbench can be tricky and typos can be difficult to hunt down. An easy way to copy this path is by adding a process point and clicking the ellipse next to “data source.”
From here, navigate to the data source or modifier from the drop-down menu.
Now the process point’s data source will have the appropriate path to the data source or modifier selected.
This can be copy and pasted into a script and will then point to relevant spot in workbench.
10 Locked out of a Local Instance of Iconics Gensis 64?
This trick only works if you are working on a local instance. If you exceed the number of login attempts you will be locked out of the account you are using.
If the Iconics configuration SQL database is local, you can access it though Microsoft SQL Server Management Studio. Once you connect to your local server two databases should appear, “IcoSetup” and “IcoUnifiedConfig.” We care about the latter. Open up IcoUnifiedConfig and then open up the tables subsection. Scroll through until you find dbo.SEC_Users, right click and hit “Edit Top 200 Rows.” If there are more than 200 users on your server this will not work and you will have to use a SQL query to modify the value. Once the page is open, scroll until you find the relevant username, move over to the “AccountLocked” column, change this value from True to False. You may need to restart Iconics but your account should no longer be locked!
Learn more about DMC's Iconics programming expertise and contact us for your next project.