Now, I turned on the stick option and it still got the same error. i have showned below my code snippet that causes the error that i stated earlier.
SendLocalRUPpacket(CByte(TextBox13.Text), CLng(NumericUpDown2.Value), CUInt(TextBox14.Text), 0, Chr(CInt(NumericUpDown1.Value & NumericUpDown4.Value)))
'Goes here
PublicFunction SendLocalRUPpacket(ByVal Group AsByte, ByVal Destination AsLong, ByVal Source AsUInteger, ByVal FunctionCode AsByte, ByVal Payload AsString) AsInteger
Dim IntRStatus AsInteger = 0
IntRStatus = SendPacketToWPG(CreateZCPPacket(Group, Destination, Source, 1, CreateRUPpacket(FunctionCode, Payload)))
Return IntRStatus
EndFunction
PublicFunction SendPacketToWPG(ByVal zcpPacket AsString) AsInteger
Dim Status AsInteger = 0
Dim SerialPacket AsString = ""
Dim FrameCodedZCPpacket AsString = ""
FrameCodedZCPpacket = EncodeZCPpacket(zcpPacket)
If zcpPacket.Length > 0 Then
SerialPacket = Chr(&H7E)
SerialPacket &= Chr(zcpPacket.Length) ' TODO: Vad händer om längden på zcpPacket = 0x7E?
SerialPacket &= FrameCodedZCPpacket
SerialPacket &= Chr(0) & Chr(0) & Chr(0) ' Sista siffran är enligt nya protokollet?? 2011.03.16, Japp (2011.05.07).
' Siffran 1 funkar vid utskick av MBZ-paket!! men ej för ping??
EndIf
Status = SendRawDataToWPG(SerialPacket)
Return Status
EndFunction
I am using the same functions for many other calls and working fine but not this "SendLocalRUPpacket()" call.