Exemple #1
0
        public uint ReadMoxaOutputAllBytes()
        {
            uint Read_Byte = 0;

            MXIO_Lib.E1K_DI_Reads(Output_Connection, 0, 16, ref Read_Byte);
            return(Read_Byte);
        }
Exemple #2
0
        public bool ReadMoxaOutput(int portNo)
        {
            uint Read_Byte = 0;

            MXIO_Lib.E1K_DO_Reads(Output_Connection, (byte)portNo, 1, ref Read_Byte);
            return(Read_Byte == 0 ? false : true);
        }
Exemple #3
0
        public void InitMoxaIO()
        {
            MXIO_Lib.MXEIO_Init();

            int result = MXIO_Lib.MXEIO_E1K_Connect(Encoding.UTF8.GetBytes(Input_IpAddress), PORT, TimeOut, out Input_Connection, Encoding.UTF8.GetBytes(Password));

            if (result != 0)
            {
                throw new Exception("Fail to connect with input card");
            }

            result = MXIO_Lib.MXEIO_E1K_Connect(Encoding.UTF8.GetBytes(Output_IpAddress), PORT, TimeOut, out Output_Connection, Encoding.UTF8.GetBytes(Password));
            if (result != 0)
            {
                throw new Exception("Fail to connect with Output card");
            }
        }
Exemple #4
0
 public void WriteMoxaOutput(int portNo, bool state)
 {
     MXIO_Lib.E1K_DO_Writes(Output_Connection, (byte)portNo, 1, Convert.ToUInt32(state));
 }