protected SecsMessageBase GetSecsMessageInstance(byte stream, byte function, bool needReply) { Dictionary <byte, Type> dict; Type msgType; SecsMessageBase msg = null; if (m_RegisterCustomTypeDict.TryGetValue(stream, out dict) && dict.TryGetValue(function, out msgType)) { msg = (SecsMessageBase)Activator.CreateInstance(msgType); } else { msg = new SecsMessage(stream, function, needReply); } return(msg); }
/// <summary> /// S1F17R Request ON-LINE /// </summary> public void Request_ONLINE() { SecsMessage sm = new SecsMessage(1, 17, true); Send(sm); }