Hi, I have to send three bytes via UDP to control plc:
This is a 3 byte command:
The first byte is the command, 32 (active means on) or 33 (inactive).
Second byte is the relay number (1-8).
Third byte is the on time. Set this to zero for un-timed operation, or 1-255 for a pulse in 100mS intervals (100mS to 25.5 seconds).
For example: 0x20 - turn the relay on command
0x03 - relay 3
0x32 (50) - 5 seconds (50 * 100ms)
Board will return 0 for success, 1 for failure
Note - All bytes in a command must be sent in one TCP/IP packet .
How can I do?
This is not working .
Dim Packet As UDPPacket
Dim data() As Byte
Dim bc As ByteConverter
Dim pack() As Byte = bc.HexToBytes("210332")
Packet.Initialize(pack, "192.168.1.50", 17494)
UDPSocket1.Send(Packet)
Thanks
This is a 3 byte command:
The first byte is the command, 32 (active means on) or 33 (inactive).
Second byte is the relay number (1-8).
Third byte is the on time. Set this to zero for un-timed operation, or 1-255 for a pulse in 100mS intervals (100mS to 25.5 seconds).
For example: 0x20 - turn the relay on command
0x03 - relay 3
0x32 (50) - 5 seconds (50 * 100ms)
Board will return 0 for success, 1 for failure
Note - All bytes in a command must be sent in one TCP/IP packet .
How can I do?
This is not working .
Dim Packet As UDPPacket
Dim data() As Byte
Dim bc As ByteConverter
Dim pack() As Byte = bc.HexToBytes("210332")
Packet.Initialize(pack, "192.168.1.50", 17494)
UDPSocket1.Send(Packet)
Thanks