• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Decode api.cgi vars

    Scheduled Pinned Locked Moved Mervis
    3 Posts 2 Posters 2.4k Views
    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.
    • G
      Giamba
      last edited by

      Hi everybody,

      I'm developping my own web without HMI because I want to use Javascript/DOJO.
      Can you tell me how I can translate variables into readable values from api.cgi.
      eg. {"i": "svc://DefaultConnection/16[0,1]", "v": "00", "q": "good", "t": 636319187330000000},
      {"i": "svc://DefaultConnection/9178[0,4]", "v": "41B00000", "q": "good", "t": 636319187330000000}
      16 or 9178 in the "i" is the variable reference
      "q" is the quality I presume
      "t" is the timestamp
      but how to decode "v" in javascript

      Thanks in avance.

      T 1 Reply Last reply
      Reply Quote 0
      • T
        tomas_hora administrators @Giamba
        last edited by

        Hello @Giamba, I have put the file on our downloads site under SW-Mervis-Documentation-WebPanel-HMI-Fastcgi-dataexchangeformats.pdf

        Hope it helps

        1 Reply Last reply
        Reply Quote 0
        • G
          Giamba
          last edited by

          Hi, thanks for the job.
          I found functions in UserJS that do the job:

          • parseRealFromHex
          • parseIntFromHex
          • parseValueFromHash
            ...
            Now I have to find how to provide the type to decode in the right way.
            I have to look in html5_shark.xsl to modify it

          Thanks

          1 Reply Last reply
          Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post