Forum Discussion

rancan's avatar
rancan
Occasional Contributor
5 years ago

Serial Port Communication

Hi,   I am trying to create a connection with port com, and I am using JavaScript. The goal is to send the HEX sequence and read the HEX back from the port.  I copied from this page https://suppo...
  • AlexKaras's avatar
    5 years ago

    Hi,

     

    The goal is to send the HEX sequence

    > Port.Write("1A030688");

    The above .Write() call does not write expected hex sequence, but writes the ASCII string (with relevant hex codes), which is not correct as I think.

    Try to prefix every hex with \x prefix (like in the article you've referenced) and check if it helps. I.e.:

    Port.Write("\x1A");

    Port.Write("\x03");

    Port.Write("\x06");

    Port.Write("\x88");