• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

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

    String to Bitfield

    Off-Topic Discussion
    4
    9
    2599
    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.
    • J
      janiv last edited by

      Hi there!

      I am struggling and trying to parse ASCII letter to bit field presentation. I am trying to use "Text Parser" actor with no luck.
      I have managed to parse text "!6DF8A1" and extract the 4th character. 
      But howto convert letter 'F' to bit field 1111b. Or a letter 'A' to bitfield 1010b and how to get access to those bits. 
      1 Reply Last reply Reply Quote 0
      • jhoepffner
        jhoepffner last edited by

        Hello,
        Best way would be javascript actor, here is the code

        function main() 
            { 
               var text = arguments[0];//input of text 
               text = text.charCodeAt(5);//fifth character ASCII value (decimal) 
               text = text.toString(2);//binary value 
               text = text + "b";//add b 
               return text;//output the text 
            } 

        And the izzy patch. (but binary for A is not 1010b, is 10000001b!) 5400e5-capture-decran-2016-01-20-a-09.38.28.png 2af459-texttobinary.izz

        Jacques Hoepffner http://hoepffner.info
        GigaByte 550b / Ryzen 7 3800X / Ram 64 Go / RTX 3090 24 Go / SSD 2 To / raid0 32 To
        MBP 13' i5 2.6 Ghz 16 Go / Intel Iris / macOs 10.11.6 / izzy 2.6.1 + 3.0.3b2
        MBP 15' i7 2.6 Ghz 16 Go / GTX 650M 1Go/ MacOs10.13.3 / Izzy 2.6.1
        MSI GS65 i7 3.6 Ghz 32 Go / GTX 1070 8 Go / Windows 10 / Izzy 3.0.3b2

        1 Reply Last reply Reply Quote 0
        • J
          janiv last edited by

          Hi again,

          This was my first posted problem and I am impressed by the speed of comment and views.

          I was a bit unclear when I stated that the letter 'F' should be conversed. Instead I meant hex 'F' should be conversed. That letter contains sensor information of 4 digital channels. Here is the picture of hex 'A':

          PS.
          I really should learn that javascript :)

          f58282-bitproblem.jpg

          1 Reply Last reply Reply Quote 0
          • m_theater
            m_theater last edited by

            @jhoepffner,

            attached is an old school approach
            from what i understood the string you get is a combination of hex values and each 0-F is representing a word
            to have a good overview about characters / hex values and bits i would suggest [MacASCII Display](http://www.synergycreations.com/downloads.html) a really nice little tool.

            8973c2-hex2bits.izz

            avk4.net

            1 Reply Last reply Reply Quote 0
            • jhoepffner
              jhoepffner last edited by

              Hello,
              I need to be more specific…
              Here is a patch and script doing the task

              function main()
              {
              	var out = [];//list declaration
              	var text = arguments[0];//input of text
              	var first = arguments[1];//first letter
              	var last = arguments[2]+1;//last letter
              	text = text.slice(first,last);//choosed letters
              	out[0] = text;//plain output
              	text = parseInt(text,16);
              	out[1] = text;//dec value
              	text = text.toString(2);
              	out[2] = text;//bi value
              	return out;//output the values
              }
              

              49da5b-capture-decran-2016-01-20-a-14.11.20.png b7741a-texttobinary.izz

              Jacques Hoepffner http://hoepffner.info
              GigaByte 550b / Ryzen 7 3800X / Ram 64 Go / RTX 3090 24 Go / SSD 2 To / raid0 32 To
              MBP 13' i5 2.6 Ghz 16 Go / Intel Iris / macOs 10.11.6 / izzy 2.6.1 + 3.0.3b2
              MBP 15' i7 2.6 Ghz 16 Go / GTX 650M 1Go/ MacOs10.13.3 / Izzy 2.6.1
              MSI GS65 i7 3.6 Ghz 32 Go / GTX 1070 8 Go / Windows 10 / Izzy 3.0.3b2

              1 Reply Last reply Reply Quote 0
              • jhoepffner
                jhoepffner last edited by

                @m-theateer

                Thank you for your help, but javascript is so more elegant, compact and easy to manage.
                jacques

                Jacques Hoepffner http://hoepffner.info
                GigaByte 550b / Ryzen 7 3800X / Ram 64 Go / RTX 3090 24 Go / SSD 2 To / raid0 32 To
                MBP 13' i5 2.6 Ghz 16 Go / Intel Iris / macOs 10.11.6 / izzy 2.6.1 + 3.0.3b2
                MBP 15' i7 2.6 Ghz 16 Go / GTX 650M 1Go/ MacOs10.13.3 / Izzy 2.6.1
                MSI GS65 i7 3.6 Ghz 32 Go / GTX 1070 8 Go / Windows 10 / Izzy 3.0.3b2

                1 Reply Last reply Reply Quote 0
                • m_theater
                  m_theater last edited by

                  @jhoepffner,

                  jep js is a big thing, but as you mentioned in the other post, the actors has to grow with the new processing possibilities (midi, tcp send )
                  attached you will find a short test in js
                  -
                  p.s
                  just saw your 2nd version this is great

                  fde0e6-js_hex2bits.izz

                  avk4.net

                  1 Reply Last reply Reply Quote 0
                  • DusX
                    DusX Tech Staff last edited by

                    I also like JS. Its just so easy to understand.. and flexible.

                    However, the native actors will be faster. In cases where you are parsing fast data streams (high baud serial connections etc...)
                    the native actors are going to eat up less cpu.
                    Probably not going to be a common issue, but worth noting for extreme cases.

                    Troikatronix Technical Support

                    • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                    • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                    • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                    Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                    1 Reply Last reply Reply Quote 0
                    • J
                      janiv last edited by

                      Hi again, 
                      Problem solved and love them both! Js and original worked both. Yes there is old school approach doing interactive spaces :)
                      I have rs485 network for reliability reasons. I use cheap industrial ADAM modules for polling digital IO. I made a speed test with max 115200 baud. New query was sent immediately after receiving acknowledge message from the IO module. I managed to get 110 query-response in a 1 second with Isadora traditional max 240 cycles. That means 70 digital sensors with polling interval 0.05s.
                      Here is the test rig:

                      48c267-img_4059.jpg

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post