Showing results for 
Search instead for 
Did you mean: 

OLP Command Services

In the past I have figured out how to create commands by writing my own service to read my XML Templates for OLP and use them to create a string value to use to create a new command to insert into a locations commands list.


What I haven't been able to figure out is how to use the API to read in the controller template set to a robot. I have looked at the methods for the TxOlpCommandServices, but I cannot figure how to use any of them to get the commands for a dialog.  ("I can easily find which dialog I need for the situation based off application type, path type, and a few user selections in the UI").


There is a method .GetOlpCommandNamesFromDialog(string dialogName) that returns a string[] of command names.  My connundrum is how do I use a string array of the names to get the actual commands from the Robot Controller? 


This time around I would like to make the application cleaner by utilizing the API to use the XML commands to fill out logic into locations rather than implementing all that code to read the XML myself and recreate each command from the XML into the locations.


Re: OLP Command Services

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Cliff,


TxOlpCommandServices.GetAllOlpDialogNames returns all OLP dialogs as list of strings.

Then for each dialog, you can query TxOlpCommandServices.GetDialogIcon and GetDialogTitle.

And finally TxOlpCommandServices.ShowDialog will popup the customized command dialog. You need to register to the dialog closed via TxOlpCommandServices.compositeCommandChanged event

TxOlpCommandServices cmdServ = new TxOlpCommandServices(controller);

if (cmdServ != null)
// register OK callback
cmdServ.compositeCommandChanged -=OnCustomizedCommandOKClickCb;
cmdServ.compositeCommandChanged += OnCustomizedCommandOKClickCb;
cmdServ.ShowDialog(sCustomizedDialogCommand, m_currObj.TxOperation);

On the callback, you get the customized command elements and can create (or update) your command:

private void OnCustomizedCommandOKClickCb(object sender, TxOlpCommandServices_CompositeCommandChangedEventArgs e)


Best Regards,