Hi Dojo,
I will need to set value to column write parameter from automation script. In my case I have read/write column parameters and write parameter use snmpSetAndGet.
<Param id="504" trending="true"> --> Read column parameter
<Param id="505" snmpSetAndGet="row;executeNext"> --> Write column parameter
I will need to set 505 parameter from automation script but I didn't found any method that can do set on write parameter. Is there any solution for this case without creating more logic on protocol side which will do snmp set via QAction?
Hi Dario,
if I understand your situation correctly, you want to set one cell via the write parameter in an automation script?
if so, did you already checked the possibility via the following:
Element el = engine.FindElement( dmaId, elementId);
const int ReadParam = 504
const int WriteParam = 505;
el.SetParameterByPrimaryKey(el.GetWriteParameterIDFromRead(ReadParam, pk, value )
or
el.SetParameterByPrimaryKey(WriteParam, pk, value);
I would recommend to only use this solution if it is a single update, if you want to update multiple parameters or cells a better way to go is either via Interapp solution or via a single param that can contain for example a json with the values. That way the communication between automation script and the protocol is done with the absolute minimum interaction.


I tested this approach and it's possible to set write column parameter (and also trigger SNMP set on colum write parameter) from script.
element.SetParameterByPrimaryKey(element.GetWriteParameterIDFromRead(readColumnPid), pk, valueToSet);
Hi Dario,
In your automation script, you can create IDmsElement object. From that object, you can do following:
where element is of IDmsElement type, WriteParameterId is int and value is of type WriteParameterType.
Let me know if this helps 😀
____
Edit:
In case of table, you can do following:
T and parameterValue must be of same type

Thank you Rijad, this will work for standalone parameters. In my case, I need to set column write parameter and GetStandaloneParameter method will not work.

sorry, my bad.
I have updated main comment bc of picture delivery

No problem, I think SetValue() method will set only read cell parameter, not write. So, if we need to do action on write cell parameter (like SNMP set) it will not be sent to device itself.
Hi Thomas, you understood correct.
Element class contains only GetWriteParameterIDFromRead() method that takes one parameter (parameter id or parameter name) and it is related to standalone parameters.
I think it's even not possible to trigger write column parameter from QAction. So, if we need to trigger SNMP Set on column write parameter externally, only way to do it is via SNMP Set from QAction itself