I would like to be able to check the license status of specific Ignition modules during my Vision client startup in the startup script so that I can enable or disable features that require specific licenses to be installed on the customer system. Is there a way to do this?
You’ll have to go to the gateway (
system.util.sendRequest) and then use some less documented APIs to ask the ModuleManager for the license status of particular modules. Search on the forums for
Good morning PGriffith,
I did some digging, and I found some interface information for ModuleManager and reviewed the information on the (system.util,sendRequest) you mentioned. You are correct the documentation is very sparse. The first problem I have is that I don’t understand the topology and how the sendRequest works in conjunction with the API. As a result, I can’t figure out the syntax for the function call. If I had a basic understanding of the topology, I may be able to figure this out but right now I admit I am completely lost. I am not a Java programmer but the API stuff looks very similar to the C++ and C# classes and interfaces I am familliar with. Unfortunately without additional guidance this may be a bit out of my wheelhouse Is there a simpler approach to do what I need?
Background I can do
So, the initial problem:
You’re asking for information while you’re in a Vision client. The Vision client itself does not “know” this information at all; all Vision (really) cares about is obviously the Vision module, and any other module that adds Vision components (e.g. Web Browser, Reporting). But the gateway does know this information, so you can take advantage of a built in utility designed just for this sort of task;
sendRequest, you can send a message (over HTTP, in this case) to your local gateway, where a Gateway message handler will fire. Because that script is running on the gateway, it has access to everything the gateway does (with some complications).
So the next piece is going from “I’m a script running on the gateway” to “I know which modules are licensed”. The first step there is going to be retrieving a
GatewayContext, which is the center of the tangled web of ~everything the gateway does. That’s where you’ll want to search on the forums for “IgnitionGateway” - there’s a static method you can use on that (undocumented) class to retrieve a GatewayContext instance from anywhere on the gateway.