2 Replies Latest reply on Jun 29, 2017 11:23 PM by andreas.boehler_2378171

    EZ-Serial: Set Device Name in Binary Mode

    andreas.boehler_2378171

      Hi,

         

      I'm using EZ-Serial in binary mode and I'm unable to set the Device Name (it works flawlessly in Text Mode using "SDN,N=TEST"). My packet looks like this:

         

      0xc0 0x04 0x04 0x0f 'T' 'E' 'S' 'T'

         

      and, of course, the checksum. What am I doing wrong here?

         

      Thanks,

         

      Andreas

        • 1. Re: EZ-Serial: Set Device Name in Binary Mode
          jrow

          Hi Andreas,

             

          Your format is close, but it is missing the preceding "length" byte required on all uint8a arguments. In addition to the overall payload length value in the binary packet header, variable-length arguments require an additional argument-specific length value. To supply the four-byte string "TEST", you would actually need the following five-byte value:

             

          0x04 'T' 'E' 'S' 'T'

             

          Or, the whole binary packet including checksum in simple hex:

             

          C0 05 04 0F 04 54 45 53 54 B5

             

          Note that the payload length in the header has increased from 0x04 to 0x05 as well, since we added a byte to the payload.

             

          For details on this preceding length requirement (and a similar two-byte length value required on longuint8a/longstring arguments), review the "API Protocol Data Types" table in Section 7.1.2 of the EZ-Serial User Guide.

             

          Jeff

          • 2. Re: EZ-Serial: Set Device Name in Binary Mode
            andreas.boehler_2378171

            Thanks for your help, I completely overlooked that section of the Manual!