Home Forums Support create a server to communicate with the hardware.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2927
    Anonymous
    Inactive

    I need to create a server to communicate with the hardware.

    Most use a byte array hardware and communication

    Determine the value of one byte of the incoming byte array, and
    If you receive a specific byte, immediately to the client without delay
    And transmits a response.

    So

    Allowing access of the client connected to the server, and
    Being the first value, whether or not the start of the data whose value is determined
    From beginning to end, the data received and
    Comes a measure of the end of the process the value.

    1) How to return an array that is received?

    2) how to ensure that I received the termination value

    3)Determine the total length receives a specific byte, and
    A method for receiving by the length and return.

    #2928
    Anonymous
    Inactive

    Dear Sung Yeol Yang,

    I recommend you view the UnmanagedConnectionExample.cs example included in the ExamplesConsole project of your download. This demonstrates how to achieve the features you are looking for help with.

    Kind regards,
    Marc

    #2953
    Anonymous
    Inactive

    I was successful
    Receiving array
    but…

    I must begin with & h02, and received a packet that ends with &h03(HEX value).

    In my “AppendGlobalIncomingUnmanagedPacketHandler ”
    and it occurred to me, when the event is received &h03 (hex value)

    How can I get an event is received &h03 this?

    #2954
    Anonymous
    Inactive

    You need to convert the incoming byte array into a hex string. You could use a function like this:

    public static string ByteArrayToString(byte[] ba)
    {
      string hex = BitConverter.ToString(ba);
      return hex.Replace("-","");
    }

    And then check to see if the incoming bytes match what you are looking for.

    Regards,
    Marc

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.