I have a list of elements for which i want to find Pid. Lets say I have titanedge decoder-1 element, i want to get its PID.
I’m attempting to create a service in dataminer through automation scripts. For that Im forming a parameters that are necessary to create service. I need parameter id and filter, primary key. I have got the filter and primary key retrieved. Now i want to get parameter Id of my decoder-1 element.
Im trying element.FindParameterID() by passing primary key value. Im getting a value -1
hi Baranisudha.
The FindParameterID is a function which you can use to find the parameter ID linked to a name of the parameter yo provide as a function parameter.
Can you provide the code that you try to execute that goes over the elements to retrieve this data?
Here I retrieve elements using device IP.
———————————————
dms.Notify(type/*DMS_GET_ELEMENT_ID_FROM_IP*/ , subType, ipBus, null, out var result);
engine.GenerateInformation(“result = ” + result);
if (result != null)
{
globalElementID = (string)result;
ids = globalElementID.Split(‘;’);
foreach (var id in ids)
{
var aux = id.Split(‘/’);
engine.GenerateInformation(“DMA ID = ” + aux[0]);
var dmaId = Convert.ToInt32(aux[0]);
engine.GenerateInformation(“Element ID = ” + aux[1]);
var elementId = Convert.ToInt32(aux[1]);
var element = engine.FindElement(dmaId, elementId);
engine.GenerateInformation(“ELEMENT = ” + element);
elements.Add(element);
}
}
Here I’m getting the primarykey if using above code for titan edge decoder
——————————————————————————-
var filter = elements.Select(x => x.GetParameter(“ID [IDX] (” + device.resourceType + ” Overview)”,
device.resourceType + “-” + device.resourceId)).Distinct();
Now im trying to get PID for decoder-1, which is basically 1101. i can see the value in dataminer but i want to fetch the id through the element I have
Hi Baranisudha,
One element does not correspond with one PID, since elements usually have many parameters. You therefore need to know which parameters exactly you want to retrieve in order to include those in a service, but this information is missing in your question. Do you know the name of the parameter you want to include? In that case you could use FindParameterID to find the ID based on the parameter name, as Jeroen suggested above.
Or is it in fact the element ID you are trying to retrieve, rather than the parameter ID?
As this question has now been inactive for a very long time, and there has been no further reaction from you, I will close it. If you still want more information about this, could you post a new question?
Hi Baranisudha,
Can you please clarify what you need?
Are you referring to ParameterID with PID?
Do you want all PIDs or just a specific one?