Dear,
I know this function to get parameter inside Qaction C#:
Example:
string s_city = Convert.ToString(protocol.GetParameter(50));
But how can I retreive the IP and Port/Bus in C# property of an element?
Regards Cedric Buerfent
Hi Cedric,
You can achieve this by defining 2 parameters in your XML
- One of the type bus
- A second with the type ip or pollingip (you can choose one or the other option, depending on whether you are also interested in the port or not)
Then those parameters behave as normal ones, and you should be able to follow the same as you already have for your example with parameter 50 to fetch them.
Hi Cedric,
I think you should be able to achieve this by defining a parameter of type "bus" and "port". More information can be found here. DataMiner will automatically populate those parameters with the corresponding values.
From your QAction, you can then simply retrieve those values by reading the parameters you defined. This way, you can access the bus or port information directly without needing additional logic.
Hope this helps.
Kind regards,