/** * topicID - unique ID of the cell in the Excel * RTDparms - must have at least one parameter * getNewValues - used by the Excel, no need change */ public object ConnectData(int topicID, ref Array RTDparms, ref bool getNewValues) { // Registering for notifications on status "done" HelloMsg notifyTemplate = new HelloMsg(); notifyTemplate.STATUS = "done"; _eventReg = _proxy.DefaultDataEventSession.AddListener <HelloMsg>(notifyTemplate, Space_DataChanged); //store the cell this RTD is written in _topicID = topicID; return "This cell is listening for msg with status 'done' ..."; }
public String SetToDone(int id) { String output; HelloMsg theMsg = new HelloMsg(); theMsg.ID = id; theMsg.STATUS = "done"; try { _proxy.Update<HelloMsg>(theMsg, null, //no transactions long.MaxValue, 0, //lease and write timeouts UpdateModifiers.PartialUpdate); output = "setting Messgae ID " + id + " to done..."; } catch (Exception e) { output = e.Message; } return output; }
public String AddMsg(int id, string msg) { String output; HelloMsg theMsg = new HelloMsg(); theMsg.ID = id; theMsg.MSG = msg; theMsg.STATUS = "working"; try { _proxy.Update<HelloMsg>(theMsg, null, //no transactions long.MaxValue, 0, //lease and write timeouts UpdateModifiers.UpdateOrWrite); output = "["+ theMsg.ToString() + "] was written to the space"; } catch (Exception e) { output = e.Message; } return output; }