This is a general how to run and modify code in macros with Omnicast.
Import a macro sample
To run macros within Omnicast, you must have the virtual Matrix installed and the license options to enable macros.
Using the Omnicast Config Tool
- Create a new Macro: Right-click on the logical view: Create->Add-in Management->Macro
- On the newly created Macro; select the "Code" tab on the right pane
- Click import and select the wsc file contained in the zip file.
- Hit Apply at the top to save your changes
- Accept the warnings, you know what you do :)
The macro is now configured but doesn't run in the system. Macros are execute on a Virtual Matrix and can be started on schedule, on event or user request.
- Right click on the logical view: Create->Macro Schedule
- Select on which virtual Matrix the Macro should be executed
- Click on propertie and select which Macro to execute.
- Configure your coverage if it's not always.
- ClickApply at the top.
Macros on schedule will always run in the specified time coverage. If the macro stops the matrix will automatically restarts it within 1 minute.
- Go on the Action tab of any entity
- Add the Action "Execute a Macro" on the desired event
- Select the Macro and Virtual Matrix.
If an event macro doesn't finish by itself once the work is completed, it will run forever...
On User Request
From the Live Viewer: Using Hot Actions or in the tool menu: Tool->Macros
Monitor it, stop it
In the the config tool, select the Virtual Matrix in the physical view, go on the "Statistic" tab. The statistic tab is refresh only on demand. The play and stop icons allows you to control your macro.
In the Live Viewer there's also Macro event that can be displayed.
Macros are written in VB script in a XML file.
To modify the macro code, just select the macro in the config tool and jump to the "Code" tab in the right pane.
The easiest way to get a sample code, it's to create a new macro and use the wizard to generate the function you need, than look at the code.
Once you modify the code, the wizard cannot be used anymore, it would have been impossible to design a function to reverse engineer the code will all the possibilities.