Connect with VMB1RS through a serial cabel with .NET library

Hello,

Can someone explain me these results.
What I do: I am connected with the module through a serial kabel (which is a piece connected to the module which at his turn transmits the data.
I am receiving data, but I think I do not get the responses I supposed to have:

First I connect to the address:
Packet packet = new Packet();
packet.Priority = PacketPriority.Low;
packet.Rtr = true;
packet.Address = (byte)Convert.ToInt32(this.comboBoxAdres.Text);
serialBus.Send(packet);

Then I listen for any packets coming in:
if (args.Packet.DataSize != 0)
{
this.listBoxResultaat.Items.Add("Command: " + Convert.ToString(args.Packet.Command) + " - " + Convert.ToString(args.Packet.Address) + " - " + Convert.ToString(args.Packet.Size));
for (int i = 0; i < args.Packet.DataSize; i++)
{
inhoud = args.Packet
;
this.listBoxResultaat.Items.Add("Byte " + Convert.ToString(i) + ": " + args.Packet*.ToString(“X2”));
}
}**

The result when the machine stops:
Packet 1: DataSize is 4 with this value in each byte: 0 0 1 0
Packet 2: DataSize is 4 with this value in each byte: 0 1 0 0

According to manual I should receive a hex value off x0x09

Is there something wrong with my code, or is it in someway not correct connected with the module.

Kind regards*

We will need to know what module is sending this packet

Hello,

The module is: VMB1RS
But I already figured out the results (thank you anyway).
0 1 0 0 --> button pressed
0 0 1 0 --> button released

Kind regards

That is not the VMB1RS sending, it is probably a VMB8PB?

Module is VMB6IN

If it is:

Download the protocol manual for the VMB8PB:
velleman.eu/downloads/0/velb … vmb8pb.pdf

Turn to page 3: Transmits the push button status

Data byte 1 = 00 = COMMAND_PUSH_BUTTON_STATUS
Data byte 2 = Push buttons just pressed
Data byte 3 = Push buttons just released
Data byte 4 = Push buttons long pressed

For example:

Data byte 1 = 00 (hex) = COMMAND_PUSH_BUTTON_STATUS
Data byte 2 = 01 (hex) = 0000 0100 (binary) = button 3 was pressed
Data byte 3 = 00 (hex)
Data byte 4 = 00 (hex)

The packet is the same for the VMB6IN

Also on page 3 of the VMB6IN protocol manual: Transmits the input status
velleman.eu/downloads/0/velb … vmb6in.pdf

Thans for the reply.
Now i know when the button on the machine is pressed, but is it possible to know if the machine is starting or stoping?

Kind regards

You will need to describe your setup more accurately, what modules you use, how everything is connected, etc.

Each Velbus module sends out its own status. The relay modules like VMB1RY and VMB4RY for example send out a status that indicates which relays are on or off; temperature modules send out temperature changes; … So it is perfectly possible to know the current state of each module.