Question Procedure call error

softhard

Active member
Joined
Sep 29, 2012
Messages
35
Programming Experience
Beginner
Hello,
I have many procedure which creates a total command for sending to my serial device. One of the procedure doesn't fired when the user try to send a command. Instead, I got an error which has showned below. Why i got this! it seems everything is fine with the procedure arguments and convertions.


Any help is appreciated.
 

Attachments

  • namnlös.JPG
    namnlös.JPG
    92 KB · Views: 28
First things first, turn Option Strict On and then fix any errors that occur. If you still have issues, you're going to need to show us the signature of the method you're calling and tell us what the actual data is that's being used. We don't know any of that so we can only guess at what the issue might be.
 
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.
 
Thank you for support and i got it right now. I am appending two integers instead of String and now it is working good.
 
Back
Top