I want to retrieve the protocol related information and the table ids and names/description linked with the protocol in my automation script wherein I don't know the Ids and Description
I get protocol name from the selected device via parameter and then from there I want to get names and table ids as shown above related so that I can show it later in my application it will be helpful.
So from my Low code App as in above pic, once I click on that small gear I have protocol name, so from there I want to get all table ids and protocol related information as shown on top in my automation script in c#. There is no Dummy req. as I will get protocol info from clicking that row in table.
Showing list of resource types description and also for further functionality will be having table ids as well in order to get the further information for resources via GetTableDisplayKeys for the element selected. So, currently these are hardcoded but want them get the information automatically from Protocol.
With the following call, you can get a full definition of the protocol. This allows you to collect all table information.
var protocolInfo = engine.GetProtocolInfo(protocolName)Method not available.
var protocolInfo = engine.GetUserConnection().GetProtocol(protocolName)
You can find the table parameters by looking for the correct parameter under the following property by either the table ID...
var tableParamInfoById = protocolInfo.Parameters.FirstOrDefault(param => param.ID == requestedTableId)
...or the name of the table
var tableParamInfoByDescription = protocolInfo.Parameters.FirstOrDefault(param => param.Description == requestedTableName)
Once you have the correct table parameter you can get all related column with
var columnParameters = tableParamInfo.TableColumnDefinitions;
This will allow you to find the parameter ID of each column, which you can then use again to find each param under protocolInfo.Parameters, in case you need additional info for that parameter, such as the description.
NOTE: Retrieving the protocol information is a big request on the system, so it is not advised to repeatedly do this. In case the automation script you mentioned will be executed very frequently, I would advise to implement additional caching to save previous results, instead of requesting it each time, otherwise performance issues might occur.
Caching can be done by using a static class, using a lock to avoid issues.
internal static class ProtocolInfoCache
private static readonly IDictionary<string, GetProtocolInfoResponseMessage> Cache = new ConcurrentDictionary<string, GetProtocolInfoResponseMessage>();
private static readonly object CacheLock = new object();
public static GetProtocolInfoResponseMessage GetCacheProtocol(IEngine engine, string name, string version)
string cacheKey = GetCacheKey(name, version);
return GetProtocolInfoFromDataMiner(engine, name, version);
private static string GetCacheKey(string name, string version)
return String.Join(".", name, version);
private static GetProtocolInfoResponseMessage GetProtocolInfoFromDataMiner(IEngine engine, string name, string version)
GetProtocolInfoResponseMessage response = engine.GetUserConnection().GetProtocol(name, version);
Cache.Add(new KeyValuePair<string, GetProtocolInfoResponseMessage>(GetCacheKey(name, version), response));
If you are intending to retrieve data from a table in a specific element, you could consider using the following methods, Method GetTableKeyMappings | DataMiner Docs together with Method GetTablePrimaryKeys | DataMiner Docs, to do so. Otherwise, if you are working with automation script dummies, you could also take a look at Class ScriptDummy | DataMiner Docs. I hope this is helpful.