Hello im programing an interface in C# to comand my velbus installation with a touch screen. To change the status of the relay there is no problem, i use for every comand a button so i have a button to set the relay and one to reset the relay, but now i want that the button’s also show the status of the relay.
Ex: If the relay is active, Only the OFF button can be used
If the relay is inactive, Only the ON button can be pressed
So i can control the state off the relay.
To disabel the button I use the command
btnSend1off.Enabled = false;
Can sombody give me a code example to see the state of relay 1 of VMB4RY with adres A0
Hello,
Thanks for the reaction, my problem on this stage is that i c’ant find the methode to listen to the serial port , so i can get the information that is recive on the velbus.
this is wath i get
[code]bus.Open();
// Prepare a packet that will switch on the relays
// of a VMB4RY module (see: p.17 of the VMB4RY manual)
Packet packet = new Packet();
packet.Address = 0x0A; // change this address to reflect your setup
packet.Priority = PacketPriority.High; // high priority command
packet.DataSize = 2; // 2 data bytes
packet.Command = 0x02; // Command "Switch relay ON"
packet[1] = 0x04; // We want to switch on relay3
// Issue the command!
bus.SendBlocking(packet);
bus.Send(packet);
packet.Address = 0x0A; // change this address to reflect your setup
packet.Priority = PacketPriority.Low; // LOW priority command
packet.DataSize = 8; // 8 data bytes
packet.Command = 0xFB ; // GET STATUS"
packet[1] = 0x08;
// Issue the command!
bus.SendBlocking(packet);
// Be sure to close the bus so everything
// can be cleaned up properly */
bus.Close();[/code]
can anybody give me a code or a methode to get the data of the serial connection.