Exemple #1
0
        /// <summary>
        ///  mDOSetOutput_class constructor
        /// </summary>
        public mDOSetOutput_class(int oportNum, int oportStatus)
        {
            string        sTemp;
            ASCIIEncoding encoding = new ASCIIEncoding();

            _type              = CommandType.mDOSetOutput;
            _data              = new mDOSetOutput();
            _data.stx          = 0x02;
            sTemp              = "sMN ";
            _data.type         = encoding.GetBytes(sTemp);
            sTemp              = "mDOSetOutput ";
            _data.cmd          = encoding.GetBytes(sTemp);
            _data.outputNumber = (byte)(oportNum + 0x30);
            _data.sp1          = 0x20;
            _data.outputState  = (byte)(oportStatus + 0x30);
            _data.etx          = 0x03;
        }
Exemple #2
0
 /// <summary>
 ///  mDOSetOutput_class constructor
 /// </summary>      
 public mDOSetOutput_class(int oportNum, int oportStatus)
 {
     string sTemp;
     ASCIIEncoding encoding = new ASCIIEncoding();
     _type = CommandType.mDOSetOutput;
     _data = new mDOSetOutput();
     _data.stx = 0x02;
     sTemp = "sMN ";
     _data.type = encoding.GetBytes(sTemp);
     sTemp = "mDOSetOutput ";
     _data.cmd = encoding.GetBytes(sTemp);
     _data.outputNumber = (byte)(oportNum + 0x30);
     _data.sp1 = 0x20;
     _data.outputState = (byte)(oportStatus + 0x30);
     _data.etx = 0x03;
 }