Using the Kanzi Studio plugin¶
The Kanzi Monitor plugin for Kanzi Studio adds a Kanzi Monitor menu to Kanzi Studio. From it you add Kanzi Monitor to the open project and to the build of its application, or remove it again, and launch the RemoteConsoleClient and the Monitor Web UI, connected to a running application with Kanzi Monitor, without a command prompt and without knowing where the tools are installed.
The plugin ships in the Windows package, in studio-plugin/KanziMonitorStudioPlugin.dll, and uses the tools of that same package.
Installing the plugin¶
With the Windows installer, the plugin is installed with the rest of Kanzi Monitor. The installer puts a shortcut to the plugin into the Kanzi Studio plugins folder of its Kanzi version,
%ProgramData%RightwareKanzi <KanziVersion>plugins, and removes it when you uninstall Kanzi Monitor.With the extracted Windows package, create a shortcut to
studio-plugin/KanziMonitorStudioPlugin.dllin File Explorer and move the shortcut to%ProgramData%RightwareKanzi <KanziVersion>plugins. Create thepluginsfolder if it is not there. Leave the DLL in the package and link it with a shortcut: the plugin finds its package, and the tools in it, through the shortcut.
Link one Kanzi Monitor plugin for each Kanzi version: with two links to the plugin, Kanzi Studio shows every Kanzi Monitor menu item twice. Kanzi Studio also loads plugins from your own %APPDATA%RightwareKanzi <KanziVersion>plugins folder, so count a shortcut there too. For the same reason, the installer does not install while Kanzi Studio has a Kanzi Monitor plugin that it did not put there. Before you install with the installer, remove a shortcut that you made, unless it links the plugin in the workspace that you install into. See Installing Kanzi Monitor.
Kanzi Studio loads the plugin when it starts, or at once if it is running. See also Installing Kanzi Studio plugins in the Kanzi documentation.
Adding Monitor to a project¶
At the top, the Kanzi Monitor Tools window shows Kanzi Monitor engine plugin: installed when the Kanzi Monitor package of the plugin has the engine plugin, with the Kanzi Monitor version and the Kanzi version that the package was built for, or not installed. Hover over it to see the engine plugin’s path.
Under it, the Project Integration section shows Monitor Engine plugin in Studio project: checked when the open project has the Kanzi Monitor engine plugin. It shows the project as it is, so it also follows changes that you make in the Library yourself. Hover over it to see where the project’s Kanzi Monitor entries point.
Under it, one button adds or removes the Kanzi Monitor engine plugin. Hover over the button to see what the change means for the Preview and for an exported kzb.
To add Kanzi Monitor to an existing project:
Open the project in Kanzi Studio.
Select Kanzi Monitor > Tools….
In the Project Integration section, select Add Monitor Engine plugin to Studio Project, and confirm. The plugin imports the
lib/Win64/vs2022_Release_DLL/kzmonitor.dllof its Kanzi Monitor package into the project’s Kanzi Engine Plugins in the Library, the same as importing the engine plugin yourself, and adds the package’slib/Win64/vs2022_Debug_DLL/kzmonitor.dllto the same entry, when the package has it. If Kanzi Studio does not add the Debug DLL, the plugin says so. The Release DLL is enough for the Preview.Save the project to keep the change. A running Preview restarts with Kanzi Monitor at once, by itself, and a kzb that you export from the project lists the plugin. See What the project entry affects.
When the project already has the Kanzi Monitor engine plugin of the plugin’s package, the button removes it, so the plugin does not add another Kanzi Monitor entry. An entry for any build of Kanzi Monitor in the plugin’s own package, such as its Debug DLL, counts as that package’s Kanzi Monitor. When the project has Kanzi Monitor only from another package or workspace, the plugin neither adds nor removes it: to use the Kanzi Monitor of the plugin’s package, remove that entry in the Library, then add Kanzi Monitor with the button.
To remove Kanzi Monitor from the project:
In the Project Integration section, select Remove Monitor Engine plugin from Studio Project, and confirm. The plugin removes the project’s Kanzi Monitor entries whose DLLs are all in its own Kanzi Monitor package, with their Release and Debug DLLs. It leaves your other engine plugins as they are, and any Kanzi Monitor entry that points, even in part, at another package or workspace: remove such an entry in the Library.
Save the project to keep the change. A running Preview restarts without Kanzi Monitor at once, by itself, and a kzb that you export from the project no longer lists the plugin.
Like importing or deleting an engine plugin in Kanzi Studio, adding or removing Kanzi Monitor clears the Kanzi Studio undo history, so you cannot undo it, or any change you made before it. The confirmation says so. To reverse it, select the button again. Before you add or remove Kanzi Monitor, finish undoing any earlier changes that you may want to undo.
The project can be in any folder, inside the Kanzi workspace or not. Kanzi Studio stores the path of the DLL relative to the project, or absolute when the DLL is on another drive. For a DLL in the Kanzi workspace it can also store the path as <KanziWorkspace>\.... The plugin reads all three, and resolves <KanziWorkspace> to the workspace of the running Kanzi Studio. It counts an entry whose path it cannot resolve as another package’s, so it does not remove it.
What the project entry affects¶
The Kanzi Monitor entry in the project affects your application too, not only Kanzi Studio. The Preview runs with Kanzi Monitor, and a kzb exported from the project lists the plugin, so the application loads Kanzi Monitor too. With the plugin in the Kanzi Studio project, the application does not need kzmonitor in the ModuleNames option of application.cfg. See Integrating Kanzi Monitor as a prebuilt library.
The application must then be able to load the Kanzi Monitor library. Kanzi loads each plugin that a kzb lists, and when it cannot load one, loading the kzb fails with an error that the plugin library must be deployed with the application. So build and deploy the application with Kanzi Monitor, or remove Kanzi Monitor from the project before you export a kzb for an application without it.
Adding and removing Kanzi Monitor does not change your application’s build files, such as CMakeLists.txt, build.gradle or application.cfg. To build your application with Kanzi Monitor, so that it can find the Kanzi Monitor library, use the Application Integration section (see below), or see Integrating Kanzi Monitor into existing projects.
Adding Monitor to the application’s build¶
In the Application Integration section, the Monitor Engine plugin in Application checkbox shows whether the application of the open project builds with Kanzi Monitor: checked when it does, partly checked when only some of the changes are there. The checkbox is read-only. Hover over the row to see the application folder that the button changes. The button under it adds Kanzi Monitor to the application’s build or removes it. It makes the same changes as the integrate tool of the Kanzi Monitor package, without Python.
Select Add Monitor Engine plugin to Application or Remove Monitor Engine plugin from Application, and confirm. The confirmation names the files that change. When adding changes the Android build, it also names the
adb forwardcommand that connects the tools on this computer to the application on an Android device or emulator. See Connecting from the host computer.Regenerate the application’s build.
The plugin makes exactly the changes that it planned when you selected the button: when the files changed before you confirmed, it changes nothing and says so. Partly added, the button adds the rest.
The button changes the application’s build files only, not application.cfg. The application loads Kanzi Monitor because its kzb lists Kanzi Monitor once Kanzi Monitor is added to the project with Add Monitor Engine plugin to Studio Project.
When the button cannot act, a line under it says why: no project is open, the project has no application, or the plugin cannot change a file safely. The row shows the project as it is saved: the plugin reads the Kanzi Studio project file to find the application.
Setting the application the tools connect to¶
By default the tools connect to 127.0.0.1, port 56000. That reaches the Kanzi Studio Preview, or an application with Kanzi Monitor running on the same computer, whichever holds the port. For an application on an Android device connected with USB, or in the Android Emulator, keep these settings and forward the port with adb forward tcp:56000 tcp:56000. See Connecting from the host computer. To connect to another application, for example on a target device on the network:
Select Kanzi Monitor > Settings….
In the Kanzi Monitor Settings window, set the Host and the Port of the application. The host is an IPv4 address or a host name, such as the name of a target board. Kanzi Monitor listens on IPv4 only, so the window refuses an IPv6 address. The port is the application’s
RemoteConsolePort.Select Save, or press Enter in either field.
The window checks the values and says what is wrong with one it cannot use. Kanzi Studio remembers the settings, and the tools use them from their next launch. For the RemoteConsoleClient, which takes an IPv4 address only, the plugin resolves a host name to its IPv4 address.
Launching the tools¶
Select Kanzi Monitor > Tools…. The Remote Tools section of the Kanzi Monitor Tools window shows which host and port the tools connect to.
Select:
Launch remote console client to open the RemoteConsoleClient connected to that host and port, in a console window of its own. See Using the console clients.
Launch Web UI to start the Monitor Web UI connected to that host and port. It opens in your browser. Each launch starts a Web UI of its own, so you can open one for each application. See Using the Monitor Web UI.
At the bottom, the window shows the Kanzi Monitor package that the tools are from. When a tool is missing from that package, the window says which tool and where it looked.
The tools run on their own: they keep running when you close Kanzi Studio. Close the console window of the RemoteConsoleClient, and the window of the Monitor Web UI’s server, when you no longer need them.
Finding the Kanzi Monitor version¶
Select Kanzi Monitor > About…. It shows the version of the plugin. When the Kanzi Monitor package that the plugin found, whose tools it launches, has another version or no version, or when the plugin found no package, it shows that too, on a line of its own.