WFA_psychometric_chart.DeviceConnection.ScanForDevice C# (CSharp) Метод

ScanForDevice() публичный Метод

This function is used to scan bacnet devices connected
public ScanForDevice ( ) : List
Результат List
        public List<BacNode> ScanForDevice()
        {
            //List<BacNode> DevicesList = new List<BacNode>();

            try
            {
            BACnetClass.StartActivity();
                //Console.WriteLine("Started");

                Thread.Sleep(3000); // Wait a fiew time for WhoIs responses (managed in handler_OnIam)

            }
            catch { }

            return BACnetClass.DevicesList;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// function to take input of controller and variable name and id and scan the hardware values
        /// </summary>
        /// <param name="controllerInstanceID"></param>
        /// <param name="variableName"></param>
        /// <param name="variableNumber"></param>
        public double InputDeviceInfoAndValue(int controllerInstanceID, string variableName, int variableNumber)
        {
            /*
             * Task by this function :
             * 1. Filter which object to call.
             * 2. call a function and a value
             * 3.
             */

            string inputNameForYabee = "";

            if (variableName == "VAR")
            {
                // ANALOG_INPUT_VALUE
                inputNameForYabee = "OBJECT_ANALOG_VALUE";
            }
            else if (variableName == "IN")
            {
                // ANALOG_INPUT_INPUT
                inputNameForYabee = "OBJECT_ANALOG_INPUT";
            }
            else if (variableName == "OUT")
            {
                //variableName == OUT so for this we have
                inputNameForYabee = "OBJECT_ANALOG_OUTPUT";
            }
            double           valueFromDevice = 0;
            DeviceConnection db = new DeviceConnection();

            lock (db)
            {
                db.ScanForDevice();
                //==Now calling yabee for this values
                BACnetClass bc = new BACnetClass();
                valueFromDevice = bc.ReadSingleParameterUsigBacnetID(controllerInstanceID, inputNameForYabee, variableNumber);
                db.ScanForDevice();
            }
            //db.ScanForDevice();
            return(valueFromDevice);
        }
All Usage Examples Of WFA_psychometric_chart.DeviceConnection::ScanForDevice