Exemple #1
0
        private bool DioInit(string deviceName, out short dioId, out string returnCode)
        {
            // Initialization handling
            int Ret = dio.Init(deviceName, out dioId);

            string ErrorString;

            dio.GetErrorString(Ret, out ErrorString);
            returnCode = "Ret = " + System.Convert.ToString(Ret) + " : " + ErrorString;
            Console.WriteLine(returnCode);
            if (Ret != (int)CdioConst.DIO_ERR_SUCCESS)
            {
                return(false);
            }
            return(true);
        }
Exemple #2
0
        public string InitDio()
        {
            string ErrorString;

            dio.GetErrorString(Ret, out ErrorString);
            if (Ret != 0)
            {
                return(ErrorString);
            }
            else
            {
                writeBit(0, 0);
                writeBit(1, 0);
                writeBit(2, 0);
                writeBit(3, 0);
                writeBit(4, 0);
                writeBit(5, 0);
                writeBit(6, 0);
                return("Success");
            }
        }