I can’t seem to get the syntax correct for updating the ‘Comment’ field in AlarmCommandClient.UpdateAlarmValues. I am using keyvaluepair and setting the value of ‘Comment’ but the c# syntax is not correct. Has anyone used this call?
I think I got it. The keyvaluepair is an array. I think it is something like this:
KeyValuePair<string, string>[] kvps = {
new KeyValuePair<string,string >( “Comment”, “Test” ) };
ia2.UpdateAlarmValues(alarm_ID, kvps);
I seem to have the syntax correct but I can’t seem to update the ‘Comment’ field. It seems like I need to use ‘AlarmCommandClient’ but I can’t find any good document on its use. I have been able to update fields such as ‘priority’ using ‘AlarmClientManager’. Any assistance/direction would be great.
You are right that you need to use the AlarmCommandClient. The documentation could surely be better, but you can see how to use it in the AlarmList protocol sample (it is using its own pretty old auto-generated version, but if you remove it from the sample it will run with the one found in the SDK).
I just tried updating the Comment using the method UpdateAlarmValues in the exact same way as you did, and it works fine - at least on my system. Please be aware that “Comment” is actually the Activities list in the Smart Client alarm viewer, which I guess can be quite confusing.
Thank you Peter. I will take a look and update this post later