Ejemplo n.º 1
0
        private void ReadAV_Click(object sender, EventArgs e)
        {
            ResultLabel.Text = "Bezig met lezen...";
            bool result = false;

            BACnet.Device bacnetDevice = bacnet.GetDevice(Convert.ToInt32(nmGetDevice.Value));
            //BACnet.Device bacnetDevice = new BACnet.Device("192.168.14.221", 47808); // Priva, Virtual Network
            if (bacnetDevice != null)
            {
                DeviceLabel.Text = "Device: " + bacnetDevice.ToString();
            }
            BACnet.PropertyValue propertyValue = new BACnet.PropertyValue(BACnet.ObjectType.AnalogValue, 2);
            result           = bacnet.ReadPropertyValue(bacnetDevice, ref propertyValue);
            ResultLabel.Text = "Resultaat: " + (result ? "Success, " + propertyValue.ToString() : "Failure");
        }
Ejemplo n.º 2
0
        private void WriteBV_Click(object sender, EventArgs e)
        {
            ResultLabel.Text = "Bezig met schrijven...";
            bool result = false;

            BACnet.Device bacnetDevice = bacnet.GetDevice(Convert.ToInt32(nmGetDevice.Value));
            //BACnet.Device bacnetDevice = new BACnet.Device("192.168.14.221", 47808, 99999); // Priva, Virtual Network
            if (bacnetDevice != null)
            {
                DeviceLabel.Text = "Device: " + bacnetDevice.ToString();
            }
            BACnet.PropertyValue propertyValue = new BACnet.PropertyValue(BACnet.ObjectType.BinaryValue, 9, true);
            result           = bacnet.WritePropertyValue(bacnetDevice, propertyValue);
            ResultLabel.Text = "Resultaat: " + (result ? "Success, " + propertyValue.ToString() : "Failure");
        }
Ejemplo n.º 3
0
        private void WriteAV_Click(object sender, EventArgs e)
        {
            ResultLabel.Text = "Bezig met schrijven...";
            bool result     = true;
            int  writeCount = 20;

            BACnet.Device bacnetDevice = bacnet.GetDevice(Convert.ToInt32(nmGetDevice.Value));
            //BACnet.Device bacnetDevice = new BACnet.Device("192.168.14.221", 47808); // Priva, Virtual Network
            if (bacnetDevice != null)
            {
                DeviceLabel.Text = "Device: " + bacnetDevice.ToString();
            }
            BACnet.PropertyValue propertyValue = new BACnet.PropertyValue(BACnet.ObjectType.AnalogValue, 2, DateTime.Now.Second);
            for (int i = 0; i < writeCount; i++)
            {
                result &= bacnet.WritePropertyValue(bacnetDevice, propertyValue);
            }
            ResultLabel.Text = "Resultaat (" + writeCount.ToString() + "): " + (result ? "Success, " + propertyValue.ToString() : "Failure");
        }