I have an automation that is parsing data from an alarm which needs to write parameters on a dynamic table. Once the parameter is written, the table contains an Update button that needs to be clicked in order to write to the fields.
So far I've figured out how to update the fields via C# but I'm having no luck on the "update" button portion and looking for some assistance.
/snip from the driver
<Param id="2963" trending="false">
<Name>TallyLayoutsTextTilesUpdate</Name>
<Description>Update (Tally Layouts Text Tiles)</Description>
<Type>write</Type>
<Information>
<Subtext>Sends the configuration to the device and unlocks the current row for updates.</Subtext>
</Information>
<Message>Are you sure you want to update the text box?</Message>
<Interprete>
<RawType>numeric text</RawType>
<Type>double</Type>
<LengthType>next param</LengthType>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
</Display>
<Measurement>
<Type width="110">button</Type>
<Discreets>
<Discreet>
<Display>Update</Display>
<Value>1</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>
snip/
C# code I'm using
elementTAG.SetParameterByPrimaryKey(2963, "799e8c67-af15-4261-9606-36da33c01410/OTV-4K/34/INGSVR", 1);
I was told that since it uses Discreets, we'd need to enter 1 for the button click but this does not work. From the above code, 2963 is the param ID and 799e8c67-af15-4261-9606-36da33c01410/OTV-4K/34/INGSVR is the table row IDX.
The code to set the parameter works fine, so I assumed that the I would do it the same way but I'm a bit stuck now.
elementTAG.SetParameterByPrimaryKey(2807, "799e8c67-af15-4261-9606-36da33c01410/OTV-4K/34/INGSVR", "testing");
Any assistance on figuring out how to click the update button would be much appreciated. Along with that, we'd need to suppress the message dialogue that asks "are you sure you want to update"
Disclaimer: I do not know C#. I'm about 2 weeks into trying to learn it so this is all new to me. If anyone has any recommend training, books, videos, I'd love to hear them. Thanks!
-Jeff
Hi Jeff,
It seems that you are using the displaykey in method that receive a primary key, can you use elementTAG.SetParameter instead?
Can you check if that button is correctly included in a table and if that table has that display key?
Sooooo, this was partially a user issue and attention to detail.
1. The above clip from the driver TallyLayoutsTextTilesUpdate. This is the wrong table. I should have been looking at TallyLayoutsChannelTilesUpdate which has param id 2819. Once I started digging deeper into the driver tables I noticed this.
2. elementTAG.SetParameterByPrimaryKey() was also incorrect. I needed to be using elementTAG.SetParameter() as you mentioned.
Once I got the correct param id and used the correct method it’s working now.
Now when parsing the alarm data I’m successfully passing the correct variable to the parameter and it’s updating as expected. Thanks for pointing me in the right direction. Much appreciated.
Your welcome
I did try that a few minutes after posting this but it also failed. When testing the automation I’m getting the following error:
The following was returned from the script:
Set Parameter 167726/146/2963/799e8c67-af15-4261-9606-36da33c01410/OTV-4K/34/INGSVR failed (Invalid data.: 0x80040221)
(Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Set Parameter (‘_167726_146’:2963/799e8c67-af15-4261-9606-36da33c01410/OTV-4K/34/INGSVR) Failed: 0x80004005
at CManagedAutomation.RunWrapped(CManagedAutomation* , Int32 iCookie, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* pvarReturn, String scriptName)
at CManagedAutomation.Run(CManagedAutomation* , Int32 iCookie, Char* bstrScriptName, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* varEntryPoint, tagVARIANT* pvarReturn, tagVARIANT* pvarEntryPointResult) (CSharp; 0x80131500h):
And here is the code I’m using:
elementTAG.SetParameter(2963, “799e8c67-af15-4261-9606-36da33c01410/OTV-4K/34/INGSVR”, 1);