Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 6.6.2 c++ opc ua custom structure
Forum Updated to NodeBB v4.3 + New Features

Qt 6.6.2 c++ opc ua custom structure

Scheduled Pinned Locked Moved Solved General and Desktop
29 Posts 3 Posters 3.0k Views 2 Watching
  • 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.
  • TheCipo76T TheCipo76

    @sbela

    Hex "6915640ba6fada010100000003000000434e430b00000043757474696e67506c616e030200000069740c0000005461676c6961207069616e6f"

    Cattura30.JPG

    i can't understand why some bytes can converted and others give unreadable result

    id ���������CNC ���CuttingPlan���it ���Taglia piano

    any ideas?

    sbelaS Offline
    sbelaS Offline
    sbela
    wrote on last edited by
    #18

    @TheCipo76 do you mean things like this '�' ?
    It is because it is not a character code.
    From the last post as I see the Hex output those bytes which I can not reverse engineer it does not changed. But the content is also the same so it might be that is the problem. Can you post Hex output with different content ?
    The open62541 have DateTime conversion routines, did you try any of those ?

    I would like!

    TheCipo76T 1 Reply Last reply
    0
    • sbelaS sbela

      @TheCipo76 do you mean things like this '�' ?
      It is because it is not a character code.
      From the last post as I see the Hex output those bytes which I can not reverse engineer it does not changed. But the content is also the same so it might be that is the problem. Can you post Hex output with different content ?
      The open62541 have DateTime conversion routines, did you try any of those ?

      TheCipo76T Offline
      TheCipo76T Offline
      TheCipo76
      wrote on last edited by TheCipo76
      #19

      @sbela my goal is to check when machine is working and when not working..
      the info i've posted is normal operativity

      i haven't find any DateTime conversion routines in the documentation
      can you show me where do you see about this routines?

      the documentation tell that encoding type is ByteString but if Server mix different type of data how i can separate and decode it
      without any other information (i.e. length..)? I think this is the real question..

      Christian EhrlicherC 1 Reply Last reply
      0
      • TheCipo76T TheCipo76

        @sbela my goal is to check when machine is working and when not working..
        the info i've posted is normal operativity

        i haven't find any DateTime conversion routines in the documentation
        can you show me where do you see about this routines?

        the documentation tell that encoding type is ByteString but if Server mix different type of data how i can separate and decode it
        without any other information (i.e. length..)? I think this is the real question..

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #20

        @TheCipo76 said in Qt 6.6.2 c++ opc ua custom structure:

        decode it
        without any other information (i.e. length..)?

        You have to know the datatype. The length is there as you can see it.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        TheCipo76T 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @TheCipo76 said in Qt 6.6.2 c++ opc ua custom structure:

          decode it
          without any other information (i.e. length..)?

          You have to know the datatype. The length is there as you can see it.

          TheCipo76T Offline
          TheCipo76T Offline
          TheCipo76
          wrote on last edited by TheCipo76
          #21

          @Christian-Ehrlicher as you see in the first image i've posted i know the datatype..
          i've created a struct where i have to store the data.. (MessageInfo)

          when i print (with qDebug) received data as you see upper .. i'm not able to retrieve the information that i'm expect

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #22

            @sbela showed you the hex output and the interpretation where you can clearly see that there are 4 bytes with a length information for the following characters.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            1
            • TheCipo76T Offline
              TheCipo76T Offline
              TheCipo76
              wrote on last edited by
              #23

              First 16 byte -> TimeStamp
              next 8 byte -> MessageLevel (can be 1, 2 or 3 from Enumeration Type)
              next 8 byte -> MessageSource Length
              next (MessageSource Lenght * 2) byte -> MessageSource
              ...
              i've understand correctly??

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #24

                Don't know why you want to multiply it by two but do whatever you want.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                TheCipo76T 1 Reply Last reply
                0
                • Christian EhrlicherC Christian Ehrlicher

                  Don't know why you want to multiply it by two but do whatever you want.

                  TheCipo76T Offline
                  TheCipo76T Offline
                  TheCipo76
                  wrote on last edited by
                  #25

                  @Christian-Ehrlicher Sorry..

                  First 16 characters-> TimeStamp
                  next 8 characters-> MessageLevel (can be 1, 2 or 3 from Enumeration Type)
                  next 8 characters-> MessageSource Length
                  next (MessageSource Lenght * 2) characters-> MessageSource
                  ...

                  @sbela said in Qt 6.6.2 c++ opc ua custom structure:

                  two hex number is one byte (eg. CNC = 43 4e 43 )

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by Christian Ehrlicher
                    #26

                    These are hex numbers representing bytes, not characters...

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    0
                    • sbelaS sbela

                      @TheCipo76
                      I did not mean this. Sorry for my english.
                      I mean that needs multiple different input data with their respective output bytes to determine what is it used for the 01000000 after the date and the 03 between the text and the 02000000 and of course to decode the date format (is it milliseconds since when, or is it nanoseconds since 1600 as the standard describes and so on...) .

                      7203811f7ef7da01 01000000 03000000 434e43 0b000000 43757474696e67506c616e 03 02000000 6974 0c000000 5461676c6961207069616e6f
                       (timestamp LE?)            (3)     C N C   (11)    C u t t i n g P l a n      (2)     i t   (12)    T a g l i aSP p i a n o
                      
                      TheCipo76T Offline
                      TheCipo76T Offline
                      TheCipo76
                      wrote on last edited by TheCipo76
                      #27

                      @sbela said in Qt 6.6.2 c++ opc ua custom structure:

                      000 03000000 434e43 0b000000 43757474696e67506c616e 03 02000000 6974 0c000000 5461676c6961207069616e6f
                      (timestamp LE?) (3) C N C (11) C u t t i n g P l a n (2) i t (12) T a g l i aSP p i a n o

                      Can be something like:
                      7203811f7ef7da01 (timestamp)
                      01000000 (MessageLevel ->1) (convert to decimal and then to int and obtain 1)
                      03000000 (MessageSource Length ->3) (convert to decimal and then to int and obtain 3)
                      434e43 ("CNC")
                      0b000000 (MessageName Length ->11) (convert to decimal bit and then to int and obtain 11)
                      43757474696e67506c616e ("CuttingPlan")
                      03 ( i don't know what is this ???)
                      02000000 ("it" Lenght)
                      6974 ("it")
                      0c000000 (MessageText Length ->12) (convert todecimal and then to int and obtain 12)
                      5461676c6961207069616e6f ("Taglia Piano")

                      1 Reply Last reply
                      0
                      • Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on last edited by
                        #28

                        You really should learn basic programming stuff - I this case what a hexadecimal number is...

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        TheCipo76T 1 Reply Last reply
                        0
                        • Christian EhrlicherC Christian Ehrlicher

                          You really should learn basic programming stuff - I this case what a hexadecimal number is...

                          TheCipo76T Offline
                          TheCipo76T Offline
                          TheCipo76
                          wrote on last edited by TheCipo76
                          #29

                          @Christian-Ehrlicher You are certainly right

                          Thanks for the help you are giving me
                          I'm learning a lot

                          1 Reply Last reply
                          0
                          • TheCipo76T TheCipo76 has marked this topic as solved on

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved