Thanks.
The command is showing on the device, and the custom panel is calling the command, but...
the api function is not being run.
How does the command entry in the device resource config map to an actual function?
Thank you.
Original Message:
Sent: 06-01-2026 11:45
From: Kiran Adhikari
Subject: OGP Commands
Hi Simon,
Yes, once you have the command set up on the device, it can be invoked from the custom panel using:
params.executeCommand(CMD_NAME, ARGS, CALLBACK);
For example, if I had a add_device command, it can be called from the panel like this:
params.executeCommand("cmds.add_device", {"connection_settings": cs}, null);
In your case, it could be:
params.executeCommand("cmds.matrixRoute", {"src": src, "dst": dst}, null);
In the custom panel, if I assign this task to a button click, it could look something like this:
<button buttontype="push" height="66" left="224" name="matrix" top="53" width="146">
<task tasktype="ogscript">
params.executeCommand("cmds.matrixRoute", {"src": 1, "dst": 2}, null);
</task>
</button>
------------------------------
Kiran Adhikari
------------------------------
Original Message:
Sent: 05-31-2026 21:14
From: Simon Liddicott
Subject: OGP Commands
I've managed to get the command advertised:
}
"commands": { "_d_testCommand": { "oid": "testCommand", "name": "testCommand", "type": "STRING", "readonly": false, "widget": "default", "maxlength": 0, "totallength": 0, "value": "", "response": false }, }
But it never calls the function.
I've tried adding as ogscript with the command oid and ogscript id matching, adding it as an API function and also adding a remote trigger:
function testCommand(event)
{
ogscript.debug("hello");
}
ogscript.addRemoteTrigger(testCommand);
I can see in wireshark the execute command request is sent:
{"payload":{"oid":"testCommand"},"slot":0,"type":"cmd-exe"}
How am I supposed to define the function so that it is executed this way?
Thanks.
------------------------------
Simon Liddicott
Systems Engineer
Original Message:
Sent: 05-29-2026 14:22
From: Simon Liddicott
Subject: OGP Commands
Hi Kiran
Thanks for responding.
That's what I'm trying to do, but the examples don't give enough context.
Are you able to share an example where this has been implemented?
Thank you.
------------------------------
Simon Liddicott
Systems Engineer
Original Message:
Sent: 05-29-2026 13:15
From: Kiran Adhikari
Subject: OGP Commands
Hi Simon,
You'll want to expose this as an OGP command on the device, rather than as a function in the CustomPanel.
In the device resource declaration, add a command such as matrixRoute with src and dst as arguments, typically using a STRUCT value. Once the device is added as a data source in DashBoard, the CustomPanel can execute that command through Visual Logic or ogScript.
So:
matrixRoute(src, dst)
would be modelled as a device command like:
command: matrixRoutearguments: src, dst
There is also an example for this covered under the Device Resource Declarations → commands / command section of the CustomPanel Development Guide.
------------------------------
Kiran Adhikari