Showing results 1 to 3 of 3

Thread: Modifying bit in Word

  1. #1
    Join Date
    10.06.2021
    Posts
    2

    Default Modifying bit in Word

    Hello!

    Sorry for my bad English, but I hope you will get me!

    Can I write/modify a bit in a whole Word variable with a Button, Combined Element or anything else?

    As you know, a Word variable got 16 bit (so every bit can be 0 or 1). So I would like to modify the first 4 bits by 4 buttons (button 1 is linked with bit 0, button 2 is linked with bit 1 …etc.). Every button must modify just one bit and not the others.

    To be more specific in what I need. For example, the button 2 is ON and the others are OFF (then the value of the word is 2). If I turn on the button 3, the value of the Word should get 6 (bit1=2, bit2=4, 2+4=6). Then If I turn off the button 2, the value should get 4 and not 0.

    May can I use such like a script or a programming thing to do that?

    Best regards.

  2. #2
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    1,025
    Best Answer

    Default Re: Modifying bit in Word

    Not directly in zenon screen elements. You can split this word variable to 16 stratonNG variables. The zenon Logic can as well get as put word <-> bits.

  3. #3
    Join Date
    10.06.2021
    Posts
    2

    Default Re: Modifying bit in Word

    Thanks’ for the reply

    I found another way to do that. In the programming interface, I made a macro (VBA) for what I need and it's working perfectly!

    However, I have another question now. Can or how can I add a macro in Smart-Objects?


Similar Threads

  1. Key word
    By stefaninotl in forum zenon Service Engine Supervisor
    Replies: 2
    Last Post: 13th July 2017, 12:52
  2. Reading bit from word
    By kuki in forum zenon Service Engine Supervisor
    Replies: 2
    Last Post: 31st May 2015, 14:20
  3. Can zenon handle 800,000-word-tags?
    By sunnamkung in forum zenon Service Engine Supervisor
    Replies: 1
    Last Post: 26th March 2012, 23:22
  4. Replies: 1
    Last Post: 31st January 2011, 15:23
  5. Word als Binär Code anzeigen
    By sknoerr in forum zenon Service Engine Supervisor
    Replies: 2
    Last Post: 26th March 2009, 19:51

Tags for this Thread

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •