REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    TCP socket : parsing NMEA string

    REXYGEN Studio
    4
    6
    530
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Scoobsalamander
      last edited by

      I'm trying out the server TCP example to connect to a MOXA Nport device which provides me a serial string (NMEA) over TCP.

      Is there an easy way to parse these bytes which I receive now in the buffer (ASCII).

      I did already a work around in Node-red which is working fine but I think it should be possible by using the REXLANG FB.

      Any tips and or examples?

      thx & grtz,

      Kris

      S 1 Reply Last reply Reply Quote 0
      • S
        Scoobsalamander @Scoobsalamander
        last edited by

        FYI : this is the string on one of the outputs of the REXLANG FB now.

        $PRRFAZT,1,0,1.4,0,40.1,0,0,-0.6,100,27.1,2.5,1,0,0,0,0,65535,*

        This data I would like to parse inside the REXLANG FB and assign it to the outputs of the FB.

        1 Reply Last reply Reply Quote 0
        • cechuratC
          cechurat
          last edited by

          Hi Kris,

          there are no special function blocks to parse comma separated string. However I can imagine simple loop written in REXLANG FB which will do following:

          1. find position of "," - long strfind(str,substr)
          2. create substring from beginning to the position of "," and assign it to the i-th output - string strsub(str,idx,len)
          3. create substring of original string starting at position of "," - string strsub(str,idx,len)
          4. repeat until you reach the end of the original string

          If you know exact data frame you can also convert the values.

          If need any help, let me know.

          Kind regards,
          Tomas

          S 1 Reply Last reply Reply Quote 0
          • S
            Scoobsalamander @cechurat
            last edited by

            Thanks for the info .... I'll give it a try one of these days. I'll post the solution... at least if I am able to solve it..... 🙂

            1 Reply Last reply Reply Quote 0
            • Z
              ZacharyHowie Banned
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • D
                DavidBotello Banned
                last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

                There is also an outdated REXYGEN community forum.

                Powered by NodeBB.