Sending HEX msg to UDP/TCP

e:cue Forum Foren English Discussion Forums e:script Macro Language (E) Sending HEX msg to UDP/TCP

Ansicht von 4 Antwort-Themen
  • Autor
    Beiträge
    • #219108
      Zincooper
      Teilnehmer

      Hi
      i understand how to send msg in ASCII to the DriverGetHandle.

      but may I know how to send the hex value to UDP/TCP client?

      for example : FE 05 00 00 FF 00 98 35

      thank you very much.

    • #226568
      bkruse
      Teilnehmer

      Hi,
      please try attached example. It should be self-explanatory.

      Bests, Björn

    • #226569
      Zincooper
      Teilnehmer

      Hi Björn

      Sry that i should make it clear for you, I am trying to send a UDP msg to a modbus unit in RTU format.

      the command is “FE 05 00 08 FF 00 19 F7”

      and I modify the file you gave me, still not working.

      would you pls take a look ?

      thank you.

    • #226570
      bkruse
      Teilnehmer

      Hi,

      two ideas:
      First, in SendTo(…) command the length must be +1 (so 8+1 in your case).

      Second, it might be the modbus devic expects a CR or LF or both at the end to signal the end of the message? Then you need to add that (and extend the length of the message accordingly).

      There are small and simple tools out there that help to verify the local programming (for example SocketTest or Packet Sender). In case you want to try.

      Hope that helps,
      Björn

    • #226571
      Zincooper
      Teilnehmer

      Thank you, Björn !

Ansicht von 4 Antwort-Themen
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.